BIP 143
Transaction Signature Verification for Version 0 Witness Program
- Status
- Deployed
- Type / Layer
- Specification / Consensus (soft fork)
- Authors
- Johnson Lau, Pieter Wuille
- Assigned
- Status verified
- (next check by 2027-02-01)
- Source
- github.com/bitcoin/bips/blob/master/bip-0143.mediawiki
Text updated:
Summary
Defines a new transaction digest algorithm - the signature hash - used for version 0 witness programs under SegWit. It states two goals: to minimize redundant data hashing during verification, and to cover the value of the input being spent. The original algorithm rehashed the whole transaction for every input, so the amount of data hashed grew with transaction size; because the number of inputs and the cost of each hashing pass grow together, total work scaled with the square of the size, and a single oversized transaction could take longer to verify than an entire ordinary block. BIP143 introduces values that are hashed once in advance and reused across inputs - hashPrevouts, hashSequence and hashOutputs - which brings the growth back to linear. It also folds the amount of the output being spent into the digest, so a false amount for the input being signed makes that signature invalid. That signature does not protect the amounts of the other inputs, however. Safe fee verification for a multi-input transaction requires checking those amounts too. BIP174 explains that some wallets require the full previous transaction even for SegWit inputs to prevent attacks that trick a user into repeatedly signing transactions with falsified input amounts.
Why it matters
It closed a denial-of-service avenue in which a deliberately large transaction imposed disproportionate verification cost, doing so on the new SegWit side rather than by changing legacy rules, and it is what lets hardware wallets verify the fee they are signing. BIP341 extends the same approach for Taproot, committing to the amounts and scriptPubKeys of every input being spent when SIGHASH_ANYONECANPAY is not set.
Related BIPs
Related articles
This page carries a summary, not a translation. The original document is authoritative, and the metadata, including Status, was transcribed from the bips repository. Always consult the original when implementing or verifying.