Table of contents
Open Table of contents
What it is
An adaptor signature scheme is a two-step signing algorithm that’s bound to a secret. During signature creation, a partial signature is generated which can be adapted with the secret to turn it into a valid full signature. The secret can then be extracted using the partial- and full signature.
Adaptor signatures are a useful primitive in the Blockchain space as they tie together the authorization of a transaction with the leakage of a secret. In fact, adaptor signatures are the core building blocks used in Blockchain protocols to implement ”Scriptless Scripts” which are rules that can solely be implemented and enforced with digital signatures.
One such protocol implementation is that of an ”Atomic Swap”, in which two parties who don’t trust each other exchange digital currencies with one another on (potentially different) Blockchains. In this case, the secret that’s leaked by posting a valid transaction to move funds on Blockchain #1 can be used to finalize another, partial signature which moves funds on Blockchain #2.
How it works
An adaptor signature scheme is characterized by four different operations:
- PreSign
- PreVerify
- Adapt
- Extract
Furthermore, a statement / witness pair for a hard relation needs to be defined such that it’s computationally infeasible to extract the witness given the statement .
In practice, such a hard relation can be that of a discrete logarithm which is also used in cryptosystems such as Elliptic Curve Cryptography.
Given a generator of an Elliptic Curve with order we can define the statement / witness pair as follows:
Conceptually one can think of the statement / witness pair along the same lines as a public / private key pair, in which the statement can be publicly shared, while the witness needs to be kept secret.
PreSign
The PreSign operation creates a partial signature for a message . It takes as input a private key , the message as well as the statement .
The partial signature is an incomplete signature according to the signature scheme’s verification method. However it can be checked for correctness with the help of the PreVerify operation.
PreVerify
PreVerify can be used to check if a partial signature was generated correctly. Its inputs are the public key , the message , the partial signature as well as the statement .
Adapt
The Adapt operation turns a partial signature into a full signature with the help of the witness . It takes as input the partial signature as well as the witness .
Extract
Extract operates on the full signature and its partial signature to reveal the witness .
Example
To illustrate how an adaptor signature scheme can be used in practice, we’ll walk through an example in which Alice, who knows the statement and witness wants Bob to generate a signature over her message with his private key of which the public key is .
Bob however doesn’t want to create a valid signature which Alice can use right away. He wants to generate a partial signature that can be turned into a full signature by Alice using her secret witness . In doing so, Bob wants to be able to learn the witness once Alice shares the full signature publicly.
While this setup might sound fabricated, it’s in fact the foundation to implement an ”Atomic Swap” without the reliance on a Blockchain’s scripting capabilities.
Throughout this example we’ll use an Elliptic Curve that is of order and has a generator . All calculations are done if not stated otherwise.
As a first step, Alice generates her statement / witness pair by randomly sampling the witness from to then multiply it by the generator to derive the statement :
Bob generates his private- and public key pair similarly by randomly sampling a value from for the private key which is then multiplied by the generator to derive the public key .
Next up, Alice sends the message she wants Bob to sign alongside the statement to Bob. Bob in turn uses the PreSign operation to generate an incomplete, partial signature over the message using his private key and Alice’s statement :
Bob then sends this partial signature to Alice alongside his public key .
Given that is incomplete, it won’t verify using the signature scheme’s verification method. However Alice can check if what Bob sent her is in fact a correct partial signature over her message . She does this by using PreVerify with the inputs of Bob’s public key , her message , the partial signature as well as her statement .
Upon successful verification, she uses the Adapt operation which takes as inputs the partial signature and the witness to generate a full signature .
Once the fill signature is publicly accessible (e.g. by posting it on a public Blockchain) Bob can learn Alice’s witness using both, the full signature Alice derived as well as the partial signature he generated. He does this by using the Extract operation with the two signatures as input.
Why it works
While this is more of a conceptual writeup about adaptor signatures which are implemented differently for individual signature schemes, they all have the same high-level idea in common.
The intuition behind the inner-workings of adaptor signature is that of hiding the witness , which is necessary to turn a partial signature into a full signature, into the randomness that’s used for signing.
If you’re curious how an adaptor signature scheme can be implemented for signature schemes that are used in the real world, you can check out the writeups on Schnorr Adaptor Signatures as well as ECDSA Adaptor Signatures.
References
The following resources have been invaluable for me to learn the concepts discussed in this article.
You should definitely give them a read if you want to dive deeper into the topic.
- Andrew Poelstra - Lightning in Scriptless Scripts
- Bitcoin Optech - Adaptor Signatures
- Conduition - The Riddles of Adaptor Signatures
- Aumayr et al. - Generalized Channels from Limited Blockchain Scripts and Adaptor Signatures
- Thyagarajan et al. - Universal Atomic Swaps: Secure Exchange of Coins Across All Blockchains
- YouTube - Generalized Channels from Limited Blockchain Scripts and Adaptor Signatures
- YouTube - Universal Atomic Swaps: Secure Exchange of Coins Across All Blockchains