1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-12-23 15:18:11 +00:00

CH02::getting inputs: update example for new input for Alice

This uses the same address used in the updated CH01 screenshots.

We also mention that the output index number and script are needed for
spending.
This commit is contained in:
David A. Harding 2023-02-04 14:53:10 -10:00
parent 58643749fb
commit 1601de2634

View File

@ -374,49 +374,48 @@ using a block explorer; see the privacy warning in
====
[source,bash]
----
$ curl https://blockchain.info/unspent?active=1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK
$ address=bc1pyfw56zu5vsq0ulu9kytasgw4xwnm3eysll6tfdz8d9gtht97k7tqxsz78n
$ curl https://blockchain.info/unspent?active=$address
----
====
[source,json]
----
{
"unspent_outputs":[
{
"tx_hash":"186f9f998a5...2836dd734d2804fe65fa35779",
"tx_index":104810202,
"tx_output_n": 0,
"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
"value": 10000000,
"value_hex": "00989680",
"confirmations":0
}
]
"notice": "",
"unspent_outputs": [
{
"tx_hash_big_endian": "4ac541802679866935a19d4f40728bb89204d0cac90d85f3a51a19278fe33aeb",
"tx_hash": "eb3ae38f27191aa5f3850dc9cad00492b88b72404f9da135698679268041c54a",
"tx_output_n": 1,
"script": "5120225d4d0b946400fe7f85b117d821d533a7b8e490fff4b4b4476950bbacbeb796",
"value": 100000,
"value_hex": "0186a0",
"confirmations": 111,
"tx_index": 8276421070086947
}
]
}
----
The response in <<example_2-2>> shows one unspent output (one that has
not been redeemed yet) under the ownership of Alice's address
+1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK+. The response includes the
reference to the transaction in which this unspent output is contained
(the payment from Joe) and its value in satoshis, at 10 million,
equivalent to 0.10 bitcoin. With this information, Alice's wallet
not been redeemed yet) under the ownership of Alice's address.
The response includes the reference to the transaction in which this
UTXO is contained (the payment from Joe), the output index
number, its value in satoshis, and the script derived from Alice's
address. With this information, Alice's wallet
application can construct a transaction to transfer that value to new
owner addresses.
[TIP]
====
View the http://bit.ly/1tAeeGr[transaction from Joe to Alice].
View the https://blockstream.info/tx/4ac541802679866935a19d4f40728bb89204d0cac90d85f3a51a19278fe33aeb[transaction from Joe to Alice].
====
As you can see, Alice's wallet contains enough bitcoin in a single
unspent output to pay for the podcast. Had this not been the case,
Alice's wallet application might have to "rummage" through a pile of
smaller unspent outputs, like picking coins from a purse until it could
In this case, this single
UTXO is sufficient to pay for the podcast. Had this not been the case,
Alice's wallet application might have to combine several
smaller UTXOs, like picking coins from a purse until it could
find enough to pay for the podcast. In both cases, there might be a need
to get some change back, which we will see in the next section, as the
wallet application creates the transaction outputs (payments).
@ -465,7 +464,7 @@ image::images/mbc2_0208.png["Alice Coffee Transaction"]
[[transaction-alice-url]]
[TIP]
====
View the https://www.blockchain.com/btc/tx/0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2[transaction from Alice to Bob's Store].
View the https://blockstream.info/tx/466200308696215bbc949d5141a49a4138ecdfdfaa2a8029c1f9bcecd1f96177[transaction from Alice to Bob's Store].
====
==== Adding the Transaction to the Ledger
@ -664,7 +663,7 @@ transaction.
[TIP]
====
You can see the block that includes
https://blockchain.info/block-height/277316[Alice's transaction].
https://blockstream.info/block/000000000000000000027d39da52dd790d98f85895b02e764611cb7acf552e90[Alice's transaction].
====
((("confirmations", "role in transactions")))Approximately 19 minutes