Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Previous output's pubkey script is not included in the data that the Bob signs. #1272
Comments
wbnns
self-assigned this
Dec 9, 2016
wbnns
added
the
Under Review
label
Jan 31, 2017
Kexkey
commented
Feb 8, 2017
•
|
The guide is correct. The previous output's pubkey script is actually included in the data Bob signs. The fact that it's not a mandatory parameter to signrawtransaction is where it's confusing; when the previous transaction is in the UTXO set, bitcoind is able to get it from there (or the mempool). But when the previous transaction has not been broadcasted yet, bitcoind has no way to get it -- you have to supply it. In this particular case, it is important to sign the good pubkey script and because it is not broadcasted (maybe you got the other data from the previous payer which could be dishonest and used a pubkey script that pays to himself), the only way to be sure you are spending the input you think you are spending is by providing the pubkey script, which forces you to verify it (and make sure the not-yet-broadcasted transaction pays the output to you). See https://bitcoin.org/en/developer-examples#offline-signing where it says: "In the other raw transaction subsections above, the previous output was part of the UTXO set known to the wallet, so the wallet was able to use the txid and output index number to find the previous pubkey script and insert it automatically. In this case, you’re spending an output which is unknown to the wallet, so it can’t automatically insert the previous pubkey script." ... "Successfully sign the transaction by providing the previous pubkey script and other required input data." |
Kangmo commentedApr 2, 2016
Source File: _includes/devdoc/guide_transactions.md
=> The previous output's pubkey script is not included in the data Bob signs. But the current transaction points to the previous output with the outpoint(tx hash & vout).
=> Need to remove 'the previous output's pubkey script' from the 'data Blob signs'.