Skip to main content

Fundamentals

Memory​

A memory contains a content string and optional metadata.

{
"content": "Deployments run on Fridays.",
"metadata": { "kind": "preference" }
}

Memories are append-only. Corrections are written as new memories. Content is encrypted at rest. Metadata is stored as plain JSON.

Leaf​

A leaf is the SHA-256 hash of the canonical memory encoding.

leaf = sha256("toda:leaf:v1" || 0x00 || utf8(canonicalJson(memory)))

Canonical JSON uses a fixed field order and sorted metadata keys.

Log​

A log is the ordered sequence of leaves associated with one wallet. Leaves are indexed from 0 and are never reordered.

Commitment​

A commitment is the Merkle root of leaves 0..n-1. Each new root covers the full log.

Anchor​

An anchor is a Solana transaction that writes a commitment to the wallet's commitment account.

A stored memory is not anchored until a confirmed root includes its leaf.

Batch​

A batch contains the pending leaves sealed under one root and transaction. It records the leaf range, root, nonce, transaction signature, and status.

Tip​

The tip is the current onchain root, memory count, and nonce for a wallet.

Commitment account​

The commitment account is a PDA derived from ['user', owner_pubkey]. It stores the tip and can be derived without contacting toda.

Authority​

The authority can submit roots for a commitment account. It cannot decrypt memory. A submitted root can be checked by recomputing the log.

Nonce​

The nonce is a monotonic u64 incremented after each commit. A transaction with an unexpected nonce fails.

Inclusion proof​

An inclusion proof contains a leaf, its index, sibling hashes, and direction bits.

{
"leaf": "9ab3...",
"leafIndex": 41,
"siblings": ["c40f...", "1e77..."],
"directions": [true, false]
}

true means the sibling is on the right.

Proof bundle​

getProof() returns the inclusion proof, batch root, anchor transaction, and current onchain root.

The onchain root should be fetched independently when toda is inside the verifier's threat model.

Capability grant​

A capability grant is an expiring bearer token with a use limit.

Vault and lot​

A vault is the onchain token account holding stake for a wallet. A lot is one deposit with its own maturity time.

Notation​

SymbolMeaning
`
0x00One zero byte
sha256(x)SHA-256 of x
H(l, r)Internal-node hash
Base unitsInteger token amount before decimals

Next: The commitment log.