-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
BIP374: Add message to rand computation #1758
base: master
Are you sure you want to change the base?
Conversation
9a4d124
to
27d4d38
Compare
This might be a good point to introduce a Changelog? |
@andrewtoth would you like to add a changelog here? I suppose an editor can add one if you prefer. |
@jonatack @murchandamus I've added a changelog section. |
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.
Perhaps you could use
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.
ACK with a few suggestions
@@ -118,6 +118,12 @@ This proposal is compatible with all older clients. | |||
A reference python implementation is included [https://github.com/bitcoin/bips/blob/master/bip-0374/reference.py here]. | |||
Test vectors can be generated by running <code>./bip-0374/gen_test_vectors.py</code> which will produce a CSV file of random test vectors for both generating and verifying proofs. These can be run against the reference implementation with <code>./bip-0374/run_test_vectors.py</code>. | |||
|
|||
== Changelog == | |||
|
|||
To help implementors understand updates to this BIP, we keep a list of substantial changes. |
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.
s/implementors/implementers/ (see #1766)
(or simply drop this line)
|
||
* 0.2.0 (2025-02): | ||
** Add the message to the rand computation | ||
* 0.1.0 (2024-12): |
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.
* 0.1.0 (2024-12): | |
* 0.1.0 (2024-12-26): |
|
||
To help implementors understand updates to this BIP, we keep a list of substantial changes. | ||
|
||
* 0.2.0 (2025-02): |
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.
Maybe the date of opening this PR, or the current date of the latest push.
* 0.2.0 (2025-02): | |
* 0.2.0 (2025-02-25): |
@@ -73,12 +73,12 @@ The algorithm ''GenerateProof(a, B, r, G, m)'' is defined as: | |||
* Let ''A = a⋅G''. | |||
* Let ''C = a⋅B''. | |||
* Let ''t'' be the byte-wise xor of ''bytes(32, a)'' and ''hash<sub>BIP0374/aux</sub>(r)''. | |||
* Let ''rand = hash<sub>BIP0374/nonce</sub>(t || cbytes(A) || cbytes(C))''. | |||
* Let ''m' = m if m is provided, otherwise an empty byte array''. | |||
* Let ''rand = hash<sub>BIP0374/nonce</sub>(t || cbytes(A) || cbytes(C) || m')''.<ref name="why_include_m_in_rand"> ''' Why include the message in the rand computation?''' Not including the message in the rand compution could leak ''a'' if two proofs were constructed for the same ''a'', ''B'', and ''G'' but different ''m'' and all-zero ''r''.</ref> |
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.
* Let ''rand = hash<sub>BIP0374/nonce</sub>(t || cbytes(A) || cbytes(C) || m')''.<ref name="why_include_m_in_rand"> ''' Why include the message in the rand computation?''' Not including the message in the rand compution could leak ''a'' if two proofs were constructed for the same ''a'', ''B'', and ''G'' but different ''m'' and all-zero ''r''.</ref> | |
* Let ''rand = hash<sub>BIP0374/nonce</sub>(t || cbytes(A) || cbytes(C) || m')''.<ref name="why_include_m_in_rand"> ''' Why include the message in the rand computation?''' Not including the message in the rand compution could leak ''a'' if two proofs were constructed for the same ''a'', ''B'', and ''G'' but a different message ''m'' and an all-zero ''r''.</ref> |
Include the message in the rand computation to avoid leaking
a
as described here.