Solana Programs
Lucid has two Solana programs written in Rust using the Anchor framework. These programs provide the on-chain layer for verifiable AI — anchoring receipts and registering passports on the Solana blockchain.lucid-receipts (Thought Epoch)
Stores epoch MMR roots on-chain. Each anchored epoch creates a Solana account containing:| Field | Type | Description |
|---|---|---|
epoch_id | u64 | Sequential epoch identifier |
mmr_root | [u8; 32] | Merkle Mountain Range root hash |
receipt_count | u32 | Number of receipts in the epoch |
timestamp | i64 | Unix timestamp of anchoring |
authority | Pubkey | Signer that anchored this epoch |
Anchoring Flow
Verification
Anyone can verify a receipt belongs to an anchored epoch:- Get the receipt’s MMR inclusion proof from the API
- Fetch the epoch’s on-chain MMR root from Solana
- Recompute the root from the proof and receipt hash
- Compare with the on-chain root
lucid-registry (Lucid Passports)
Manages passport registration on-chain:| Field | Type | Description |
|---|---|---|
passport_id | [u8; 32] | Unique passport identifier |
passport_type | enum | Model, Agent, Compute, Tool, Dataset |
owner | Pubkey | Solana wallet that owns this passport |
metadata_uri | String | URI to off-chain metadata (IPFS or API) |
status | enum | Active, Suspended, Revoked |
created_at | i64 | Registration timestamp |
Register a Passport On-Chain
gas-utils
Thegas-utils program handles Cross-Program Invocations (CPI) for gas-efficient operations across both programs. It provides:
- Batched epoch anchoring (multiple epochs in one transaction)
- Passport + epoch combined operations
- Fee calculation helpers
Program IDs
| Program | Devnet | Mainnet |
|---|---|---|
| lucid-receipts | LRec8vRdS4YmUzSgD6MjR2YMd8PJeLRJmp99jGuvkT | TBD |
| lucid-registry | LReg4TfpwCjgDHvQLXRs3aCBz4UpJ7LHPG3wNGRbKR | TBD |
| gas-utils | LGas5DoPLo8fM7WA9jKm5cX3dNNQCVfp2RZnM1oHNU | TBD |
Dual Gas System
Lucid uses a dual-gas model on-chain:- iGas (inference gas) — consumed when anchoring inference receipts
- mGas (memory gas) — consumed when storing agent memory on-chain
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=8b4c7e6431e9a6af1ef23b77bb4ff5fd)
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=d5651a45e4bfbabc33f74e146af3f94a)