2

On Chapter 6 - Transactions of Mastering Bitcoin it is said:

Note that each transaction input is signed independently. This is critical, as neither the signatures nor the inputs have to belong to or be applied by the same "owners." In fact, a specific transaction scheme called "CoinJoin" uses this fact to create multi-party transactions for privacy.

and also

Each transaction input and any signature it may contain is completely independent of any other input or signature. Multiple parties can collaborate to construct transactions and sign only one input each.

I understand the fact that all signatures are independent from each other and therefore can be computed separately, but I always had the impression that the signatures are calculated from the transaction hash, and therefore this would make them dependent on the inputs, meaning one would need to know all the inputs included on the transaction in order to generate the correct signature.

If my understanding is correct, I believe a better wording of this statement should be something like:

the signatures needed to spend each UTXO referenced by each transaction input are computed independently

What did I got wrong here?

1 Answer 1

3

You are correct, and the text is misleading.

In general, every transaction input signature signs information from all over the transaction, including other inputs. This does not actually involve the transaction hash, but a separate hash which does leave a few things out. It is possible to only include data from your own input and not others (through SIGHASH_ANYONECANPAY specifically) , but the default and most common signing mode does involve signing other inputs.

What I assume the text is aiming to point out is that if multiple parties jointly produce a transaction, and each provides one input, then they can construct a signature for their own input without needing to see or know about the others' keys or signatures, but they still need to know about the other parties' inputs.

1
  • Thank you for this answer! Yeah, I got the idea of the text, I imagined it was just omitting the fact that each party still needs to know about the other parties' inputs. Just wanted to make sure I wasn't missing anything Nov 11, 2023 at 11:30

Your Answer

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

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