-
Notifications
You must be signed in to change notification settings - Fork 5.9k
BIP-327: correct DeterministicSign pubnonce and key length #2066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
lisenokdonbassenok
wants to merge
2
commits into
bitcoin:master
from
lisenokdonbassenok:fix/bip327-deterministicsign-spec
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -606,7 +606,7 @@ Algorithm ''DeterministicSign(sk, aggothernonce, pk<sub>1..u</sub>, tweak<sub>1. | |
| ** The secret signing key ''sk'': a 32-byte array | ||
| ** The aggregate public nonce ''aggothernonce'' (see [[#modifications-to-nonce-generation|above]]): a 66-byte array | ||
| ** The number ''u'' of individual public keys with ''0 < u < 2^32'' | ||
| ** The individual public keys ''pk<sub>1..u</sub>'': ''u'' 32-byte arrays | ||
| ** The individual public keys ''pk<sub>1..u</sub>'': ''u'' 33-byte arrays | ||
| ** The number ''v'' of tweaks with ''0 ≤ v < 2^32'' | ||
| ** The tweaks ''tweak<sub>1..v</sub>'': ''v'' 32-byte arrays | ||
| ** The tweak methods ''is_xonly_t<sub>1..v</sub>'': ''v'' booleans | ||
|
|
@@ -623,7 +623,7 @@ Algorithm ''DeterministicSign(sk, aggothernonce, pk<sub>1..u</sub>, tweak<sub>1. | |
| * Let ''k<sub>i</sub> = int(hash<sub>MuSig/deterministic/nonce</sub>(sk' || aggothernonce || aggpk || bytes(8, len(m)) || m || bytes(1, i - 1))) mod n'' for ''i = 1,2'' | ||
| * Fail if ''k<sub>1</sub> = 0'' or ''k<sub>2</sub> = 0'' | ||
| * Let ''R<sub>⁎,1</sub> = k<sub>1</sub>⋅G, R<sub>⁎,2</sub> = k<sub>2</sub>⋅G'' | ||
| * Let ''pubnonce = cbytes(R<sub>⁎,2</sub>) || cbytes(R<sub>⁎,2</sub>)'' | ||
| * Let ''pubnonce = cbytes(R<sub>⁎,1</sub>) || cbytes(R<sub>⁎,2</sub>)'' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one seems right to me. |
||
| * Let ''d = int(sk)'' | ||
| * Fail if ''d = 0'' or ''d ≥ n'' | ||
| * Let ''pk = cbytes(d⋅G)'' | ||
|
|
@@ -782,6 +782,9 @@ An exception to this rule is <code>MAJOR</code> version zero (0.y.z) which is fo | |
| The <code>MINOR</code> version is incremented whenever the inputs or the output of an algorithm changes in a backward-compatible way or new backward-compatible functionality is added. | ||
| The <code>PATCH</code> version is incremented for other changes that are noteworthy (bug fixes, test vectors, important clarifications, etc.). | ||
|
|
||
| * '''1.0.3''' (2025-12-28): | ||
| ** Clarify and correct the specification of ''DeterministicSign'' to align it with the rest of BIP-0327 and the reference implementation. | ||
| ** Specify individual public keys as 33-byte compressed points and define ''pubnonce'' as ''cbytes(R<sub>⁎,1</sub>) || cbytes(R<sub>⁎,2</sub>)'' to match ''NonceAgg''/''PartialSigVerify''. | ||
| * '''1.0.2''' (2024-07-22): | ||
| ** Fix minor bug in the specification of ''DeterministicSign'' and add small improvement to a ''PartialSigAgg'' test vector. | ||
| * '''1.0.1''' (2024-05-14): | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the line right above states that keys are between 0 < u < 2^32, it seems to me that we are looking at an x-only key and the text is already correct, but maybe I’m misinterpreting that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are.
uis the number of public keys involved in signing and not related to their length.