Transaction Structure
What you'll learn on this page: the parts every Bitcoin transaction contains, what each part is for, and the order to read them in when you are trying to make sense of one.
The five parts
Every Bitcoin transaction, no matter how complicated, is made of the same five pieces.
- Version. A small number telling the network which rules this transaction expects to be validated against.
- Inputs. The list of old UTXOs being spent, each with proof that the spender is allowed to spend them.
- Outputs. The list of new UTXOs being created, each with an amount and a spending condition.
- Locktime. An optional rule saying "this transaction is not valid until block N or time T".
- Witness data. Signatures and extra proof material, stored in a separate section when Segregated Witness (SegWit) is used.
If you understand those five things, you understand every transaction on the chain. The complexity lives inside the script attached to each input and output, not in the outer shape.
A shipping-form analogy
Think of a transaction like a shipping manifest a warehouse clerk fills out.
- Inputs are packages being pulled off the shelf. Each one needs a signature from whoever has the right to move it.
- Outputs are the new packages being shipped out, each with a delivery address and a weight (its BTC value).
- Locktime is the earliest date the shipment is allowed to leave.
- Witness data is the bundle of signatures and receipts attached to the packages.
- Version is just the form revision number.
The clerk does not care what is inside each package. They only check that the paperwork is consistent: the total weight going in matches what goes out (minus the shipping fee), and every package pulled off the shelf has a valid signature.
Bitcoin nodes are that clerk.
How to read one
When txray hands you a parsed transaction, read it in this order. You will save yourself a lot of confusion.
- Count the inputs and outputs. 1-in-2-out is a plain payment with change. Many-in-1-out is a consolidation. 1-in-many-out is a batched payout. Many-in-many-out with equal amounts is probably a CoinJoin. Shape tells you the story before anything else.
- Look at the script types. Are all inputs the same type (P2WPKH, P2TR, etc.)? If yes, it is probably one wallet. Mixed types are a red flag for something unusual.
- Check the fee rate. A reasonable sat/vB puts the transaction in context: "this was a normal payment in a normal market".
- Spot the likely change output. Usually the one whose script type matches the inputs, or whose value is not round.
- Read the heuristic flags last. They are hypotheses, not facts. Do not let them overwrite what you already noticed in steps 1 to 4.
Following this order keeps you grounded in what the transaction actually is before you start interpreting what it means.
Related: The UTXO Model · Privacy Basics