Transaction Review

Bitcoin transaction inputs come from the outputs of a previous transaction. During a transaction, these funds are transferred from one address to another address. When it comes time to spend a transaction, our wallet scans the blockchain for any spendable UTXO that are tied to our wallet address.

Note:In a previous lessonhere, we used our wallet to create a transaction from the GUI.

If your wallet doesn’t already have available transactions with outputs to spend, checkout the link above to setup a transaction so you have outputs to work with.

For this exercise, to create a raw transaction, we will use the outputs from that transaction as our starting point inputs.

Environment Setup:

  • Bitcoin Core version v0.16.0 (64-bit) Testnet
  • Wallet Address (Yours will be different): 1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL

Step 1. View UTXO

In the debug console, use thelistunspentcommand to show all the unspent confirmed outputs in our wallet. These can be used as inputs in another transaction.

Execute Command

In the debug console type the listunspent command

listunspent

Result

[
 {
 "txid" : "e787a27bda32c8b54ee501be46d2cfcd47c1566c8ef6ee339bdb7cd5c82b701c",
 "vout" : 0,
 "address" : "2Mzxx8wGAmQQyCCrb2vXP4yxaYY9s9nepfy",
 "account" : "public faucet test",
"redeemScript": "0014c794ee65db89222f408dfe1728d214f2496d7a72"
 "scriptPubKey" : "a91454ad1e8953876c90d3fc15798c687835ab3d3aee87",
 "amount" : 0.05000000,
 "confirmations" : 12
 "spendable": true,
 "solvable": true,
 "safe": true
 }
...
]

txid - This shows us that there is a Transaction with this id.

  • vout - The Transaction has one output (vout at index 0).
  • address - The Transaction is assigned to this address.
  • account - This is a deprecated. It’s set to “ “ as a default.
  • scriptPubKey - The hash of the Locking Script
  • amount - Transaction amount in BTC
  • confirmations - At the time of viewing this Tx, it has been confirmed 7 times (6 blocks added after it was added to the blockchain).

Using this information, we will can create a transaction that will spend the 0th vout (UTXO) of the txid as its input and assign it to a new output that sends value to a new address.

results matching ""

    No results matching ""