
Bitcoin Transactions: UTXO, Scripts, and How Transfers Work
What actually happens when you send Bitcoin
Bitcoin Doesn't Have Accounts
If you've used a bank, Venmo, or any centralized exchange, you think of money as an account balance. You have $500 in checking. Someone sends you $200. Now you have $700. The bank updates a number in a database.
Bitcoin works nothing like this. There is no "balance" stored anywhere. Instead, Bitcoin tracks money through a system called UTXO — Unspent Transaction Outputs. Think of it like cash in your physical wallet: you don't have a "balance" — you have specific bills. A $20, two $10s, and a $5. Your total is $45, but it's not stored as the number 45. It's stored as a collection of individual bills.
On Bitcoin, every transaction creates outputs — specific amounts of BTC that are "addressed" to a recipient. Those outputs sit on the blockchain, unspent, until the recipient decides to use them. When they do, the old outputs are consumed and new ones are created. The chain of UTXOs traces every bitcoin back to the moment it was mined.
What Happens When You Click 'Send'
Let's trace a real Bitcoin transaction step by step.
Alice has two UTXOs in her wallet: one worth 0.3 BTC (received from a previous transaction) and one worth 0.5 BTC. She wants to send Bob 0.6 BTC.
Neither UTXO alone covers 0.6 BTC, so her wallet software does the following:
- Inputs: Selects both UTXOs (0.3 + 0.5 = 0.8 BTC total)
- Output 1: 0.6 BTC to Bob's address (the payment)
- Output 2: 0.19 BTC back to Alice's own address (the change)
- Fee: 0.01 BTC to the miner who includes this transaction in a block
The math must balance exactly: inputs = outputs + fee. The 0.3 and 0.5 BTC UTXOs are now "spent" and can never be used again. Two new UTXOs exist: 0.6 BTC owned by Bob, and 0.19 BTC owned by Alice.
This is why Alice "sends herself change" — just like buying a $6 item with a $10 bill and getting $4 back. You can't tear the bill in half. You spend the whole thing and get change.
Bitcoin Script: Simple but Powerful
Each UTXO is locked by a small program called a script. To spend a UTXO, you must provide data (typically a digital signature) that satisfies the script's conditions.
The most common script is P2PKH (Pay-to-Public-Key-Hash): "This UTXO can only be spent by someone who can produce a signature matching the public key hash embedded in this script." In plain English: "Only Alice can spend this, because only Alice has the matching private key."
Bitcoin Script is intentionally limited — it's not a full programming language like Ethereum's Solidity. It can't loop, it can't access external data, and it can't modify state beyond the transaction itself. This is by design: simplicity reduces attack surface. Every script is deterministic and terminates. There are no "smart contract bugs" on Bitcoin because there's almost no attack surface to exploit.
More complex scripts enable multi-signature wallets (require 2-of-3 key holders to sign), time-locked transactions (can't spend until a certain block height), and hash-locked contracts (the basis for Lightning Network payment channels).
UTXO vs Account Model: Two Philosophies
Not all blockchains use UTXOs. Ethereum uses an account model — exactly like a bank. Every address has a balance, and transactions directly adjust those numbers. When you send 1 ETH, your balance decreases by 1 and the recipient's increases by 1.
Each approach has strengths:
UTXO (Bitcoin, Cardano, Litecoin):
- Better privacy — each transaction can use new addresses for change
- Natural parallelism — transactions spending different UTXOs can be validated independently
- Simpler verification — no need to track global state
Account model (Ethereum, Solana, BNB Chain):
- Easier to understand — works like a bank account
- Better for smart contracts — state changes are more intuitive to program
- Lower storage per transaction — no need for change outputs
Hyperliquid L1 uses an account model optimized for order book state management. When GaiaEx executes a trade on Hyperliquid, the margin balances are updated atomically — your position, PnL, and available margin all update in a single operation with sub-second finality.
Transaction Fees and the Mempool
When you broadcast a Bitcoin transaction, it doesn't go directly into a block. It enters the mempool — a waiting room of unconfirmed transactions. Miners select which transactions to include in the next block, and they naturally prefer transactions with higher fees (since they keep the fees).
During periods of high demand — bull markets, NFT mints, protocol launches — the mempool can contain hundreds of thousands of pending transactions. Fees spike dramatically. In April 2024, average Bitcoin transaction fees exceeded $100 during an Ordinals inscription frenzy.
This is another reason why purpose-built L1s like Hyperliquid matter for trading. Bitcoin fees are acceptable for occasional large transfers. But for active trading — placing and canceling orders dozens of times per hour — per-transaction fees make it economically impractical.
On Hyperliquid, transaction fees are fractions of a cent. You can place 1,000 orders and cancel 999 of them without worrying about gas costs. The chain was designed for exactly this use case — high-frequency order management at negligible cost.