Coin Brief ENDE

BIP 360 fixes a post-quantum test vector that lacked its last opcode byte

The BIPs repository merged pull request #2376 on 3 December, a set of corrections to BIP 360, the proposal for Pay-to-Merkle-Root (P2MR) outputs. P2MR is a script tree output type like Pay-to-Taproot, but without Taproot's key path spend, the part the proposal identifies as vulnerable to a quantum attack. Its outputs use SegWit version 2, so mainnet addresses would start with bc1z.

The substantive fix is in the post-quantum test vectors. In one leaf, the script's assembly listing ended with OP_SUBSTR, but the hex encoding stopped one byte short and lacked the opcode, 7f. With the byte added, everything derived from the leaf changes: its leaf hash, the tree's Merkle root, the expected scriptPubKey, the control block and the example bc1z address. Anyone who had tested an implementation against the old vector was checking it against an output that did not match its own script.

BIP 360 fixes a post-quantum test vector that lacked its last opcode byte
BIP 360 fixes a post-quantum test vector that lacked its last opcode byte — Coin Brief

A second vector changed its stated purpose. It covers two leaves with different leaf versions and used to say the reference code ignored the given version and that throwing an error would probably be better. It now says an unknown leaf version should be accepted and the output built successfully. Two vectors for a missing script tree now pass null instead of an empty string, and the Python reference implementation was changed so that its test run includes the PQC vectors.

The rest of the commit is editorial: a corrected P2PK example, an added reference to BIP 350 next to BIP 173 for the bc1z encoding, and typos.