Transaction
Also: tx
network · beginner
A signed message that consumes existing UTXOs as inputs and creates new UTXOs as outputs. The atomic unit of value transfer in Bitcoin.
A Bitcoin transaction is the unit of state change on the chain. It consumes one or more existing [UTXOs](/glossary/utxo) as [inputs](/glossary/input) and creates one or more new UTXOs as [outputs](/glossary/output). Nothing else moves; the chain has no concept of "accounts" or "balances."
Every transaction is identified by its txid — the double-SHA-256 hash of its serialized form (excluding witness data, since SegWit). The txid is what other transactions reference when they spend its outputs, what blocks commit to via the [merkle root](/glossary/merkle-root), and what block explorers use as a primary key.
Validation rules a [node](/glossary/node) checks on every transaction:
- Every input references a real, unspent output.
- The sum of input values is greater than or equal to the sum of output values. The difference is the [fee](/glossary/fee-rate) paid to the miner.
- Each input includes a valid unlocking [witness](/glossary/witness) or scriptSig that satisfies the locking script on the output it's spending.
- The transaction obeys all [consensus](/glossary/consensus) rules — size limits, sigop counts, opcode bounds, version flags.
A transaction is "confirmed" once it lands in a block; "deeply confirmed" once enough blocks have stacked on top that reversing it would require enormous proof-of-work. The first transaction in any block — the [coinbase](/glossary/coinbase) — is the exception that proves the rule: it has no real inputs and pays the miner the block subsidy plus all transaction fees.