1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2025-01-22 21:51:10 +00:00

Edited ch06.asciidoc with Atlas code editor

This commit is contained in:
nadams 2017-05-10 13:35:09 -07:00
parent e827fe17e3
commit e286fd43e2

View File

@ -12,7 +12,7 @@ In this chapter we will examine all the various forms of transactions, what they
[[tx_structure]]
=== Transactions in Detail
((("use cases", "buying coffee")))In <<ch02_bitcoin_overview>>, we looked at the transaction Alice used to pay for coffee at Bob's coffee shop, using a block explorer (<<alices_transactions_to_bobs_cafe>>).
((("use cases", "buying coffee")))In <<ch02_bitcoin_overview>>, we looked at the transaction Alice used to pay for coffee at Bob's coffee shop using a block explorer (<<alices_transactions_to_bobs_cafe>>).
[[alices_transactions_to_bobs_cafe]]
.Alice's transaction to Bob's Cafe
@ -196,7 +196,7 @@ As you can see, there is only one input in the list (because one UTXO contained
* A +scriptSig+, which satisfies the conditions placed on the UTXO, unlocking it for spending
* A sequence number (to be discussed later)
In Alice's transaction, the input points to transaction ID +7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18+ and output index +0+ (i.e., the first UTXO created by that transaction). The unlocking script is constructed by Alice's wallet by first retrieving the referenced UTXO, examining its locking script, and then using it to build the necessary unlocking script to satisfy it.
In Alice's transaction, the input points to the transaction ID +7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18+ and output index +0+ (i.e., the first UTXO created by that transaction). The unlocking script is constructed by Alice's wallet by first retrieving the referenced UTXO, examining its locking script, and then using it to build the necessary unlocking script to satisfy it.
Looking just at the input you may have noticed that we don't know anything about this UTXO, other than a reference to the transaction containing it. We don't know its value (amount in satoshi), and we don't know the locking script that sets the conditions for spending it. To find this information, we must retrieve the referenced UTXO by retrieving the underlying transaction. Notice that because the value of the input is not explicitly stated, we must also use the referenced UTXO in order to calculate the fees that will be paid in this transaction (see <<tx_fees>>).