mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-15 20:49:21 +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:
parent
58643749fb
commit
1601de2634
@ -374,49 +374,48 @@ using a block explorer; see the privacy warning in
|
|||||||
====
|
====
|
||||||
[source,bash]
|
[source,bash]
|
||||||
----
|
----
|
||||||
$ curl https://blockchain.info/unspent?active=1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK
|
$ address=bc1pyfw56zu5vsq0ulu9kytasgw4xwnm3eysll6tfdz8d9gtht97k7tqxsz78n
|
||||||
|
$ curl https://blockchain.info/unspent?active=$address
|
||||||
----
|
----
|
||||||
====
|
====
|
||||||
|
|
||||||
[source,json]
|
[source,json]
|
||||||
----
|
----
|
||||||
{
|
{
|
||||||
|
"notice": "",
|
||||||
"unspent_outputs": [
|
"unspent_outputs": [
|
||||||
|
|
||||||
{
|
{
|
||||||
"tx_hash":"186f9f998a5...2836dd734d2804fe65fa35779",
|
"tx_hash_big_endian": "4ac541802679866935a19d4f40728bb89204d0cac90d85f3a51a19278fe33aeb",
|
||||||
"tx_index":104810202,
|
"tx_hash": "eb3ae38f27191aa5f3850dc9cad00492b88b72404f9da135698679268041c54a",
|
||||||
"tx_output_n": 0,
|
"tx_output_n": 1,
|
||||||
"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
|
"script": "5120225d4d0b946400fe7f85b117d821d533a7b8e490fff4b4b4476950bbacbeb796",
|
||||||
"value": 10000000,
|
"value": 100000,
|
||||||
"value_hex": "00989680",
|
"value_hex": "0186a0",
|
||||||
"confirmations":0
|
"confirmations": 111,
|
||||||
|
"tx_index": 8276421070086947
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
||||||
The response in <<example_2-2>> shows one unspent output (one that has
|
The response in <<example_2-2>> shows one unspent output (one that has
|
||||||
not been redeemed yet) under the ownership of Alice's address
|
not been redeemed yet) under the ownership of Alice's address.
|
||||||
+1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK+. The response includes the
|
The response includes the reference to the transaction in which this
|
||||||
reference to the transaction in which this unspent output is contained
|
UTXO is contained (the payment from Joe), the output index
|
||||||
(the payment from Joe) and its value in satoshis, at 10 million,
|
number, its value in satoshis, and the script derived from Alice's
|
||||||
equivalent to 0.10 bitcoin. With this information, Alice's wallet
|
address. With this information, Alice's wallet
|
||||||
application can construct a transaction to transfer that value to new
|
application can construct a transaction to transfer that value to new
|
||||||
owner addresses.
|
owner addresses.
|
||||||
|
|
||||||
[TIP]
|
[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
|
In this case, this single
|
||||||
unspent output to pay for the podcast. Had this not been the case,
|
UTXO is sufficient to pay for the podcast. Had this not been the case,
|
||||||
Alice's wallet application might have to "rummage" through a pile of
|
Alice's wallet application might have to combine several
|
||||||
smaller unspent outputs, like picking coins from a purse until it could
|
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
|
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
|
to get some change back, which we will see in the next section, as the
|
||||||
wallet application creates the transaction outputs (payments).
|
wallet application creates the transaction outputs (payments).
|
||||||
@ -465,7 +464,7 @@ image::images/mbc2_0208.png["Alice Coffee Transaction"]
|
|||||||
[[transaction-alice-url]]
|
[[transaction-alice-url]]
|
||||||
[TIP]
|
[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
|
==== Adding the Transaction to the Ledger
|
||||||
@ -664,7 +663,7 @@ transaction.
|
|||||||
[TIP]
|
[TIP]
|
||||||
====
|
====
|
||||||
You can see the block that includes
|
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
|
((("confirmations", "role in transactions")))Approximately 19 minutes
|
||||||
|
Loading…
Reference in New Issue
Block a user