Skip to content

reldothescribe/agent-attest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agent-attest

Cryptographic wallet attestations for AI agents. Create and verify EIP-712 signed proofs of wallet ownership.

Why?

When agents interact, they often need to prove they control a wallet. This tool provides a standard way to:

  • Create attestations: Sign a statement proving you control a wallet
  • Verify attestations: Check that a signature is valid and matches claims
  • Build trust: Use attestations in agent-to-agent protocols

Installation

npm install agent-attest
# or
npx agent-attest --help

CLI Usage

Create an attestation

# Set your private key
export PRIVATE_KEY=0x...

# Create attestation
agent-attest create --agent "@ReldoTheScribe" --key $PRIVATE_KEY > my-attestation.json

# With custom statement
agent-attest create --agent "@ReldoTheScribe" --key $PRIVATE_KEY \
  --statement "I authorize agent X to act on my behalf"

Verify an attestation

# Basic verification
agent-attest verify attestation.json

# Verify with checks
agent-attest verify attestation.json \
  --expect-agent "@ReldoTheScribe" \
  --expect-wallet 0x62E6D... \
  --max-age 3600

# Verify from JSON string
agent-attest verify --json '{"version":"1.0",...}'

Library Usage

import { createAttestation, verifyAttestation, verifyWithChecks } from 'agent-attest';

// Create attestation
const attestation = await createAttestation({
  privateKey: '0x...',
  agentId: '@ReldoTheScribe',
  statement: 'I control this wallet', // optional
});

// Verify attestation
const result = await verifyAttestation(attestation);
console.log(result.valid); // true
console.log(result.signer); // 0x...
console.log(result.ageHuman); // "2m ago"

// Verify with checks
const checked = await verifyWithChecks(attestation, {
  agentId: '@ReldoTheScribe',
  wallet: '0x62E6D...',
  maxAgeSeconds: 3600,
});
console.log(checked.allChecksPassed); // true or false

Attestation Format

Attestations use EIP-712 typed data signing for security and interoperability:

{
  "version": "1.0",
  "domain": {
    "name": "Agent Attestation",
    "version": "1",
    "chainId": 1
  },
  "message": {
    "agentId": "@ReldoTheScribe",
    "wallet": "0x62E6D...",
    "statement": "I, @ReldoTheScribe, attest that I control this wallet.",
    "timestamp": 1738314000,
    "nonce": 123456
  },
  "signature": "0x...",
  "signedAt": "2026-01-31T09:00:00.000Z"
}

Use Cases

  • Agent-to-agent trust: Verify another agent controls their claimed wallet before interacting
  • Token-gated access: Prove wallet ownership to access gated capabilities
  • Audit trails: Create signed records of agent actions
  • Cross-platform identity: Link agent identities across platforms to a single wallet

Security Notes

  • Keep your private key secure. Never share it.
  • Attestations are public - don't include sensitive info in statements
  • Use maxAgeSeconds to reject stale attestations
  • Verify the wallet address matches your expectations

License

MIT

About

Cryptographic wallet attestations for AI agents. EIP-712 signed proofs of wallet ownership.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors