Data structures and state machines
Terms used in this lesson
- UTXO
- Unspent transaction output: one discrete chunk of bitcoin that can be used as a transaction input.
Bitcoin tracks spendable transaction outputs instead of account balances. Every valid transaction consumes existing outputs and creates new ones.
Loading lesson visuals...
Learn the idea
A data structure organizes information so rules can find and update it. State is the information a system currently treats as true. Bitcoin tracks unspent transaction outputs, shortened to UTXOs: individually identified outputs that have been created but not yet spent. Their values are commonly counted in satoshis, shortened to sats; one satoshi is one hundred-millionth of a bitcoin. A state machine defines valid states and deterministic transitions, meaning every correct participant given the same starting state and input computes the same next state.
Represent the current state
For a simple bearer ledger, the state can be a set of uniquely identified unspent outputs with values and spending conditions.
Inspect every idea above to open it.
In a replicated protocol, authoritative state is the result of applying agreed valid transitions. Databases may index or cache that result, but a mutable row is not the rule itself.
The questions unlock after every required learning activity
Inspect every guided idea, open the worked example, rebuild its mechanism, and complete the deterministic lesson tool. Your progress is saved automatically.