Crates.io | themelio-stf |
lib.rs | themelio-stf |
version | 0.11.13 |
source | src |
created_at | 2021-05-29 03:02:45.739609 |
updated_at | 2022-11-06 23:57:25.63147 |
description | Core state-transition function and data structures for Themelio |
homepage | |
repository | https://github.com/themeliolabs/themelio-stf |
max_upload_size | |
id | 403382 |
size | 378,673 |
This crate contains the data structures and core algorithms that comprise Themelio's core state transition function. Any piece of software needing to validate Themelio transactions or answer questions like "what happens to the Themelio state if transactions A, B, and C happen" can use this minimal-dependency crate.
State
typeThe most important type in the crate is State
, and the closely associated type SealedState
. The yellow paper talks about them further, but in short:
State
represents an mutable Themelio world-state and it's not directly serializable. It includes all the information needed to validate new transactions and blocks, such as a SMT of all outstanding coins, Melmint parameters, etc. It has methods taking Transaction
s etc that advance the state, as well as others to produce serializable blocks, headers, etc.SealedState
represents a sealed state. This roughly corresponds to the notion of "the blockchain state at a given height". Blocks represent transitions from one SealedState
to another.This crate is the most consensus-critical part of Themelio, and essentially defines the entire on-chain logic of the Themelio blockchain.
Versions incompatible with the latest Themelio state are thus all yanked.