Skip to main content
Anchoring is how Lucid makes AI interactions permanently verifiable. Cryptographic receipts are batched into epochs, compressed into a Merkle Mountain Range (MMR) root, and committed on-chain. Anyone can later verify that a specific interaction occurred without trusting Lucid.

The Receipt-to-Chain Pipeline

Key Algorithms

Receipt Hashing

Every receipt is hashed using SHA-256 over RFC 8785 canonical JSON (JCS). This ensures identical receipts produce identical hashes regardless of JSON key ordering or formatting.

Merkle Mountain Range (MMR)

Receipts are appended to an MMR — an append-only authenticated data structure. The root is computed via SHA-256 with right-to-left peak bagging. Properties:
  • Append-only (no rewriting history)
  • Efficient inclusion proofs (O(log N))
  • Supports batched verification

Epoch Finalization

An epoch closes when either condition is met:
  • 100+ receipts accumulated
  • 1+ hour since epoch opened

On-Chain Commitment

The thought_epoch Solana program stores MMR roots on-chain with three instruction variants: Each commitment is stored in a PDA derived from the authority’s public key.

Multi-Chain Anchoring

Lucid anchors to both Solana and EVM chains simultaneously. Configure via the ANCHORING_CHAINS environment variable:
EVM anchoring uses the EpochRegistry contract, which stores the same root hash, epoch ID, and metadata.

Gas Costs

DePIN Archival

After on-chain commitment, the full epoch bundle (all receipts, MMR state, metadata) is archived to decentralized storage: All DePIN uploads go through the AnchorDispatcher, which handles storage selection, CID tracking, and deduplication.

Verifying a Receipt

To verify that a specific receipt was included in an anchored epoch:
The proof contains the receipt hash, the MMR path, and the on-chain epoch root — sufficient for independent verification.