Skip to content
BIP ATLAS

BIP 0141 + 0143

Why does a Bitcoin transaction have two identifiers?

SegWit separates what a transaction does from the proof that it is allowed, and gives the transaction a second name that also covers the proof. Signing and block space changed along the way.

Every transaction is known by a hash of its bytes. Before SegWit, those bytes included the signatures, so a change in how a transaction was signed could change its identifier without changing anything it did.12

BIP 141, a consensus soft fork assigned in 2015 and recorded as deployed, separates the data that decides what a transaction does from the data that proves it is allowed. Each transaction now has two identifiers. BIP 143, its companion, changes what a SegWit signature commits to. This chapter takes a transaction published in BIP 143 apart to see both.345

Source revision
bitcoin/bips @ 3a10b5b
Source checked
1 October 2026
Review state
Draft — independent technical review applied; awaiting human sign-off
Source details

This chapter is an independent explanation, not the proposals themselves. Preamble fields are shown as recorded in the pinned files, with author e-mail addresses omitted. Status is the proposal’s own field, not an endorsement or a sign of consensus.

BIP 141: Segregated Witness (Consensus layer)

BIP
141
Layer
Consensus (soft fork)
Title
Segregated Witness (Consensus layer)
Authors
Eric Lombrozo
Johnson Lau
Pieter Wuille
Status
Deployed
Type
Specification
Assigned
2015-12-21
License
PD

Pinned source · Reader view on bips.dev
SHA-256 d72409335872a32494f75e7547589abf4b3b23b6beebe6bc6999c7a84b135e2c
Git blob 442d9dd8bfc9816414ebc129dacd7e462f5d8c8a

BIP 143: Transaction Signature Verification for Version 0 Witness Program

BIP
143
Layer
Consensus (soft fork)
Title
Transaction Signature Verification for Version 0 Witness Program
Authors
Johnson Lau
Pieter Wuille
Status
Deployed
Type
Specification
Assigned
2016-01-03
License
PD

Pinned source · Reader view on bips.dev
SHA-256 62bc71351563e68baeb12643c68355d217953ae9eb6a6e68b2b0323275b6beec
Git blob 5d451c221fa9ef052325c42086b8a7097b942556

FIG. A03.1 One transaction, two serializations

txiddouble SHA-256 of 233 bytes

09462d604a3102fae083…2a1a15e8

wtxiddouble SHA-256 of 343 bytes

62b709c9126ae7782ea8…37386cc3
The txid covers only the bytes a pre-SegWit node would see. The wtxid covers everything, including the marker, flag and witness. Hashes are shown in the byte order they are computed.567

What a transaction does, and what proves it

BIP 141 starts from a distinction. A transaction’s effects are fully determined by which outputs it spends and which new outputs it creates. Signatures, and the other data used to check that a spend is allowed, are needed to validate the chain, not to determine its resulting state.1

SegWit moves that validation data, in particular scripts and signatures, into a new structure called the witness. Blocks commit to it separately from the transaction tree, through a commitment placed in the coinbase transaction.48

Two serializations, two hashes

The txid is defined exactly as before: the double SHA-256 of nVersion, the inputs, the outputs and nLockTime. The wtxid is the double SHA-256 of a longer serialization: the same fields plus a marker byte 0x00 and a flag byte 0x01 after the version, and the witness data just before nLockTime.510

Each input gets one witness field: a count of stack items, then each item preceded by its length. An input that does not spend a witness program still gets a field, an empty one written as the single byte 0x00. When no input has witness data, the wtxid equals the txid.1112

Why have a second identifier at all? Because blocks that contain witness data must commit to it too. BIP 141 adds a rule requiring a commitment to the wtxids of a block’s transactions, built like the existing merkle root and recorded in an output of the coinbase transaction. The coinbase’s own wtxid is simply taken to be all zeros.13

The figure below shows the native P2WPKH example from BIP 143, a transaction with one ordinary input and one SegWit input. Switch lenses to see which bytes each identifier covers.714

FIG. A03.2 Which bytes each hash covers Interactive

Static view of the first example through the txid lens: bytes the txid does not cover are marked. With JavaScript you can switch to the wtxid and BIP 143 signing lenses and to the second example.

  1. nVersion010000004 Bhashed
  2. marker segwit marker001 Bnot in txid
  3. flag segwit marker011 Bnot in txid
  4. input count021 Bhashed
  5. input 0 · outpointfff7f788 1a8099af a6940d42 d1e7f636 2bec3817 1ea3edf4 33541db4 e4ad969f 0000000036 Bhashed
  6. input 0 · scriptSig49483045 0221008b 9d1dc26b a6a9cb62 127b0274 2fa9d754 cd3bebf3 37f7a55d 114c8e5c dd30be02 2040529b 194ba3f9 281a99f2 b1c0a19c 0489bc22 ede944cc f4ecbab4 cc618ef3 ed0174 Bhashed
  7. input 0 · nSequenceeeffffff4 Bhashed
  8. input 1 · outpointef51e1b8 04cc89d1 82d27965 5c3aa89e 815b1b30 9fe287d9 b2b55d57 b90ec68a 0100000036 Bhashed
  9. input 1 · scriptSig001 Bhashed
  10. input 1 · nSequenceffffffff4 Bhashed
  11. output count021 Bhashed
  12. output 0 · amount202cb206 000000008 Bhashed
  13. output 0 · scriptPubKey1976a914 8280b37d f378db99 f66f85c9 5a783a76 ac7a6d59 88ac26 Bhashed
  14. output 1 · amount9093510d 000000008 Bhashed
  15. output 1 · scriptPubKey1976a914 3bde42db ee7e4dbe 6a21b2d5 0ce2f016 7faa8159 88ac26 Bhashed
  16. witness 0 · 0 items witness001 Bnot in txid
  17. witness 1 · 2 items witness02473044 02203609 e17b84f6 a7d30c80 bfa610b5 b4542f32 a8a0d544 7a12fb13 66d7f01c c44a0220 573a954c 45183315 61406f90 300e8f33 58f51928 d43c212a 8caed02d e67eebee 01210254 76c2e831 88368da1 ff3e292e 7acafcdb 3566bb0a d253f62f c70f07ae ee6357107 Bnot in txid
  18. nLockTime110000004 Bhashed

txid = double SHA-256 of the 233 marked bytes

09462d604a3102fae083ada369c795855a28db4bdd3d05358a361cf32a1a15e8

wtxid: 62b709c9126ae778…37386cc3

Base size
233 bytes
Total size
343 bytes
Weight
3 × 233 + 343 = 1042
Virtual size
⌈1042 ÷ 4⌉ = 261 vbytes

Hashes are shown in the byte order they are computed. Inputs: P2PK (legacy); P2WPKH (witness v0).

Transaction: BIP 143, line 190 (Example: Native P2WPKH). Serialization view only; this page does not check signatures or scripts.

Through the txid lens, the marker, flag and witness fields drop out, and with them the SegWit input’s signature. The ordinary input’s signature sits in its scriptSig, so the txid still covers it.5121415

Why a stable name matters

Because the signature data of SegWit inputs is no longer part of the txid, changing how such an input was signed no longer changes the transaction’s identifier. BIP 141 presents this as the end of nonintentional malleability, under conditions: every input must be a witness input signed with at least one CHECKSIG or CHECKMULTISIG, and a multisig spend can still be changed if enough of its key holders agree.2

Stable identifiers matter when one transaction spends another before either is confirmed. BIP 141 names the benefit directly: chains of unconfirmed transactions without counterparty risk, which it calls important for off-chain protocols such as the Lightning Network.16

The mixed example also shows where the protection stops. Its first input is an ordinary pay-to-public-key spend, so that input’s signature is still in the scriptSig and still part of the txid.514

Not every witness item is a signature

For a P2WPKH input, the witness must be exactly two items: a signature, and a public key whose HASH160 matches the 20-byte program. A P2WSH input’s witness is different again: the stack items its script needs, followed by the script itself. BIP 141 says witness data is not script: the items are data, even when one of them is a serialized witness script. Nor are they all signatures.111517

The second example in the figure wraps a witness program inside an older P2SH script. Its scriptSig carries the redeem script that contains the program, so that single input has both a scriptSig and a witness.1418

Weight instead of bytes

Separating the witness had a second purpose. BIP 141’s motivation notes that moving data into a structure older nodes do not know about lets a soft fork discount it when calculating block size.19

When BIP 141 was written, blocks were limited to 1,000,000 bytes. It replaced that rule with block weight: three times the base size plus the total size, at most 4,000,000. Base size counts the bytes a pre-SegWit node would see; total size counts everything, witness included.620

Written another way, every base byte costs four weight units, and every witness-related byte, including the marker and flag, costs one. BIP 141 explains why it chose a single combined limit rather than two separate ones: separate limits would make mining and fee estimation nearly impossible.2122

Weight is therefore not a byte count. Since base bytes count four times, no more than 1,000,000 of them fit in a block, as before. A block can exceed that many bytes in total only through its witness data.623

FIG. A03.3 Weight of the two examples

Legacy + SegWit inputs · P2PK and P2WPKH

3 × 233 + 343 = 1042 weight units · ⌈1042 ÷ 4⌉ = 261 vbytes

SegWit inside P2SH · P2SH-P2WPKH

3 × 142 + 251 = 677 weight units · ⌈677 ÷ 4⌉ = 170 vbytes

Each base byte counts four times; each witness-related byte, marker and flag included, counts once. The totals are computed from the parsed transactions, not estimated.7212425

BIP 141 defines transaction weight the same way, and virtual size as weight divided by four, rounded up. For the mixed example that is 233 base bytes and 343 bytes in total: 3 × 233 + 343 = 1,042 weight units, or 261 virtual bytes. These per-transaction terms are suggested vocabulary; the consensus limit applies to blocks.62426

Going deeper: what a SegWit signature signs

BIP 143 changes what a signature in a version 0 witness program commits to. Under the original algorithm, each signature hashed data in proportion to the size of the whole transaction, so total hashing grew with the square of the number of signature checks. BIP 143 instead builds a preimage with a fixed structure of ten items, three of which are summary hashes that can be reused across inputs.27282930

For SIGHASH_ALL, the three summary hashes cover every input’s outpoint, every input’s nSequence and every output. They are computed once and reused for each input that is signed, which is where the saving comes from.3031

The sixth item matters most to small signing devices: the amount of the output being spent. That amount is not in the transaction at all. Without it, an offline signer cannot work out how much is being spent or what fee is being paid. BIP 143 makes each signature commit to its own input’s amount, so if a device is told a wrong amount for that input, the signature is invalid and, in the BIP’s words, no funding might be lost. That protects only the input being signed: knowing the fee needs a trustworthy amount for every input.3233

Use the BIP 143 lens in the figure to see where each item comes from. For a P2WPKH input the scriptCode is a standard pay-to-public-key-hash script built from the 20-byte program. The page reproduces the published preimage and digest of both examples byte for byte.72534

All of this applies only to version 0 witness programs. Each signature covers its own input’s amount. In the mixed example, the first input is an ordinary spend signed with the original algorithm, which does not involve the amount at all.14323536

Two names, two kinds of content

Every transaction has two identifiers, equal when it carries no witness data. The txid names what the transaction does, what it spends and what it creates, plus any proof still kept in scriptSigs. The wtxid adds the witness: the rest of the evidence that the spending was allowed.15

Evidence

Each numbered marker in the text points here. Quotes are verbatim from the BIP files at commit 3a10b5b, including their wiki markup; links open the exact lines; the quoted text sits under each entry. Labels say what kind of statement each is: a rule, the author’s rationale, history, a test vector, or our own inference.

  1. Author’s rationale A transaction's effects are determined by the outputs it spends and creates; signatures are only needed to validate the chain state, not to determine it.

    Quoted source text (1)

    The entirety of the transaction's effects are determined by output consumption (spends) and new output creation. Other transaction data, and signatures in particular, are only required to validate the blockchain state, not to determine it.

    BIP 141, line 22
  2. Author’s rationale Signature data in the witness no longer affects the txid; BIP141 states this prevents involuntary malleability when all inputs are signed with at least one CHECKSIG or CHECKMULTISIG, while an m-of-n multisig spend remains malleable with agreement of m key holders.

    Quoted source text (3)

    Since signature data is no longer part of the transaction hash, changes to how the transaction was signed are no longer relevant to transaction identification.

    BIP 141, line 26

    as long as all inputs are signed (with at least one CHECKSIG or CHECKMULTISIG operation)

    BIP 141, line 27

    In the case of an m-of-n CHECKMULTISIG script, a transaction is malleable only with agreement of m private key holders

    BIP 141, line 28
  3. History BIP141 (assigned 2015) and BIP143 (assigned 2016) are consensus soft-fork proposals whose preambles record the status Deployed.

    Quoted source text (5)

    Assigned: 2015-12-21

    BIP 141, line 10

    Layer: Consensus (soft fork)

    BIP 141, line 3

    Status: Deployed

    BIP 141, line 8

    Assigned: 2016-01-03

    BIP 143, line 9

    Status: Deployed

    BIP 143, line 7
  4. Rule BIP141 defines a witness structure, committed to blocks separately from the transaction merkle tree, holding data needed to check validity but not to determine effects; scripts and signatures move into it.

    Quoted source text (1)

    This BIP defines a new structure called a "witness" that is committed to blocks separately from the transaction merkle tree. This structure contains data required to check transaction validity but not required to determine transaction effects. In particular, scripts and signatures are moved into this new structure.

    BIP 141, line 16
  5. Rule Each transaction has two IDs: the txid is the double SHA256 of [nVersion][txins][txouts][nLockTime]; the wtxid is the double SHA256 of [nVersion][marker][flag][txins][txouts][witness][nLockTime].

    Quoted source text (5)

    Each transaction will have 2 IDs.

    BIP 141, line 41

    Definition of <code>txid</code> remains unchanged: the double SHA256 of the traditional serialization format:

    BIP 141, line 43

    [nVersion][txins][txouts][nLockTime]

    BIP 141, line 45

    A new <code>wtxid</code> is defined: the double SHA256 of the new serialization with witness data:

    BIP 141, line 47

    [nVersion][marker][flag][txins][txouts][witness][nLockTime]

    BIP 141, line 49
  6. Rule Block weight is base size × 3 + total size, and must be at most 4,000,000; base size excludes witness-related data as a non-upgraded node sees it.

    Quoted source text (3)

    ''Block weight'' is defined as ''Base size'' * 3 + ''Total size''.

    BIP 141, line 117

    ''Base size'' is the block size in bytes with the original transaction serialization without any witness-related data, as seen by a non-upgraded node.

    BIP 141, line 119

    The new rule is ''block weight'' ≤ 4,000,000.

    BIP 141, line 123
  7. Test vector BIP143 publishes complete example transactions with their preimages and sighashes, and asks developers to test against them.

    Quoted source text (3)

    developers should test their implementations against all the tests below.

    BIP 143, line 137

    The serialized signed transaction is:

    BIP 143, line 190

    The serialized signed transaction is:

    BIP 143, line 250
  8. Rule The witness is committed in a tree nested into the block's merkle root via the coinbase; the commitment is required when a block has witness data and optional otherwise.

    Quoted source text (3)

    The witness is committed in a tree that is nested into the block's existing merkle root via the coinbase transaction

    BIP 141, line 18

    A new block rule is added which requires a commitment to the <code>wtxid</code>.

    BIP 141, line 63

    If all transactions in a block do not have witness data, the commitment is optional.

    BIP 141, line 80
  9. Author’s rationale Transmitting witness data is needed only for a peer that validates a transaction, not one that only checks its existence.

    Quoted source text (1)

    It is needed only if a peer is trying to validate a transaction instead of just checking its existence.

    BIP 141, line 31
  10. Rule The marker must be 0x00 and the flag a non-zero byte, currently 0x01.

    Quoted source text (2)

    The <code>marker</code> MUST be a 1-byte zero value: <code>0x00</code>.

    BIP 141, line 53

    The <code>flag</code> MUST be a 1-byte non-zero value. Currently, <code>0x01</code> MUST be used.

    BIP 141, line 55
  11. Rule Each input has a witness field: a var_int count of stack items, then each item with a var_int length. Witness data is not script.

    Quoted source text (1)

    Each txin is associated with a witness field. A witness field starts with a <code>var_int</code> to indicate the number of stack items for the txin. It is followed by stack items, with each item starts with a <code>var_int</code> to indicate the length. Witness data is NOT script.

    BIP 141, line 57
  12. Rule A non-witness-program input must have an empty witness field, written 0x00; if no input is a witness program, wtxid equals txid.

    Quoted source text (1)

    A non-witness program (defined hereinafter) txin MUST be associated with an empty witness field, represented by a <code>0x00</code>. If all txins are not witness program, a transaction's <code>wtxid</code> is equal to its <code>txid</code>.

    BIP 141, line 59
  13. Rule Blocks containing witness data must commit to the wtxids; the witness root is built like the merkle root, recorded in a coinbase output, and the coinbase's own wtxid is taken as all zeros.

    Quoted source text (4)

    A new block rule is added which requires a commitment to the <code>wtxid</code>. The <code>wtxid</code> of coinbase transaction is assumed to be <code>0x0000....0000</code>.

    BIP 141, line 63

    A <code>witness root hash</code> is calculated with all those <code>wtxid</code> as leaves, in a way similar to the <code>hashMerkleRoot</code> in the block header.

    BIP 141, line 65

    The commitment is recorded in a <code>scriptPubKey</code> of the coinbase transaction.

    BIP 141, line 67

    If all transactions in a block do not have witness data, the commitment is optional.

    BIP 141, line 80
  14. Test vector The native P2WPKH example spends one ordinary P2PK output and one P2WPKH output; the P2SH-P2WPKH example spends one P2SH-wrapped witness program.

    Quoted source text (3)

    The first input comes from an ordinary P2PK:

    BIP 143, line 151

    The second input comes from a P2WPKH witness program:

    BIP 143, line 155

    The input comes from a P2SH-P2WPKH witness program:

    BIP 143, line 214
  15. Rule A version 0, 20-byte program is P2WPKH: the witness is exactly two items, a signature and a public key whose HASH160 matches the program.

    Quoted source text (3)

    It is interpreted as a pay-to-witness-public-key-hash (P2WPKH) program.

    BIP 141, line 95

    The witness must consist of exactly 2 items (≤ 520 bytes each). The first one a signature, and the second one a public key.

    BIP 141, line 96

    The HASH160 of the public key must match the 20-byte witness program.

    BIP 141, line 97
  16. Author’s rationale BIP141 says this allows unconfirmed transaction dependency chains without counterparty risk, important for off-chain protocols such as the Lightning Network.

    Quoted source text (1)

    It allows creation of unconfirmed transaction dependency chains without counterparty risk, an important feature for offchain protocols such as the Lightning Network

    BIP 141, line 30
  17. Rule A version 0, 32-byte program is P2WSH: the witness is an input stack for the script followed by the serialized script itself.

    Quoted source text (2)

    It is interpreted as a pay-to-witness-script-hash (P2WSH) program.

    BIP 141, line 101

    The witness must consist of an input stack to feed to the script, followed by a serialized script (<code>witnessScript</code>).

    BIP 141, line 102
  18. Rule Witness validation is also triggered when a P2SH redeemScript pushed in the scriptSig is exactly a version byte plus a witness program.

    Quoted source text (1)

    Triggered when a <code>scriptPubKey</code> is a P2SH script, and the BIP16 <code>redeemScript</code> pushed in the <code>scriptSig</code> is exactly a push of a version byte plus a push of a witness program.

    BIP 141, line 92
  19. Author’s rationale BIP141's motivation lists that moving data into a structure unknown to old nodes lets a soft fork discount witness size when calculating block size.

    Quoted source text (1)

    '''Some constraints could be bypassed with a soft fork''' by moving part of the transaction data to a structure unknown to current protocol, for example: #* Size of witness could be ignored / discounted when calculating the block size, effectively increasing the block size to some extent

    BIP 141, lines 32–33
  20. History When BIP141 was written, blocks were limited to 1,000,000 bytes total size.

    Quoted source text (1)

    Blocks are currently limited to 1,000,000 bytes (1MB) total size.

    BIP 141, line 115
  21. Editorial inference Since weight = 3 × base + total = 4 × base + (total − base), each base byte adds 4 weight units and each witness-related byte (marker, flag, witness) adds 1.

    Quoted source text (2)

    ''Block weight'' is defined as ''Base size'' * 3 + ''Total size''.

    BIP 141, line 117

    including base data and witness data.

    BIP 141, line 121
  22. Author’s rationale BIP141 chose one composite limit because two separate limits would make mining and fee estimation nearly impossible.

    Quoted source text (1)

    Using two separate limits would make mining and fee estimation nearly impossible.

    BIP 141, line 117
  23. Editorial inference Because weight = 4 × base + witness ≤ 4,000,000, a block's base data cannot exceed 1,000,000 bytes; only witness data lets its total size exceed that.

    Quoted source text (2)

    ''Block weight'' is defined as ''Base size'' * 3 + ''Total size''.

    BIP 141, line 117

    The new rule is ''block weight'' ≤ 4,000,000.

    BIP 141, line 123
  24. Rule Transaction weight is defined the same way, and virtual size is weight / 4 rounded up; these are suggested terms, not consensus limits.

    Quoted source text (3)

    The following definitions are not used for consensus limits, but are suggested to provide language consistent with the terminology introduced above.

    BIP 141, line 136

    ''Transaction weight'' is defined as ''Base transaction size'' * 3 + ''Total transaction size''

    BIP 141, line 140

    ''Virtual transaction size'' is defined as ''Transaction weight'' / 4 (rounded up to the next integer).

    BIP 141, line 142
  25. Test vector The tested model reproduces both published examples' serializations, preimages and sighashes byte for byte, and computes their sizes and weights.

    Quoted source text (2)

    hash preimage:

    BIP 143, line 174

    sigHash:

    BIP 143, line 187
  26. Test vector Parsed, the native P2WPKH example has 233 base bytes and 343 bytes in total: weight 1,042, virtual size 261.

    Quoted source text (2)

    The serialized signed transaction is:

    BIP 143, line 190

    ''Transaction weight'' is defined as ''Base transaction size'' * 3 + ''Total transaction size''

    BIP 141, line 140
  27. Rule BIP143 defines a new digest for signatures in version 0 witness programs, to minimize redundant hashing and to cover the input value.

    Quoted source text (1)

    This proposal defines a new transaction digest algorithm for signature verification in version 0 witness program, in order to minimize redundant data hashing in verification, and to cover the input value by the signature.

    BIP 143, line 14
  28. Author’s rationale With the original digest, hashing per signature grows with transaction size, so total hashing grows as O(n^2) in the number of sigops.

    Quoted source text (1)

    For the verification of each signature, the amount of data hashing is proportional to the size of the transaction. Therefore, data hashing grows in O(n<sup>2</sup>) as the number of sigops in a transaction increases.

    BIP 143, line 21
  29. Rule The BIP143 preimage has ten items: nVersion, hashPrevouts, hashSequence, outpoint, scriptCode, amount, nSequence, hashOutputs, nLocktime and sighash type.

    Quoted source text (3)

    1. nVersion of the transaction (4-byte little endian)

    BIP 143, line 29

    6. value of the output spent by this input (8-byte little endian)

    BIP 143, line 34

    10. sighash type of the signature (4-byte little endian)

    BIP 143, line 38
  30. Rule hashPrevouts, hashSequence and hashOutputs can be reused across inputs, reducing total hashing from O(n^2) to O(n).

    Quoted source text (1)

    may be reused in other inputs of the same transaction, so that the time complexity of the whole hashing process reduces from O(n<sup>2</sup>) to O(n).

    BIP 143, line 70
  31. Rule Without ANYONECANPAY, hashPrevouts is the double SHA256 of all input outpoints; for SIGHASH_ALL, hashSequence covers all nSequence values and hashOutputs all outputs.

    Quoted source text (3)

    If the <code>ANYONECANPAY</code> flag is not set, <code>hashPrevouts</code> is the double SHA256 of the serialization of all input outpoints;

    BIP 143, line 58

    If none of the <code>ANYONECANPAY</code>, <code>SINGLE</code>, <code>NONE</code> sighash type is set, <code>hashSequence</code> is the double SHA256 of the serialization of <code>nSequence</code> of all inputs;

    BIP 143, line 62

    If the sighash type is neither <code>SINGLE</code> nor <code>NONE</code>, <code>hashOutputs</code> is the double SHA256 of the serialization of all output amount (8-byte little endian) with <code>scriptPubKey</code> (serialized as scripts inside CTxOuts);

    BIP 143, line 66
  32. Rule Every BIP143 sighash type commits to the amount spent by the signed input; item 6 is that 8-byte amount.

    Quoted source text (2)

    All sighash types commit to the amount being spent by the signed input;

    BIP 143, line 42

    The item 6 is a 8-byte value of the amount of bitcoin spent in this input.

    BIP 143, line 55
  33. Author’s rationale Without the amount, an offline signer cannot compute the amount spent or the fee; with the input's amount in its digest, a wrong value makes that signature invalid and no funding might be lost.

    Quoted source text (2)

    For an offline transaction signing device ("cold wallet"), however, the unknowing of input amount makes it impossible to calculate the exact amount being spent and the transaction fee.

    BIP 143, line 22

    In the case that a wrong value is provided and signed, the signature would be invalid and no funding might be lost.

    BIP 143, line 22
  34. Rule For P2WPKH the scriptCode is 0x1976a914{20-byte-pubkey-hash}88ac.

    Quoted source text (1)

    For <code>P2WPKH</code> witness program, the <code>scriptCode</code> is <code>0x1976a914{20-byte-pubkey-hash}88ac</code>.

    BIP 143, line 50
  35. Rule The BIP143 digest applies only to sigops in version 0 witness programs.

    Quoted source text (2)

    A new transaction digest algorithm is defined, but only applicable to sigops in version 0 witness program:

    BIP 143, line 27

    a new transaction digest algorithm for signature verification in version 0 witness program.

    BIP 141, line 152
  36. Author’s rationale The original signature digest does not involve the amount being spent by the input.

    Quoted source text (1)

    The algorithm does not involve the amount of Bitcoin being spent by the input.

    BIP 143, line 22