State Machine
Abbreviation: FSM
Pronunciation: STAYT muh-SHEEN
Also known as: Finite-State Machine, State Transition System, FSM
Definition
A state machine is a model of a system as a set of defined states and permitted transitions caused by events or inputs. It makes behavior explicit by specifying what can happen from each state and what output follows. Blockchain protocols and payment systems use state machines to ensure deterministic processing, reject invalid transitions, and coordinate asynchronous events without relying on informal status updates.
Overview
A State Machine describes behavior through states, events, transition conditions, and resulting actions. A simple machine can represent a transaction as pending, included, confirmed, or replaced. More complex machines model smart contracts, consensus, channels, orders, or settlement workflows.
The value of the model is constraint. An event is interpreted according to the current state, and only permitted transitions are accepted. This prevents logically impossible sequences, such as refund completion before a refund request or spending an output after it has already been consumed.
Blockchain execution can be viewed as a replicated state machine: independently validating nodes process ordered transactions and derive the same result through Deterministic Execution. The protocol’s state is much larger than a small business workflow, but the principle of defined transitions remains.
A state machine does not automatically handle delivery failures, duplicate events, or external side effects. Implementations need persistent event identifiers, idempotency, retry rules, and audit history. The formal diagram and the production database must use the same transition logic.
Payment applications often specialize the concept into a Payment State Machine. Clear state models improve testing because every valid path, prohibited path, timeout, and recovery case can be enumerated. They also give product, engineering, finance, and support teams one shared lifecycle vocabulary.
The model should define persistence and concurrency, not only a diagram. Two workers can read the same state and attempt different valid transitions simultaneously. Atomic compare-and-set operations, database constraints, or serialized event processing prevent both changes from succeeding against the same prior state. Versioning is also necessary when lifecycle rules change, so existing records continue under defined semantics instead of silently adopting incompatible transitions.
Key Takeaway
A state machine makes system behavior explicit by allowing only defined transitions, which supports deterministic processing, testing, and operational consistency.
Sources
- NIST IR 8202: Blockchain Technology Overview — NIST (2026-08-02)
- Ethereum.org Documentation: Transactions — Ethereum.org (2026-08-02)
- OxaPay Documentation: Payment Status Table — OxaPay (2026-08-02)