Table of contents
Open Table of contents
What it is
An adaptor signature scheme is a signing algorithm that’s carried out in two steps while binding itself to a secret value. During signature creation an incomplete, partial signature is generated which can then be turned into a valid, full signature by incorporating a secret value. Once the full signature is published, the secret value can be recovered using the partial- and full signature.
Adaptor signatures are useful primitives for Blockchain applications as they support the implementation of ”Scriptless Scripts”. Scriptless scripts can be implemented as rules that rely only on the existence of digital signatures and their verification algorithm, a requirement all Blockchains support out-of-the-box.
A prominent example for the usage of adaptor signatures is that of an ”Atomic Swap”, a protocol that allows two parties to exchange digital currencies with each other without having to trust one another. At a high level, Party A would leak the secret value that turns a partial signature into a full signature when posting a valid transaction on Blockchain #1 to move funds from Party B to Party A. Party B can then use this leaked secret to adapt a partial into a full signature to move funds from Party A to Party B on Blockchain #2.
How it works
This post describes adaptor signatures based on ECDSA Signatures, so it’s useful to have a solid understanding of both concepts before continuing.
Let’s quickly refresh our memory about adaptor signatures. There are four different operations that characterize an adaptor signature scheme:
- PreSign generates a partial signature bound to a secret value
- PreVerify verifies a partial signature for correctness
- Adapt turns a partial signature into a full signature
- Extract recovers the secret value using the partial- and full signature
In addition to the operations outlined above, there’s also a requirement for a statement / witness pair for a hard relation . In our case such hard relation is that of the discrete logarithm problem on Elliptic Curves (ECDLP). So if one has access to it’s computationally infeasible to calculate from . The statement which can be publicly shared would be whereas the witness which needs to be kept private is .
As discussed, we’ll work with an Elliptic Curve that has a generator and is of order . All calculations are done if not stated otherwise.
Our example scenario we’ll work through to learn about ECDSA-based adaptor signatures is that of Alice who knows the statement and witness wanting to get a signature over her message from Bob. Bob, however doesn’t simply want to sign Alice’s message with his private key . In exchange for signing her message , he wants to be able to learn the witness which could be useful for him in future interactions (e.g. when Alice and Bob use adaptor signatures in an ”Atomic Swap” protocol as touched upon above).
Setup
At first, Alice generates her statement / witness pair. She does so by randomly sampling a value from which is her witness. She then multiplies the witness by the generator to derive the statement .
Bob on the other hand generates his private- and public key pair. He samples a random value from which is his private key. Multiplying this private key by the generator results in his public key .
Next up, Alice sends the message she wants to get a signature for alongside her statement to Bob.
PreSign
Given that Bob doesn’t want go generate a full signature thats valid according to the ECDSA Signature verification algorithm, he creates a partial signature using Alice’s statement instead. This partial signature can then be verified for correctness by Alice.
To do so Bob generates a random nonce which he then multiplies by the generator to derive a publicly shareable nonce value .
Bob also generates a second, publicly shareable nonce value by multiplying the randomly sampled with Alice’s statement .
Both values and are points on the Elliptic Curve and therefore have - and -coordinates. Because of that Bob can define a value as the -coordinate of .
Next up, Bob needs to turn Alice’s message into a representation that can be “mapped onto” the Elliptic Curve . This is done by hashing with a cryptographic hash function and interpreting the result as a point on the curve.
As a last step, he computes the value as the inverse of the nonce multiplied by the hashed message which is added to the product of the point and his secret key .
Bob has successfully calculated the partial signature which consists of the values and . He sends these values alongside his public key as well as and to Alice.
PreVerify
Alice can now check if the partial signature was calculated correctly.
At first, she checks if she can recompute the same value for by comparing it to the -coordinate of the value Bob shared.
She recomputes by hashing her message with the same cryptographic hash function that Bob used.
Next up, the values and are calculated using the inverse of and multiplying it by the hashed message and the value respectively.
Alice then checks if the value she received from Bob equals multiplied by the generator added to the multiplication of by Bob’s public key .
The partial signature was calculated correctly if the above statement is true.
Adapt
Once the verification of the partial signature succeeds, Alice can turn it into a full signature by multiplying with the inverse of her witness .
Extract
When Alice shares the full, valid signature publicly Bob can recover Alice’s witness using both, the partial- and full signature.
Why it works
The core building block that turns a regular ECDSA Signature into an adaptor signature is the usage of the witness and its statement in the calculation of and .
PreVerify
First, recall that is the hash of the message which is interpreted as a point on the Elliptic Curve .
Using the equation of , we can isolate .
Expanding and substituting for (which we’ve just calculated), we can see that .
Taking a look at the partial signature generation above, we can verify that this Elliptic Curve point is the same as the one Bob calculated by multiplying with .
However, is not the same as which was used by Bob to derive the value used for a full signature. Alice therefore needs to adapt the partial signature first to turn it into a full, valid signature.
Adapt
A partial signature can be adapted by multiplying with the inverse of the witness .
Deriving this way turns the partial signature into a full signature that verifies according to the ECDSA Signature verification algorithm.
Again, recall that the value is the result of hashing the message with a cryptographic hash function.
Using the value we just derived, we can isolate .
We can now use the regular ECDSA Signature verification algorithm to verify the adapted signature.
Checking the partial signature generation, we can see that this Elliptic Curve point is the same that Bob used to derive the value . The signature is therefore valid.
Extract
Once Alice shares the full signature publicly, it can be used together with the partial signature to extract the witness .
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.
- Wikipedia - Elliptic Curve Digital Signature Algorithm
- Wikipedia - Paillier Cryptosystem
- Pedro Moreno-Sanchez - Scriptless Scripts with ECDSA
- 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
- Ichiro Kuwahara - Adaptor Signature - Schnorr Signature and ECDSA
- Ichiro Kuwahara - Adaptor Signature on ECDSA
- Ichiro Kuwahara - Adaptor Signature in Discreet Log Contracts on ECDSA
- Yehuda Lindell - Fast Secure Two-Party ECDSA Signing
- Discreet Log Contracts - ECDSA Adaptor Signatures