-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
bip327: minor fixes #1647
base: master
Are you sure you want to change the base?
bip327: minor fixes #1647
Conversation
Additionally, I removed the following Lines 442 to 444 in 812907c
We should probably return |
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 2fc3ef4.
@@ -143,7 +143,8 @@ | |||
], | |||
"error": { | |||
"type": "invalid_contribution", | |||
"signer": 1 | |||
"signer": 1, | |||
"contrib": "psig" |
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.
b6d7143: you'll also need to make this change in the python file used to generate the json file - bip-0327/gen_vectors_helper.py
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.
Ahh yes. I missed it. Thanks!
Fixed now.
bip-0327/reference.py
Outdated
@@ -598,7 +596,9 @@ def test_sign_verify_vectors() -> None: | |||
|
|||
aggnonces = fromhex_all(test_data["aggnonces"]) | |||
# The aggregate of the first three elements of pnonce is at index 0 | |||
assert(aggnonces[0] == nonce_agg([pnonce[0], pnonce[1], pnonce[2]])) | |||
assert (aggnonces[0] == nonce_agg([pnonce[0], pnonce[1], pnonce[2]])) | |||
# The aggregate of the first and fourth elements of pnonce is at index 1 |
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.
b6d7143: nit: maybe mention context about them adding to infinity like in the PR writeup? (it wasn't immediately obvious to me.)
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.
Fixed
- An error test vector doesn’t specify the InvalidContributionError type - In *DeterministicSign*, use GetXonlyPubkey instead of GetPubkey - The key_agg_and_tweak fn doesn’t specify the return type - In partial_sig_verify_internal, the pubkey arg should be PlainPk - Remove unused enumerate() fn calls - In test_sign_verify, add an additional assert statement
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.
Thanks @siv2r! Here's a commit that update the BIP to 1.0.2: https://github.com/jonasnick/bips/commits/minor-fixes-jn/. Feel free to cherry-pick.
We should probably return False when cpoint throws an exception when parsing P, R_s1, and R_s2. Currently, the partial_sig_verify_internal simply crashes.
That would also be possible, but it wouldn't have an effect on users of the API. Right now, partial_sig_verify_internal
raises a ValueError that cannot be triggered by any of the public functions and that is tested by test vectors.
(cherry picked from commit 4f2e6e7)
Thanks, I cherry-picked it! Just changed my name.
Hmm, we can avoid making this change. If we proceed, we would also need to place the I initially wanted this change because |
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 2379058
Please don't merge it yet. The changelog says |
I made some minor corrections, which I believe are beneficial. Please let me know if any of them are incorrect or need modification.
Changes:
InvalidContributionError
typeGetXonlyPubkey
instead ofGetPubkey
(doesn’t exist)key_agg_and_tweak
fn doesn’t specify the return typepartial_sig_verify_internal
, the pubkey arg type should bePlainPk
rather thanbytes
enumerate()
callstest_sign_verify
, add an additionalassert
statement that checks if two pubnonces add up to the infinity aggnonce.cc @jonasnick @real-or-random