Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

andrewtoth
Copy link
Contributor

Include the message in the rand computation to avoid leaking a as described here.

@murchandamus
Copy link
Contributor

This might be a good point to introduce a Changelog?

@jonatack
Copy link
Member

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.

@andrewtoth
Copy link
Contributor Author

@jonatack @murchandamus I've added a changelog section.

Copy link
Contributor

@murchandamus murchandamus left a 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

Copy link
Member

@jonatack jonatack left a 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.
Copy link
Member

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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):
Copy link
Member

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.

Suggested change
* 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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants