You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When precomputing the SIGHASH of V5 txs, we pick the consensus branch ID from the nConsensusBranchId field if the tx has it. If the field is set to a consensus branch ID corresponding to NU5 and NU6 is active, the SIGHASH precomputation doesn't follow this consensus rule:
[NU6 only] All transactions MUST use the NU6 consensus branch ID 0xC8E71055 as defined in ZIP-253.
This bug was mitigated in #9063 by checking the nConsensusBranchId field early in the tx verifier, so it won't accept NU5 transactions after NU6 activation anymore. However, we should fix the precomputation to adhere to the above consensus rule since it takes place in zebra-chain and not zebra-consensus, where the verifier is, and can be used by other crates.
upbqdn
changed the title
The tx verifier does not enforce using the correct consensus branch ID in the SIGHASH computation
The tx verifier does not enforce using the correct consensus branch ID in the SIGHASH precomputation
Jan 24, 2025
When precomputing the SIGHASH of V5 txs, we pick the consensus branch ID from the
nConsensusBranchId
field if the tx has it. If the field is set to a consensus branch ID corresponding to NU5 and NU6 is active, the SIGHASH precomputation doesn't follow this consensus rule:This bug was mitigated in #9063 by checking the
nConsensusBranchId
field early in the tx verifier, so it won't accept NU5 transactions after NU6 activation anymore. However, we should fix the precomputation to adhere to the above consensus rule since it takes place inzebra-chain
and notzebra-consensus
, where the verifier is, and can be used by other crates.The bug originates in this fn: https://github.com/zcash/librustzcash/blob/443faf9e855e0acf7aca509885ac2ede8090c5bd/zcash_primitives/src/transaction/mod.rs#L604-L616, which considers the
consensus_branch_id
param for pre-V5 txs but doesn't do so for V5 ones.The text was updated successfully, but these errors were encountered: