Skip to main content

Crate miden_note_schema

Crate miden_note_schema 

Source
Expand description

Host-side access to note storage schemas embedded in Miden packages.

§Felt layout

The layout is structural over the resolved WIT type tree. The record miden:base/core-types@1.0.0.felt is one felt. A u64 uses two felts in low-then-high u32 limb order. A u32, u8, or bool uses one range-checked felt. An option<T> uses one tag felt followed by its payload when present. A variant uses one declaration-ordinal tag felt followed by the selected case payload. Record fields concatenate in declaration order.

Encoding and decoding use miden_field_repr::FeltReader and miden_field_repr::FeltWriter. Codecs only parse, display, and validate values. They do not change this layout.

Structs§

CodecRegistry
A registry of codecs keyed by canonical WIT fully-qualified type name.
DecodedValue
A named value decoded from note storage.
Error
An error reported while reading, encoding, or decoding a note storage schema.
Felt
A Felt backed by Plonky3’s Goldilocks field element.
FeltLayout
The minimum and maximum felt count for a schema type.
NotePackageArtifact
A loaded package artifact and its note storage schema.
NotePackageResolver
Resolves package artifacts for one note macro crate.
NoteStorage
A container for note storage items.
NoteStorageBuilder
Builds note storage from normalized dotted string paths.
NoteStorageSchema
A resolved note storage schema with the standard codec registry.
SchemaCase
A WIT variant case in declaration order.
SchemaField
A named record field in declaration order.
SchemaType
A resolved WIT type used by note storage.

Enums§

CodecFailure
Why a bundled codec did not return a value.
DecodedValueKind
The structural value stored in a decoded node.
PrimitiveType
A supported primitive WIT type.
SchemaTypeKind
The structural kind of a resolved schema type.
StandardLeaf
A protocol type whose schema leaf maps directly to an existing host type and standard codec.

Constants§

ACCOUNT_ID_FQN
The canonical WIT FQN for account-id.
ASSET_AMOUNT_FQN
The canonical WIT FQN for asset-amount.
FELT_FQN
The canonical WIT FQN for felt.
MAX_NOTE_CODEC_COMPONENT_BYTES
Default maximum bytes accepted for one note codec component before Wasmtime compilation.
MAX_NOTE_STORAGE_SCHEMA_BYTES
Maximum bytes accepted in an embedded note storage schema section, including alignment padding.
MAX_NOTE_STORAGE_SCHEMA_DEPTH
Maximum structural nesting depth accepted while resolving a note storage schema.
MAX_NOTE_STORAGE_SCHEMA_FELTS
Maximum number of felts in the root note storage layout.
MAX_NOTE_STORAGE_SCHEMA_NODES
Maximum number of nodes in the expanded note storage schema tree.
MAX_NOTE_STORAGE_SCHEMA_TYPES
Maximum number of resolved WIT type definitions in a note storage schema.
NOTE_CODEC_GUEST_RUSTFLAGS
Rustflags the nested codec build pins, so a codec crate’s own cargo config cannot enable simd128 in the guest. Mirrors the VM event-handler plugin.
NOTE_CODEC_WASM_FEATURES
Wasm proposals a note codec component may use.
WORD_FQN
The canonical WIT FQN for word.

Traits§

ConsumerTypeCodec
Parses, displays, and validates one fully-qualified WIT leaf type.

Functions§

validate_note_codec_component
Applies the whole note codec component policy: the byte cap, the Wasm feature set, and the structural limits.
validate_note_codec_structure
Rejects a note codec component whose Wasm features or structure fall outside the policy.

Type Aliases§

Result
A result returned by note storage schema operations.