Skip to content

ShrikeBot/atp-cli

Repository files navigation

atp-cli

Command-line tool for the Agent Trust Protocol — cryptographic identity and trust for AI agents, anchored to Bitcoin.

License: MIT

What is ATP?

ATP gives AI agents verifiable, decentralised identity. No central authority. No accounts. Just Ed25519 keys and Bitcoin inscriptions.

  • Identity — Generate a keypair, build an identity document, inscribe it to Bitcoin
  • Attestation — Vouch for other agents cryptographically
  • Verification — Verify any ATP document from file or directly from a Bitcoin TXID
  • Supersession — Rotate keys with dual-signed proof of continuity
  • Revocation — Permanently revoke a compromised or defunct identity
  • Heartbeat — Prove liveness with signed timestamps
  • Receipts — Record exchanges between agents with co-signed proofs

Full spec: atprotocol.io

Install

npm install -g atp-cli

Or use directly:

npx atp-cli <command>

Quick Start

Create an identity

atp identity create --name "MyAgent" --wallet bc1q...

This generates an Ed25519 keypair, saves the private key to ~/.atp/keys/<fingerprint>.json, and outputs the signed identity document.

Verify a document

From a file:

atp verify identity.json

From a Bitcoin inscription (requires Bitcoin RPC):

atp verify <txid> --rpc-url http://localhost:8332 --rpc-user bitcoin --rpc-pass secret

Attest to another agent

atp attest <their-fingerprint> --from identity.json --claim identity --context "Met on Moltbook"

Create a heartbeat

atp heartbeat --from identity.json --msg "still here"

Supersede (key rotation)

atp identity create --name "MyAgent"  # generates new key
atp supersede --old old-identity.json --new new-identity.json --reason key-rotation

Revoke an identity

atp revoke --identity identity.json --reason key-compromised

Record an exchange

atp receipt create --from identity.json --with <counterparty-fp> --type service --description "Code review"

Commands

Command Description
identity create Generate Ed25519 keypair and signed identity document
identity show Display an identity document
identity inscribe Build inscription envelope for Bitcoin
verify Verify any ATP document (file or TXID)
attest Create a signed attestation for another agent
att-revoke Revoke a previously issued attestation
supersede Create a dual-signed key rotation document
revoke Permanently revoke an identity
heartbeat Create a signed liveness proof
receipt create Record a co-signed exchange between agents

Options

All document commands support:

  • --encoding <json|cbor> — Output format (default: json)
  • --output <file> — Write to file instead of stdout

Identity creation supports:

  • --handle-twitter <handle> — Link Twitter handle
  • --handle-moltbook <handle> — Link Moltbook handle
  • --handle-github <handle> — Link GitHub handle
  • --handle-nostr <handle> — Link Nostr handle
  • --wallet <address> — Bitcoin payment address

Document Types

Type Field Description
Identity id Agent identity with public key(s)
Attestation att Cryptographic vouch for another agent
Attestation Revocation att-revoke Revoke a previous attestation
Supersession super Key rotation with dual signatures
Revocation revoke Permanent identity revocation
Heartbeat hb Signed liveness proof
Receipt rcpt Co-signed exchange record

Key Storage

Private keys are stored in ~/.atp/keys/<fingerprint>.json. Back these up securely — there is no recovery mechanism.

MIME Types

  • JSON: application/atp.v1+json
  • CBOR: application/atp.v1+cbor

Development

npm install
npm run build
npm test
npm run lint
npm run format

First ATP Identity on Bitcoin

The first agent identity published to Bitcoin mainnet:

TXID: 6ffcca0cc29da514e784b27155e68c3d4c1ca2deeb6dc9ce020a4d7e184eaa1c
Fingerprint: erAHnt8G_oV4ANOborNzsAm2qSG_ikaQGA5cLpz8nVQ

License

MIT

Links

Releases

No releases published

Packages

No packages published