Data Recorded in a Bitcoin Transaction: The Foundation of Blockchain

·

In our previous discussion, we executed a Bitcoin transaction—a transfer of funds—and learned that this concept is fundamentally different from a traditional bank transfer. Now, let's delve into the specific data that is recorded within a Bitcoin transaction.

What Does It Mean to Hold Bitcoin?

Imagine you have money deposited in your bank account. When someone transfers funds to you, your balance increases. For instance, a salaried employee receives their paycheck directly into their bank account.

The same principle applies to cryptocurrency. To hold Bitcoin, someone must first send it to you. For someone who already owns Bitcoin, while a bit abstract, you can think of it as receiving Bitcoin as payment for work. Typically, you would pay fiat currency on a cryptocurrency exchange, and the exchange would then transfer the equivalent value in Bitcoin to you, allowing you to hold it.

Mr. A Sends 0.1 BTC to Mr. B

Let's assume Mr. A received a transfer from Mr. Z and now holds 0.3 BTC. In the blockchain, Mr. A is now a transaction recipient. As long as this holding hasn't been spent, he remains in possession of the Bitcoin.

Now, Mr. A wants to send 0.1 BTC to Mr. B. His available balance from the transaction is 0.3 BTC. To send only 0.1 BTC to Mr. B, he must create a new transaction that spends part of his existing balance, leaving the remainder for himself. How is this done?

A new transfer transaction (TX 45678) is created based on the original transaction from Mr. Z (TX 12345). This new transaction issues two instructions: send 0.1 BTC to Mr. B and send the remaining 0.2 BTC back to Mr. A.

You can think of it like paying with a larger bill and receiving change. In Bitcoin, you send the exact amount intended and then receive the "change" back to your own address. Once this new transaction, TX 45678, is recorded in a block and linked to the blockchain, the transfer is complete.

When TX 45678 is confirmed, the original base transaction, TX 12345, is marked as spent and can no longer be used for further transfers.

Data Recorded in a Transaction

What exactly is recorded in this newly created transfer transaction? The data within a Bitcoin transaction can be broadly categorized into inputs and outputs.

Inputs refer to the transaction(s) being used as the source of the funds. They specify which Unspent Transaction Outputs (UTXOs)—the previously received and unspent transactions—are being used in this new transaction. If a large amount of Bitcoin needs to be sent, multiple UTXOs might be combined into a single transaction, resulting in multiple inputs.

Outputs specify the destination(s) for the Bitcoin being sent. A single transaction can have multiple outputs, specifying different amounts and recipients. In our example, to send 0.1 BTC to Mr. B, two outputs were specified: one for Mr. B and another for Mr. A's change of 0.2 BTC.

When setting a transfer destination, a Bitcoin address—functioning similarly to a bank account number—is specified. Technically, this process involves specifying a public key that corresponds to the recipient's private cryptographic key. Through public-key cryptography, only the holder of the corresponding private key can receive and access the funds from that transaction.

This concrete example should help clarify how Bitcoin transactions function from a data perspective.

Frequently Asked Questions

What is a UTXO in Bitcoin?
A UTXO, or Unspent Transaction Output, represents a discrete amount of Bitcoin that has been received and is available to be spent. It's the fundamental building block of a transaction input. Think of them as digital coins and notes of various denominations that you hold in your wallet.

Can a Bitcoin transaction have multiple recipients?
Yes, a single Bitcoin transaction can have multiple outputs, meaning it can send Bitcoin to multiple addresses simultaneously. This is how sending change back to your own address works, and it also enables batch payments. 👉 Explore more strategies for managing transaction outputs

What is the difference between a Bitcoin address and a public key?
A Bitcoin address is a hashed, shorter representation of a public key. It is derived from the public key and is used as the public identifier for receiving funds. The public key itself is used cryptographically to verify that the holder of the corresponding private key authorized the transaction.

Why does my transaction have more than one input?
Your transaction will have multiple inputs if the amount you want to send is larger than any single UTXO you possess. The Bitcoin protocol will automatically combine several of your smaller UTXOs to create the total amount you wish to send.

Is transaction data on the blockchain public?
Yes, all transaction data—including inputs, outputs, amounts, and addresses—is recorded on the public blockchain. While addresses are pseudonymous and not directly linked to real-world identities, sophisticated analysis can sometimes de-anonymize users.

What happens if I send Bitcoin to the wrong address?
Transactions on the Bitcoin blockchain are irreversible. If you send funds to an incorrect address, they are typically lost forever unless the owner of that address voluntarily returns them. Always double-check addresses before sending. 👉 Get advanced methods for securing your transactions