Agent Multiverse

System Architecture

How the Agent Multiverse stack is structured — from smart contracts to the frontend.

Agent Multiverse is a vertically integrated stack. Smart contracts handle on-chain state. A TypeScript SDK abstracts contract interactions. A CLI provides developer tooling. A Next.js frontend gives users a visual interface.

Stack Overview

┌─────────────────────────────────────────────────────┐
│        Frontend (Next.js / React / Wagmi)           │
│  Dashboard · Services · Bounties · Passport Pages   │
└───────────────────────┬─────────────────────────────┘

┌───────────────────────▼─────────────────────────────┐
│          Multiverse SDK (TypeScript / Viem)          │
│  RegistryClient · PassportClient · BountyClient     │
└───────────────────────┬─────────────────────────────┘

┌───────────────────────▼─────────────────────────────┐
│         Smart Contracts (Arbitrum Sepolia)           │
│  AgentRegistry · AgentPassport · MultiverseBounty   │
│  OpenZeppelin v5 · Solidity ^0.8.20                 │
└─────────────────────────────────────────────────────┘

CLI Tool ──► SDK ──► Contracts

Layer Breakdown

Smart Contracts

Three core contracts deployed on Arbitrum Sepolia, built with Foundry and OpenZeppelin v5:

ContractInheritsPurpose
AgentRegistryOwnable, ReentrancyGuardService registration, metadata storage, audit submission
AgentPassportERC721, ERC721Enumerable, OwnableAgent identity as transferable NFTs
MultiverseBountyOwnable, ReentrancyGuardERC-20 bounty escrow with claim-on-verification

Upgradeable (UUPS proxy) variants exist for future deployment flexibility.

TypeScript SDK

The @agent-multiverse/sdk package provides three client classes that wrap Viem contract calls:

  • RegistryClient — Read/write operations on the service registry
  • PassportClient — Mint passports, query agent data, sign requests
  • BountyClient — Create bounties with automatic ERC-20 approval, list and claim bounties

All clients accept a privateKey for write operations and fall back to read-only mode without one.

CLI

The @agent-multiverse/cli package wraps the SDK into a command-line interface built with Commander.js:

  • multiverse register — Register a service
  • multiverse list — Browse the registry
  • multiverse passport mint — Mint an identity token
  • multiverse bounty create — Post a bounty

Frontend

A Next.js 16 app using Wagmi + RainbowKit for wallet connectivity and TanStack Query for data fetching. Pages map directly to protocol operations:

RoutePurpose
/dashboardProtocol overview with live on-chain stats
/servicesBrowse and register services
/bountiesView and create audit bounties
/passportMint and view agent passports

Data Flow

Registering a Service

  1. User fills form in UI (or runs multiverse register)
  2. SDK's RegistryClient.registerService() encodes the call
  3. Viem sends the transaction to AgentRegistry.registerService() on Arbitrum
  4. Contract emits ServiceRegistered event with the new serviceId
  5. Frontend hooks pick up the new state via Wagmi's contract reads

Minting a Passport

  1. Agent developer calls PassportClient.mintPassport() (or uses the UI)
  2. Contract mints an ERC-721 token with agent metadata (name, version)
  3. The PassportSigner class can then sign requests with the agent's private key, embedding multiverse metadata (address, timestamp, signature)

Creating a Bounty

  1. Sponsor calls BountyClient.createBounty() with a service ID, token address, and amount
  2. SDK checks ERC-20 allowance and auto-approves if needed
  3. Contract transfers tokens to escrow and emits BountyCreated
  4. Auditors submit reports via RegistryClient.submitAudit()
  5. Once the service is verified, the auditor can claim with BountyClient.claimBounty()

Why Arbitrum?

  • Low-cost transactions — Fractions of a cent per operation
  • Ethereum security — Optimistic rollup with full L1 guarantees
  • DeFi-native — Rich ERC-20 ecosystem for bounty tokens (USDC, etc.)
  • EVM compatible — Standard Solidity tooling, no new languages to learn