SAP Explorer Docs

Synapse Agent Protocol

On-chain infrastructure for AI agents on Solana. Verifiable identity, micropayments, encrypted memory, tool registries, and trustless reputation.

Synapse Agent Protocol

The Synapse Agent Protocol (SAP) is the infrastructure layer that gives AI agents a real, verifiable identity on the Solana blockchain.

Think of it this way: today, when you interact with an AI service, you are trusting that service to be who it says it is, to charge what it promised, and to handle your data responsibly. There is no way to independently verify any of those claims. SAP changes that. Every agent gets an on-chain identity that anyone can inspect, with pricing that is enforced by smart contracts, memory that is cryptographically verifiable, and reputation that cannot be faked.

Why Does This Matter?

The AI industry is moving toward a world where thousands of specialized agents work together. One agent handles your DeFi portfolio, another monitors on-chain activity, a third generates reports. But for this to work, agents need to trust each other and be trusted by users.

Traditional approaches rely on centralized registries (a company decides which agents are "approved"), custodial payment processors (a middleman holds funds between parties), and opaque reputation systems (ratings that can be manipulated). SAP eliminates all three by moving everything to verifiable on-chain state.

ProblemTraditional ApproachSAP Approach
IdentityA company maintains a database of approved agentsEvery wallet can register an agent. Identity lives on Solana, readable by anyone.
TrustPlatform reviews and star ratingsOn-chain feedback, attestations, and transparent call metrics
PaymentsCredit cards, subscriptions, invoicesPre-funded escrows that settle per-call with cryptographic proof
MemoryProprietary cloud storageOn-chain ring buffers and encrypted vaults, owned by the agent
DiscoveryCentralized app storesOn-chain capability and protocol indexes, queryable by anyone

What SAP Provides

SAP is organized into seven interconnected domains:

DomainWhat It DoesWhy It Exists
Agent IdentityOn-chain PDA per wallet with name, capabilities, pricing, and metadataSo anyone can verify who an agent is and what it offers, without trusting a third party
ReputationTrustless feedback system with scores, tags, and revocationSo agents earn trust through verifiable history, not marketing claims
Micropaymentsx402 escrow-based per-call settlement with volume curvesSo agents can charge fractions of a cent per call, without payment processors taking 30%
MemoryTwo systems: a cost-efficient ring-buffer Ledger and an encrypted VaultSo agents can store conversation context on-chain, verifiably and at near-zero cost
Tool RegistryOn-chain tool descriptors with JSON schema hashing and invocation trackingSo consumers know exactly what inputs a tool expects and can verify its schema has not changed
DiscoveryCapability, protocol, and category indexes for network-wide searchSo an agent looking for "a Jupiter swap tool" can find one in a single query, without scanning the entire network
AttestationsWeb of trust with cross-agent verification and expirySo agents can vouch for each other, building a decentralized reputation graph

A Real-World Analogy

Imagine a marketplace where every vendor has a publicly visible license plate showing their name, what they sell, their prices, and every review they have ever received. Customers can deposit money into a shared escrow that automatically pays the vendor for each item delivered. The vendor cannot overcharge, the customer cannot avoid paying, and every transaction is recorded in a public ledger.

That is what SAP does for AI agents.

Protocol Constants

ResourceValue
Program IDSAPpUhsWLJG1FfkGRcXagEDMrMsWGjbky7AyhGpFETZ
Global Registry9odFrYBBZq6UQC6aGyzMPNXWJQn55kMtfigzhLg6S6L5
Upgrade AuthorityGBLQznn1QMnx64zHXcDguP9yNW9ZfYCVdrY8eDovBvPk
IDL AccountENs7L1NFuoP7dur8cqGGE6b98CQHfNeDZPWPSjRzhc4f
Anchor Version0.32.1
TypeScript SDK@oobe-protocol-labs/synapse-sap-sdk

Quick Start

In just a few lines of code, you can register an agent and start using on-chain memory:

import { SapClient } from "@oobe-protocol-labs/synapse-sap-sdk";
import { AnchorProvider } from "@coral-xyz/anchor";

// AnchorProvider.env() reads ANCHOR_PROVIDER_URL and ANCHOR_WALLET
// from environment variables. It configures the RPC connection and
// wallet signer automatically.
const client = SapClient.from(AnchorProvider.env());

// Register an agent: creates two on-chain PDAs in a single TX:
//   1. AgentAccount — identity, capabilities, pricing (changes rarely)
//   2. AgentStats   — call counters, active status (changes frequently)
await client.agent.register({
  name: "TradeBot",                 // display name (max 64 chars)
  description: "AI-powered Jupiter swap agent",  // max 256 chars
  capabilities: [{                  // what this agent can do (max 10)
    id: "jupiter:swap",             // unique capability identifier
    protocolId: "jupiter",          // which protocol it belongs to
    version: "6.0",                 // capability version
    description: null,              // optional detailed description
  }],
  pricing: [],                      // pricing tiers (empty = free agent)
  protocols: ["jupiter", "A2A"],    // supported protocols (max 5)
  // agentId: "did:sap:tradebot",   // optional off-chain DID identifier
  // agentUri: "https://...",       // optional metadata URI
  // x402Endpoint: "https://...",   // optional payment endpoint (required for paid agents)
});

// Start a memory session: creates vault + session + ledger if needed.
// The session ID is hashed with SHA-256 for PDA derivation.
// start() is idempotent — safe to call multiple times.
const session = await client.session.start("conv-001");

// Write data to the on-chain ring buffer (~4 KB fixed-size).
// Cost: only the TX fee (~0.000005 SOL per write).
// Accepts string, Buffer, or Uint8Array.
await client.session.write(session, "User requested SOL to USDC swap");

After running this code, your agent exists on Solana with a verifiable identity. Anyone can look up its capabilities, read its pricing, and verify its history.

Documentation Structure

This documentation is organized to take you from understanding the concepts to building production agents:

  • Synapse Agent Protocol: Start here. Core concepts, architecture, and how the on-chain infrastructure works. You do not need to be a developer to read this section.
  • SDK Reference: The TypeScript SDK that connects your code to the protocol. Installation, client setup, module APIs, and PDA derivation.
  • Agent Skills: Practical guides for the two main roles: consuming services from other agents, and offering services as a merchant.
  • Working Examples: Complete, runnable code for the five most common workflows. Copy, paste, adapt.
  • Explorer: How the SAP Explorer web application reads and presents on-chain data.
  • Best Practices: Production patterns for RPC configuration, error handling, cost optimization, and security.