Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lucid.foundation/llms.txt

Use this file to discover all available pages before exploring further.

The lucid_agent_wallet program gives every AI agent a Solana wallet with programmable spending policies, revenue distribution, time-locked escrow, and delegated session keys. Program ID (devnet): AJGpTWXbhvdYMxSah6GAKzykvfkYo2ViQpWGMbimQsph

Instructions

Wallet Management

InstructionDescription
create_walletCreate a PDA wallet bound to a passport NFT mint
executeExecute an instruction from the wallet (owner-only, policy-checked)

Policy

InstructionDescription
set_policyConfigure spending limits, allowed programs, and time windows

Revenue Splits

InstructionDescription
configure_splitSet recipients and basis-point shares (must sum to 10000)
distributeDistribute tokens to all recipients according to the configured split

Session Keys

InstructionDescription
create_sessionDelegate signing authority with permissions and expiry
revoke_sessionRevoke a session key

Escrow

InstructionDescription
create_escrowLock tokens with an expected receipt hash and time limit
release_escrowRelease funds to beneficiary upon receipt verification
claim_timeoutRefund depositor after escrow expiry
dispute_escrowFreeze escrow for arbitration

Wallet Account

PDA seeds: ["agent_wallet", passport_mint]
FieldTypeDescription
ownerPubkeyWallet owner
passport_mintPubkeyBound passport NFT mint
nonceu64Transaction counter
bumpu8PDA bump seed
created_ati64Creation timestamp

Policy Config

PDA seeds: ["policy", wallet]
FieldTypeDescription
max_per_txu64Maximum spend per transaction (0 = unlimited)
daily_limitu64Maximum daily spend (0 = unlimited, resets at UTC midnight)
daily_spentu64Running daily counter
allowed_programsVec<Pubkey>Allowlist of program IDs (empty = any, max 10)
time_window_starti64Earliest allowed execution time
time_window_endi64Latest allowed execution time (0 = no end)

Split Config

PDA seeds: ["split", wallet] Recipients and basis points must have equal length, sum to 10000 (100%), and contain at most 10 entries.
// Configure a 70/20/10 split
await program.methods
  .configureSplit(
    [computeProvider, modelProvider, protocolWallet],
    [7000, 2000, 1000]
  )
  .accounts({ split: splitPda, wallet: walletPda, owner: wallet.publicKey })
  .rpc();

Escrow Flow

  1. Create — Depositor locks tokens with an expected receipt hash and duration
  2. Release — When the beneficiary produces a matching receipt hash, funds are released
  3. Timeout — If no valid receipt by expiry, depositor reclaims funds
  4. Dispute — Either party can freeze the escrow for arbitration
Escrow statuses: Created -> Released | Refunded | Disputed

Session Keys

Delegate signing authority with scoped permissions:
await program.methods
  .createSession(
    0x0001,              // permissions bitmask
    expiresAt,           // Unix timestamp
    new BN(1_000_000)    // max amount
  )
  .accounts({
    session: sessionPda,
    wallet: walletPda,
    delegate: delegatePublicKey,
    owner: wallet.publicKey,
  })
  .rpc();

Events

WalletCreated, Executed, PolicySet, SplitConfigured, Distributed, SessionCreated, SessionRevoked, EscrowCreated, EscrowReleased, EscrowRefunded, EscrowDisputed