Skip to content

Quick Start

Five lines.Verified on-chain.

Issue your first AI agent behavior attestation on Solana in under 2 minutes.

  1. 01

    Install

    npm install prova-agent-sdk
  2. 02

    Initialize the client

    import { ProvaClient } from 'prova-agent-sdk';
    import { Keypair } from '@solana/web3.js';
    
    const client = new ProvaClient({
      rpcUrl: process.env.SOLANA_RPC_URL,   // Helius devnet recommended
      agentKeypair: Keypair.fromSecretKey(agentSecretKey),
    });
  3. 03

    Issue an attestation

    // Hash any structured action payload — deterministic, collision-resistant
    const actionHash = await ProvaClient.hashAction(
      JSON.stringify({ operation: 'transfer', amount: '500', token: 'USDC' })
    );
    
    const receipt = await client.attest({
      operatorKeypair,   // wallet that registered this agent
      actionHash,
      actionType: 'Transaction',
      privacyMode: false,
    });
    
    console.log('Receipt tx:', receipt.txSignature);
    console.log('Explorer:  ', receipt.explorerUrl);
  4. 04

    Batch-attest up to 100 actions in one tx

    // One Solana transaction → up to 100 receipts (ComputeBudget auto-scaled)
    const batch = await client.batchAttest({
      operatorKeypair,
      attestations: [
        { actionHash: hash1, actionType: 'ToolCall' },
        { actionHash: hash2, actionType: 'Decision', privacyMode: true },
        { actionHash: hash3, actionType: 'ModelInvocation' },
      ],
    });
  5. 05

    Query via REST API

    import { ProvaApiClient } from 'prova-agent-sdk';
    
    const api = new ProvaApiClient({
      apiUrl: 'https://prova-api.fly.dev',
      apiKey: 'prova_...',   // generate at /app/api-keys
    });
    
    const { data } = await api.listAttestations({ limit: 20 });
  6. 06

    DeFi Agent — attest any on-chain protocol action

    // Pattern: wrap any protocol interaction in a Prova receipt.
    // Works with Jupiter swaps, pump.fun buys, Orca LPs, or any Solana program.
    // No modification to the protocol — Prova is a receipt layer on top.
    
    // 1. Build the structured payload for the action your agent just performed
    const swapPayload = {
      protocol:    'jupiter',
      operation:   'exactInSwap',
      inputMint:   'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
      outputMint:  'So11111111111111111111111111111111111111112',   // SOL
      inputAmount: '100000000',  // 100 USDC (6 decimals)
      slippageBps: 50,
      routePlan:   ['Orca', 'Raydium'],
      agentId:     operatorKeypair.publicKey.toBase58(),
      timestamp:   Date.now(),
    };
    
    // 2. Hash the payload — same hash every time for the same action params
    const actionHash = await ProvaClient.hashAction(JSON.stringify(swapPayload));
    
    // 3. Attest — one Ed25519 proof sealed on Solana
    const receipt = await client.attest({
      operatorKeypair,
      actionHash,
      actionType: 'Transaction',
      privacyMode: false,   // set true for Vanish mode (hash on-chain, payload off-chain)
    });
    
    // → Auditors, regulators, and users can now verify what your agent swapped,
    //   when, and with which parameters — without trusting your logs.
    console.log('DeFi receipt:', receipt.explorerUrl);

What lands on-chain

Each attest() call creates a BehaviorAttestation account on Solana via the Anchor program. It stores the action hash, type, Ed25519 signature, and timestamp — SAS-compatible and verifiable by anyone. Share the tx signature as a Solana Blink to make it visible in any compatible wallet or Twitter/X client.

REST API base URL

https://prova-api.fly.dev

GET /api/v1/attestations

GET /api/v1/agents/:id

GET /api/v1/health

Share as a Solana Blink

// After attestation, make the receipt shareable as a Blink:
const blinkUrl =
  `https://prova-solana.vercel.app/api/actions/verify?tx=${receipt.txSignature}`;

// Paste this URL in Twitter/X to render the receipt as an interactive card.
// Supported by Phantom, Backpack, Solflare, and all Dialect-compatible clients.
console.log('Blink:', blinkUrl);