Skip to content

Commit 8cab1c5

Browse files
committed
f more nits
1 parent 0492592 commit 8cab1c5

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/modules/musig/musig.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ The complete signature is then the `(s, R)` where `s = sum_i s_i` and `R = sum_i
4242

4343
# API Usage
4444

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
4648
signing sessions, and that they do not reuse these nonces even in the case that a
4749
signing session fails to complete. To that end, all signing state is encapsulated
4850
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.
7072

7173
### Signing Participant
7274

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
7577
* an initialized session state in the out-pointer `session`
7678
* an array of initialized signer data in the out-pointer `signers`
7779
* 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.
9698
from each signer `j`. On receipt of a nonce `R_j` he calls the function
9799
`secp256k1_musig_set_nonce` to record this fact. This function checks that
98100
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`.
100103
These nonces `R_i` are secp256k1 public keys; they should be serialized using
101104
`secp256k1_ec_pubkey_serialize` and parsed with `secp256k1_ec_pubkey_parse`.
102105
5. Once all nonces have been exchanged in this way, signers are able to compute
103106
their partial signatures. They do so by calling `secp256k1_musig_session_combine_nonces`
104107
which updates in place
105108
* the session state `session`
106109
* 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
108111
`adaptor`. Both of these may be set to NULL for ordinary signing purposes.
109112
If the signer did not provide a message to `secp256k1_musig_session_initialize`,
110113
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.
125128

126129
### Non-signing Participant
127130

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:
131134

132135
1. A signing session should be produced using `musig_session_initialize_verifier`
133136
rather than `musig_session_initialize`; this function takes no secret data or
@@ -170,7 +173,7 @@ as follows.
170173

171174
The above steps are executed identically for both signing sessions. However, step 9 will
172175
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
174177
diverge. From here on we consider "Session A" which benefits Alice (e.g. which sends her
175178
coins) and "Session B" which benefits Bob (e.g. which sends him coins).
176179

0 commit comments

Comments
 (0)