Claude Code Tools

@buildersgarden/siwa

official

A Claude Code skill for registering AI agents on the [ERC-8004 (Trustless Agents)](https://github.com/builders-garden/ERC-8004) standard and authenticating them via SIWA, a challenge-response protocol inspired by [EIP-4361 (SIWE)](https://eips.ethereum.or

Version
0.0.24
Last Updated
2026-03-05
Source
official

SIWA — Sign In With Agent

SIWA — Sign In With Agent

SIWA lets AI agents prove who they are. Think Sign In With Ethereum, but for agents instead of humans.

An agent signs a message proving it owns an ERC-8004 identity NFT. The server verifies the signature and checks onchain ownership. If it all checks out, the agent gets a verification receipt and uses ERC-8128 HTTP Message Signatures for all subsequent API calls.

For AI agents: Read siwa.id/skill.md for structured instructions.

Quick Start

npm install @buildersgarden/siwa

Agent-Side: Choose Your Wallet Provider

ProviderSigner
CirclecreateCircleSiwaSigner()
OpenfortcreateOpenfortSiwaSigner()
PrivycreatePrivySiwaSigner()
Private KeycreateLocalAccountSigner()
Keyring ProxycreateKeyringProxySigner()
WalletClientcreateWalletClientSigner()
import { signSIWAMessage } from "@buildersgarden/siwa";
import { createLocalAccountSigner } from "@buildersgarden/siwa/signer";
import { privateKeyToAccount } from "viem/accounts";

// Create signer
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const signer = createLocalAccountSigner(account);

// Sign SIWA message
const { message, signature } = await signSIWAMessage({
  domain: "api.example.com",
  uri: "https://api.example.com/siwa",
  agentId: 42,
  agentRegistry: "eip155:84532:0x8004A818BFB912233c491871b3d84c89A494BD9e",
  chainId: 84532,
  nonce,
  issuedAt,
}, signer);

Server-Side: Choose Your Framework

FrameworkModule
Next.js@buildersgarden/siwa/next
Express@buildersgarden/siwa/express
Hono@buildersgarden/siwa/hono
Fastify@buildersgarden/siwa/fastify
// Next.js example
import { withSiwa, siwaOptions } from "@buildersgarden/siwa/next";

export const POST = withSiwa(async (agent, req) => {
  return { agent: agent.address, agentId: agent.agentId };
});

export { siwaOptions as OPTIONS };

For full examples, see the documentation.

How It Works

  1. The agent asks the server for a nonce (/siwa/nonce) — the server checks onchain registration before issuing it
  2. The agent builds a SIWA message and signs it
  3. The agent sends the signature to verify (/siwa/verify) — the server confirms ownership onchain
  4. The server returns a verification receipt
  5. For subsequent API calls, the agent uses ERC-8128 per-request signatures with the receipt attached

The agent’s private key can be kept in a separate keyring proxy process, so the agent never touches it directly.

Try It Locally

git clone https://github.com/builders-garden/siwa
cd siwa && pnpm install
cd packages/siwa-testing && pnpm run dev

Repository Structure

PackageDescription
packages/siwaCore SDK: signing, verification, registry helpers, ERC-8128, server wrappers
packages/siwa-skillSkill files for AI agents to learn SIWA authentication
packages/siwa-testingTest harness with CLI agent and Express server
packages/keyring-proxyStandalone signing proxy for key isolation
packages/siwa-websiteNext.js website with documentation
packages/2fa-gatewayGateway for Telegram webhook callbacks
packages/2fa-telegramTelegram-based 2FA signing approval

SDK Modules

ImportDescription
@buildersgarden/siwaCore: signSIWAMessage, verifySIWA, createSIWANonce
@buildersgarden/siwa/signerSigner factories for all wallet types
@buildersgarden/siwa/erc8128ERC-8128 HTTP signing/verification
@buildersgarden/siwa/receiptHMAC receipt helpers
@buildersgarden/siwa/nonce-storeNonce stores (Memory, Redis, KV)
@buildersgarden/siwa/nextNext.js middleware
@buildersgarden/siwa/expressExpress middleware
@buildersgarden/siwa/honoHono middleware
@buildersgarden/siwa/fastifyFastify middleware

Docker

# Proxy + OpenClaw gateway
cp .env.proxy.example .env   # fill in secrets
docker compose -f docker-compose.proxy.yml up -d

# Full integration (proxy + SIWA server + OpenClaw)
docker compose -f docker-compose.test.yml up -d --build

License

MIT — Builders Garden SRL 2025