Sub topic 2
UTXO and Account Models: How Balances and Transfers Appear
Assume you know what a blockchain, wallet address, and transaction are. You should also know that Bitcoin and Ethereum use different models at a high level, and that you can read basic Python such as lists, dictionaries, and functions.
Blockchain tracking starts with the model used to represent ownership. A UTXO model records spendable outputs. An account model records the current state of an account. The same real-world payment can look very different in each model.
UTXO model
UTXO means unspent transaction output. Each output is a separate piece of value that a later transaction can spend. A wallet's balance is the sum of all UTXOs that its keys can spend.
A transaction consumes one or more existing outputs as inputs and creates new outputs. The consumed outputs disappear from the unspent set. The new outputs become available for later transactions.
For example:
- Alice spends a 1.0 BTC UTXO.
- She sends 0.3 BTC to Bob.
- She sends 0.69 BTC to a change address she controls.
- The remaining 0.01 BTC is the transaction fee.
The change output is important for analysis. It can look like a payment to a new owner even though Alice still controls it.
utxos = [
{"address": "Alice-1", "amount": 0.70},
{"address": "Alice-2", "amount": 0.30},
]
balance = sum(output["amount"] for output in utxos)
print(f"Alice controls {balance:.2f} BTC")A UTXO transaction does not directly say, “this address owns this entire balance.” It says which previous outputs were consumed and which new outputs were created. Analysts reconstruct balances by following this history.
Account model
An account model stores a balance for each account in the ledger state. Ethereum uses accounts for externally owned accounts, which are controlled by private keys, and contract accounts, which contain program code and storage.
A native-coin transfer usually changes the balances of the sender and receiver. The transaction also has a nonce, which is a sequence number used to order transactions from an account.
The account model makes the current balance easy to query, but a transaction's meaning can be more complex than its top-level fields suggest. A contract call can cause several internal value transfers. Token balances usually live in the token contract's storage, not in the native-coin balance field of each address.
| Feature | UTXO model | Account model |
|---|---|---|
| Balance | Sum of unspent outputs | Stored state value |
| Transfer record | Inputs and new outputs | State changes from a transaction |
| Change | Often creates a new output | Usually no separate change output |
| Common tracking issue | Change and shared inputs | Contract calls and internal transfers |
Why the difference matters for tracking
On a UTXO chain, analysts often inspect common inputs. If several addresses appear as inputs in one ordinary transaction, they may belong to the same wallet. This is a heuristic, not proof. CoinJoin transactions deliberately combine unrelated users' inputs and can make the heuristic wrong.
On an account chain, one address can remain visible across many transactions, but that address may be:
- A personal wallet
- An exchange deposit address
- A smart contract
- A token contract
- A temporary routing address
A transfer between two addresses does not by itself identify the person or organization behind them. Entity labels require additional evidence.
When building flow metrics, first identify the chain's model. For UTXO data, reconstruct outputs and treat change carefully. For account data, inspect transaction receipts and contract events when native fields do not describe the complete movement.
Exercise
A Bitcoin transaction spends two inputs and creates three outputs. Why should you avoid counting every output as a payment to a new owner?
Show answer
One or more outputs may be change returned to the sender, and input ownership may also be shared or misidentified.