Table of contents
Open Table of contents
What it is
An adaptor signature scheme is a signing algorithm that’s bound to a secret value and carried out in two steps. While creating the signature, an incomplete, partial signature is generated which can be adapted into a full, valid signature by incorporating a secret value. The secret value can be recovered by getting access to the partial- and full signature.
Adaptor signatures are useful in the Blockchain space as they allow for the implementation of ”Scriptless Scripts”. Those “scripts” are a set of rules that can be implemented by solely relying on the existence of a digital signature verification mechanism which is a fundamental requirement for any Blockchain.
As an example, one can use adaptor signatures to implement ”Atomic Swaps”, a mechanism by which two parties who don’t trust each other can exchange digital currencies with one another. The way this would work is that the secret value that turns a partial signature into a full signature is leaked when Party A posts a valid transaction on Blockchain #1 to move funds from Party B to Party A. Party B can then use the leaked secret to turn a partial signature to move funds on Blockchain #2 from Party A to Party B into a full, valid signature.
How it works
Given that this post describes adaptor signatures based on Schnorr Signatures, it’s useful to have a basic understanding of those two concepts before continuing.
As a quick recap, an adaptor signature is characterized by four different operations:
- PreSign which generates a partial signature that’s bound to a secret
- PreVerify which allows one to verify that a partial signature was computed correctly
- Adapt which turns a partial signature into a valid, full signature
- Extract which allows for the recovery of the secret value given the partial- and full signature
An adaptor signature scheme also requires a statement / witness pair for a hard relation which in our case is that of the discrete logarithm on Elliptic Curves (ECDLP). Given a value it’s computationally infeasible to recover from . In this case the witness that needs to be kept secret would be whereas the statement that can be shared publicly is .
As alluded to above, we’ll be working with an Elliptic Curve that is of order and has a generator . All calculations are done if not stated otherwise.
The scenario described here is that Alice who knows the statement and witness wants Bob to sign her message . Bob on the other hand doesn’t just simply want to sign Alice’s message with his private key . He wants to be able to learn Alice’s witness which might be useful for him in future interactions (e.g. when both of them engage in an ”Atomic Swap” protocol as briefly described above).
Setup
As a first step, Alice generates her statement / witness pair by randomly sampling a value for her witness from . She then multiplies by the generator to derive the statement .
Bob follows similar steps to generate his private- and public key pair. He samples a random value from which is his private key. He then multiplies by the generator to derive the public key.
Alice then sends the message she wants to get a signature for alongside her statement to Bob.
PreSign
Bob now generates an incomplete, partial signature that’s not valid according to the Schnorr Signature verification algorithm but can be verified for correctness by Alice.
As a first step, he generates a random, secret nonce value which he then multiplies by the generator to derive a publicly shareable nonce value . It’s important that is kept private and is never reused.
In a regular Schnorr Signature Bob would now create a commitment to his public key , the nonce and the message by computing (where is a cryptographic hash function).
This however would already be a part of a valid Schnorr Signature. To it into an incomplete, partial signature Bob adds Alice’s statement to .
He also computes the second part of the Schnorr Signature as the challenge he just generated multiplied by his private key which is added to the nonce .
Bob now obtained an incomplete, partial signature comprised of the values and which he sends to Alice alongside his public key .
PreVerify
Once Alice received , and she calculates and as follows.
She then validates if the partial signature she received from Bob was correctly computed by comparing his value to the she calculated herself.
The partial signature was correctly computed if both values are the same.
Adapt
If the partial signature is valid, Alice can turn it into a full signature by adding her witness to .
Extract
Once Alice shares the full, valid signature publicly Bob can extract Alice’s witness using the partial signature he generated and the full signature Alice just shared.
Why it works
The key ingredient that turns a regular Schnorr Signature into an adaptor signature is the usage of the statement and its witness in the calculation of and .
PreVerify
To create a partial signature that only verifies if the witness is incorporated, we adapted the generation of to include the statement by adding it to the public nonce value .
Also remember that we defined to be the multiplication of the challenge with the private key added to the nonce .
Note that according to the regular Schnorr Signature verification algorithm this partial signature is invalid (due to the usage of ).
However, there’s a way to verify that the partial signature was computed correctly. As a first step, the value is calculated as the multiplication of with the generator subtracted from the multiplication of the challenge with the public key .
Next up, the value for the challenge is calculated as follows.
We can then check if .
To see that this equality holds for correctly computed partial signatures we have to expand .
As can be seen, the value equals the value that was derived while computing the partial signature.
Given that and we can see that .
Adapt
A partial signature can be adapted by adding the witness to .
By doing so, this turns the partial signature into a full signature that verifies according to the Schnorr Signature verification algorithm.
Extract
Once the full signature is publicly shared, one can use the partial- and full 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 - Schnorr Signature
- Andrew Poelstra - Lightning in Scriptless Scripts
- Bitcoin Optech - Adaptor Signatures
- Conduition - A Dive Into the Math Behind Bitcoin Schnorr 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 Schnorr - Cross Chain Atomic Swaps
- Ichiro Kuwahara - Adaptor Signature on Schnorr - Lightning Network