4

The BIP143 docs state that the value is: "value of the output spent by this input (8-byte little endian)"

If I have a single UTXO of value 10,000 sats and I'm using this as an input for a Segwit tx, then when I'm ready to sign the transaction / create the witness section, I use 10,000 as the value? Or is the value the sum of the outputs that I'm sending?

Another example would be this in the BIP example.

Where does the 0046c32300000000 amount (600,000,000 in Decimal) come from?

This would suggest the "value" is the full available amount of that particular input? Or is it the amount of all the inputs combined?

1 Answer 1

2

If I have a single UTXO of value 10,000 sats and I'm using this as an input for a Segwit tx, then when I'm ready to sign the transaction / create the witness section, I use 10,000 as the value? Or is the value the sum of the outputs that I'm sending?

You use 10000 as the amount and don't care about what other inputs are or how much their value is.

Where does the 0046c32300000000 amount (600,000,000 in Decimal) come from?

The "amount" that is being used during signing (and pretty much everywhere else) is always in satoshi as a 64-bit integer. Since the second input being signed had a value of 6 BTC that is equal to 600000000 satoshi. Which is the full value of the input (UTXO) that is being spent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.