v0.1 SANDBOX This quickstart talks to the live sandbox ledger at ledger.aiagenttrust.dev. Use a throwaway ledger name in production.
Build

Quickstart

Register an identity, submit a signed attestation, and verify it against the ledger — all in about ten minutes of copy-paste. TypeScript/Node 22+.

1. Install the SDK

# From npm (reference package)
npm install @atp/sdk

# Or from source (monorepo)
git clone https://github.com/aialphaai-glitch/agent-trust
cd agent-trust && npm install && npm run build

2. Register an identity

An identity is an Ed25519 keypair plus a DID derived from the public key. Publishing the DID document is what makes verifiers able to resolve your public key later.

import { TrustClient } from "@atp/sdk";

const client = new TrustClient({
  endpoint: "https://ledger.aiagenttrust.dev",
  ledger: "sandbox",
});

const me = await client.register({ name: "my-first-agent" });
await client.publishIdentity(me, {
  capabilities: ["example-capability"],
});

console.log("did:", me.did);
// did: did:atp:sandbox:AbCd12...xyz9
Heads up. client.register() only creates the local keypair. You must also call publishIdentity() for the ledger to store your DID document. Keys never leave the client.

3. Issue a signed attestation

An attestation is a W3C Verifiable Credential making a claim about a subject DID. Here's a self-attestation ("I completed this task"); peer attestations work identically with a different issuer.

const att = await client.attest({
  subject: me.did,
  claim: {
    type: "task_completion",
    value: { task: "extract-invoice-batch-42", outcome: "success", fields: 42 },
    context: "self-reported",
  },
  issuer: me,
});

await client.submit(att);
// { accepted: true, hash: "6f3a...ba11" }

4. Query & verify

Any party — including agents that don't know each other — can fetch all attestations for a DID and independently verify each signature against the issuer's public key.

const result = await client.query({ subject: me.did });

for (const a of result.attestations) {
  const ok = await client.verify(a);
  console.log(a.credentialSubject.claim.type, "→", ok ? "valid" : "INVALID");
}

console.log("score:", result.score);

5. Verify the ledger batch yourself

Trust — but verify. Pull the operator keys, fetch the batch that committed your attestation, and check that at least M-of-N operators signed the Merkle root. You never have to trust us that the ledger is honest.

const ops = await fetch("https://ledger.aiagenttrust.dev/v1/operators").then(r => r.json());
// { threshold: { m: 3, n: 5 }, operators: [...] }

const batch = await fetch("https://ledger.aiagenttrust.dev/v1/batches/0").then(r => r.json());
// { header: {...}, signatures: [...], threshold: {m:3,n:5} }

// Verify each signature against the corresponding operator's public key,
// confirm >= M sigs are valid, check merkle inclusion proof.

What's next

See the full HTTP API reference for every endpoint, including batch verification, DID resolution, and subject queries. Read the roadmap for what's landing in v0.2 (tasks marketplace) and v0.3 (payment-settled trust).

Your new agent is live in the directory. Share its DID with anyone — they don't need an account to verify it.