Accounts vs. UTXOs
Unlike conventional banking systems or Ethereum, Bitcoin does not maintain a table of user accounts with balances. Instead, Bitcoin tracks discrete chunks of value called Unspent Transaction Outputs (UTXOs).
Think of UTXOs like physical cash bills: if you have a \$20 bill and want to pay \$15, you cannot rip the bill apart. You must spend the entire \$20 bill as an input, create a \$15 output to the merchant, and receive a \$5 output back to yourself as change.
Transaction Components
- Inputs: References to previous UTXOs being consumed, accompanied by cryptographic unlocking scripts (witness data or scriptSig).
- Outputs: New UTXOs being created, specifying the amount and the locking script (scriptPubKey) that requires a specific signature to spend later.
- Miner Fee: The difference between total input value and total output value is claimed by the miner who includes the block.
Transaction Verification Code Example
Input 0: PrevHash: [abc123...], Index: 1, Value: 0.50 BTC
Output 0: Recipient Address, Value: 0.48 BTC
Output 1: Change Address (Sender), Value: 0.019 BTC
Transaction Fee: 0.001 BTC (Inputs - Outputs)
Reader Discussion (0)
No comments yet. Have a technical question or clarification about this article? Share it below.