Repository navigation
BIP143: specify which CHECKMULTISIG keys must be compressed - #2370
jeanpablojp wants to merge 2 commits into
Conversation
Version 1.0.0 is the move to Proposed in 0402dd2 and 1.0.1 is the move to Final in bitcoin#584.
|
ACK d562c0f Checked the new paragraph against OP_CHECKMULTISIG in Bitcoin Core master (interpreter.cpp): keys are visited from the top of the stack, CheckPubKeyEncoding runs on each visited key before the signature check, and the loop exits once all signatures are matched or nSigsCount > nKeysCount. The OP_1 P1 P2 OP_2 OP_CHECKMULTISIG example matches the "second key uncompressed and signing with the first key" vectors in script_tests.json, which pass under WITNESS_PUBKEYTYPE. Also checked the changelog: 1.0.0 matches 0402dd2 (Proposed, 2017-10-29) and 1.0.1 matches the Final move merged from #584 (2018-02-12). The Version header and entry format match BIP 3. link-format-chk.sh, diffcheck.sh and buildtable.pl pass on this branch merged with master. Optional: the example only shows a key that is not checked. One sentence saying a reached key is checked even if it does not match the signature would make the boundary clearer; the "first key uncompressed and signing with the second key" vectors fail with WITNESS_PUBKEYTYPE. |
|
Thank you for reviewing, @connectybot. |
|
@jeanpablojp, quick check on d562c0f: in |
In OP_CHECKMULTISIG, Bitcoin Core only checks the public keys the opcode reaches, and its script tests have vectors where an uncompressed key that is not reached passes with WITNESS_PUBKEYTYPE. Reviewers of bitcoin/bitcoin#33759 preferred changing the BIP to match, see also item 4 of bitcoin/bitcoin#33882.
d562c0f to
34978d3
Compare
|
Thanks, I added the suggested sentence. |
BIP143 says each public key passed to a sigop in a v0 witness program must be compressed. In
OP_CHECKMULTISIG, Bitcoin Core only checks the keys the opcode reaches, andscript_tests.jsonasserts that an uncompressed key that is never reached passes withWITNESS_PUBKEYTYPE.bitcoin/bitcoin#33759 proposed checking every key instead. Reviewers preferred updating the BIP to match the implementation, and the author of that PR was fine with clarifying the BIP. Item 4 of bitcoin/bitcoin#33882 lists both options.
The second commit adds a paragraph describing the deployed behavior. The first adds a version header and changelog per BIP 3, with 1.0.0 as the move to Proposed in 0402dd2 and 1.0.1 as the move to Final in #584.