@@ -42,7 +42,9 @@ The complete signature is then the `(s, R)` where `s = sum_i s_i` and `R = sum_i
42
42
43
43
# API Usage
44
44
45
- It is essential to security that signers use a unique uniformly random none for all
45
+ The following sections describe use of our API, and are mirrored in code in ` src/modules/musig/example.c ` .
46
+
47
+ It is essential to security that signers use a unique uniformly random nonce for all
46
48
signing sessions, and that they do not reuse these nonces even in the case that a
47
49
signing session fails to complete. To that end, all signing state is encapsulated
48
50
in the data structure ` secp256k1_musig_session ` . The API does not expose any
@@ -70,8 +72,8 @@ signature process, which is also a supported mode) acts as follows.
70
72
71
73
### Signing Participant
72
74
73
- 1. Starts the session by calling `secp256k1_musig_session_initialize`. This
74
- function outputs
75
+ 1. The signer starts the session by calling `secp256k1_musig_session_initialize`.
76
+ This function outputs
75
77
* an initialized session state in the out-pointer `session`
76
78
* an array of initialized signer data in the out-pointer `signers`
77
79
* a commitment `H(R_i)` to a nonce in the out-pointer `nonce_commitment32`
@@ -96,15 +98,16 @@ signature process, which is also a supported mode) acts as follows.
96
98
from each signer `j`. On receipt of a nonce `R_j` he calls the function
97
99
`secp256k1_musig_set_nonce` to record this fact. This function checks that
98
100
the received nonce is consistent with the previously-received nonce and will
99
- return 0 in this case.
101
+ return 0 in this case. The signer must also call this function with his own
102
+ nonce and his own index `i`.
100
103
These nonces `R_i` are secp256k1 public keys; they should be serialized using
101
104
`secp256k1_ec_pubkey_serialize` and parsed with `secp256k1_ec_pubkey_parse`.
102
105
5. Once all nonces have been exchanged in this way, signers are able to compute
103
106
their partial signatures. They do so by calling `secp256k1_musig_session_combine_nonces`
104
107
which updates in place
105
108
* the session state `session`
106
109
* the array of signer data `signers`
107
- It outputs an auxillary integer `nonce_is_negated` and has an auxillary input
110
+ It outputs an auxilary integer `nonce_is_negated` and has an auxilary input
108
111
`adaptor`. Both of these may be set to NULL for ordinary signing purposes.
109
112
If the signer did not provide a message to `secp256k1_musig_session_initialize`,
110
113
a message must be provided now by calling `secp256k1_musig_session_set_msg` which
@@ -125,9 +128,9 @@ signature process, which is also a supported mode) acts as follows.
125
128
126
129
### Non-signing Participant
127
130
128
- A participant who wants to verify the signing process but not actually contribute a
129
- partial signature, may do so using the above instructions except for the following
130
- changes:
131
+ A participant who wants to verify the signing process, i.e. check that nonce commitments
132
+ are consistent and partial signatures are correct without contributing a partial signature,
133
+ may do so using the above instructions except for the following changes:
131
134
132
135
1. A signing session should be produced using `musig_session_initialize_verifier`
133
136
rather than `musig_session_initialize`; this function takes no secret data or
@@ -170,7 +173,7 @@ as follows.
170
173
171
174
The above steps are executed identically for both signing sessions. However, step 9 will
172
175
not work as before, since the partial signatures will not add up to a valid total signature.
173
- Additonal steps must be taken, and it is at this point that the two signing sessions
176
+ Additional steps must be taken, and it is at this point that the two signing sessions
174
177
diverge. From here on we consider "Session A" which benefits Alice (e.g. which sends her
175
178
coins) and "Session B" which benefits Bob (e.g. which sends him coins).
176
179
0 commit comments