|
1 | 1 | # The ledger state transition |
2 | 2 |
|
3 | | -> This page is a stub. |
| 3 | +The ledger can be fundamentally seen as a state transition function. Given a |
| 4 | +ledger state and a signal (typically a block) we return a new ledger state. |
| 5 | + |
| 6 | +In the formal modeling of the ledger, we allow a slightly richer definition in |
| 7 | +order to bring more clarity. As such, we think of the ledger transition function |
| 8 | +as having three parts: |
| 9 | + |
| 10 | +- The *Environment*. This consists of "read-only" data which can affect the |
| 11 | + transition. This might consist of things such as as the protocol parameters |
| 12 | + or the current slot or block number. |
| 13 | + |
| 14 | +- The *State*. This is the current state of the ledger. It includes obvious |
| 15 | + things such as the UTxO set. |
| 16 | + |
| 17 | +- The *Signal*. The signal is what drives evolution of the ledger. There are |
| 18 | + three top-level signals which the ledger has to consider: |
| 19 | + |
| 20 | + - A *block body*. When a new block is added to the chain, the state is |
| 21 | + updated. Since the ledger is concerned only with the |
| 22 | + [block body](./concepts/blocks.md), that is the part which drives the state |
| 23 | + transition. |
| 24 | + |
| 25 | + - A *transaction*. This is needed to validate transactions when they enter |
| 26 | + the mempool, before including them into a block. |
| 27 | + |
| 28 | + - A *tick*. This represents time moving on. Sometimes the state of the |
| 29 | + ledger updates just due to time moving - for example, at an epoch boundary. |
| 30 | + |
| 31 | +The question of validity is determined inductively from an initial state. A |
| 32 | +transaction is valid with respect to some state if one can correctly apply the |
| 33 | +transition function to yield a new state, which is then itself considered valid. |
| 34 | + |
| 35 | +We discuss the question of validity for transactions and blocks in |
| 36 | +[Validity](./state-transition/validity.md). Ticks must always be valid - if we |
| 37 | +are in a situation where we cannot advance time in a valid fashion, then we |
| 38 | +are in a very bad situation indeed! |
| 39 | + |
| 40 | +The ledger state transition function must execute identically on each node in |
| 41 | +the network. Consequently, the full function is defined in the ledger specs - |
| 42 | +formal or semi-formal expressions of the computation to be performed. More |
| 43 | +detail on how to read the specs is detailed in |
| 44 | +[How to read the ledger specs](./state-transition/reading-specs.md) |
0 commit comments