ch06: preceding input->input from Alice's transaction; change UTXO example caption

pull/807/head
rating89us 3 years ago committed by rating89us
parent 70177894ec
commit 2bacb91fa7

@ -210,10 +210,10 @@ It's not just Alice's wallet that needs to retrieve UTXO referenced in the input
Transactions on their own seem incomplete because they lack context. They reference UTXO in their inputs but without retrieving that UTXO we cannot know the value of the inputs or their locking conditions. When writing bitcoin software, anytime you decode a transaction with the intent of validating it or counting the fees or checking the unlocking script, your code will first have to retrieve the referenced UTXO from the blockchain in order to build the context implied but not present in the UTXO references of the inputs. For example, to calculate the amount paid in fees, you must know the sum of the values of inputs and outputs. But without retrieving the UTXO referenced in the inputs, you do not know their value. So a seemingly simple operation like counting fees in a single transaction in fact involves multiple steps and data from multiple transactions.
We can use the same sequence of commands with Bitcoin Core as we used when retrieving Alice's transaction (+getrawtransaction+ and +decoderawtransaction+). With that we can get the UTXO referenced in the preceding input and take a look:
We can use the same sequence of commands with Bitcoin Core as we used when retrieving Alice's transaction (+getrawtransaction+ and +decoderawtransaction+). With that we can get the UTXO referenced in the input from Alice's transaction and take a look:
[[alice_input_tx]]
.Alice's UTXO from the previous transaction, referenced in the input
.UTXO from the previous transaction, referenced in the input from Alice's transaction
[source,json]
----
"vout": [

Loading…
Cancel
Save