blockchain is a state machine
At its core, a blockchain is a replicated deterministic state machine, where “state” refers to the data that a node must have in order to process incoming new blocks and transactions. For those who don't know, a state machine is a computer science concept that refers to an abstract machine that manages transitions between valid states and can be in exactly one of a number of states at any given time. In a blockchain, there are “states” that describe the current state of the ledger, and transactions that trigger state transitions.
One of the most important concepts to explain from the start is the difference between state and history. That is, state simply refers to the data currently in use, or the final result after a node processes all blocks and transactions from the first (genesis) block to the most recent block. A blockchain is 'immutable' simply because its history or the data stored in blocks that have been mined cannot be changed. State can therefore be contrasted with history , which represents information about past events that can be stored by nodes for the purpose of rebroadcasting or archiving later , but does not require validating blocks and transactions or continuing chain processing.
State Management in Bitcoin
Therefore, different blockchains manage state and history in different ways. For example, in Bitcoin, state refers to all unspent transaction throughput (UTXO), where each UTXO represents a specific number of bitcoins assigned to a specific owner or public address. On the other hand, history consists of a series of transactions with inputs and outputs. When a transaction is broadcast, the UTXO referenced by the transaction input is marked as spent , removed from the UTXO collection, and a new UTXO (from the transaction output) is added to the collection.