Box Lifecycle
Understanding how boxes are created, consumed, and managed
Box Lifecycle Overview
Boxes are immutable state cells. A transaction consumes existing boxes as inputs and creates new boxes as outputs. Once a box is spent, it cannot be used again, which gives Ergo clear and predictable state transitions.
Created
A transaction output becomes a new box with value, ErgoTree, creation height, optional tokens, and optional registers.
Unspent
Wallets and dApps select unspent boxes as inputs. Data input boxes can also be read by scripts without being consumed.
Spent
Spending requires a valid proof for the box's ErgoTree. The transaction then replaces the old state with newly created outputs.