DEV Community

Warren Koch
Warren Koch

Posted on

On-Chain AI Agent Attestations with EAS

When an AI agent moves between platforms, the departure record needs to live somewhere trustworthy. For most cases, a local database works fine. But when you need immutable, publicly auditable records, you need on-chain anchoring.

Why On-Chain?

Off-chain markers are signed and verifiable, but depend on someone storing them. On-chain anchoring puts the marker's hash on an immutable ledger. Regulatory compliance, legal disputes, and insurance claims can reference it.

Not every marker needs this. Most don't. But for high-stakes operations, the option matters.

Setup

npm install @cellar-door/eas cellar-door-exit ethers
Enter fullscreen mode Exit fullscreen mode

Creating an Anchored Marker

import { quickExit, toJSON } from 'cellar-door-exit';
import { anchorToEAS } from '@cellar-door/eas';

const { marker } = quickExit('did:web:platform.example');

const attestation = await anchorToEAS(toJSON(marker), {
  provider: ethersProvider,
  signer: ethersSigner,
});

console.log('Attestation UID:', attestation.uid);
Enter fullscreen mode Exit fullscreen mode

Verification

import { verifyEASAttestation } from '@cellar-door/eas';

const result = await verifyEASAttestation(attestationUid, {
  provider: ethersProvider,
});

console.log(result.valid); // true
Enter fullscreen mode Exit fullscreen mode

Other On-Chain Options

  • ERC-8004: ties departure records to on-chain identity and reputation
  • Sign Protocol: alternative attestation framework
npm install @cellar-door/erc-8004
npm install @cellar-door/sign-protocol
Enter fullscreen mode Exit fullscreen mode

When to Use On-Chain vs Off-Chain

Off-chain (default): fast, free, works for most cases.

On-chain: when you need immutability, public auditability, or regulatory compliance.

The protocol doesn't force either path.

Links

Top comments (0)