Skip to content

Quick Start

Create your first ATP identity in four commands.

Prerequisites

  • atp-cli installednpm install -g atp-cli
  • Bitcoin wallet — ~$5 in sats for inscription fees
  • 5 minutes — That's all it takes

Step 1: Create Your Identity

bash
atp identity create --name YourAgent

What just happened?

  • Generated a new Ed25519 keypair (32-byte public key, 64-byte private key)
  • Saved the keypair to ~/.atp/keys/
  • Built an identity document with your name, key set (as an array), and optional timestamp
  • Signed the document with your private key
  • Output the identity JSON to identity.json

Step 2: Inspect What You Created

bash
atp identity show identity.json

You'll see:

  • Name: YourAgent
  • Key type: ed25519
  • Fingerprint: A 43-character identifier computed from your public key
  • Signature: 86 base64url characters proving you control the private key

What just happened? The CLI computed your fingerprint — a SHA-256 hash of your public key. This is your permanent, globally unique identifier on the ATP network.

Step 3: Inscribe on Bitcoin

bash
atp identity inscribe identity.json

The CLI will output:

  • An inscription envelope (hex-encoded)
  • Instructions for broadcasting via ord or an inscription service

Follow the instructions to broadcast the transaction. You'll receive a TXID (transaction ID) — save this!

What just happened? Your identity document was embedded in a Bitcoin transaction using Taproot inscriptions. Once the transaction confirms:

  • Your identity becomes immutable and permanent
  • Anyone can verify your identity by looking up the TXID
  • Your fingerprint is now anchored to Bitcoin's proof-of-work

Cost: ~$1–3 USD (varies with Bitcoin network fees)

Step 4: Verify It Worked

bash
atp verify <your-txid>

You should see:

✓ VALID
Document type: id
Name: YourAgent
Fingerprint: xK3jL9mN1qQ9pE4tU6u1fGRjwNWwtnQd4fG4eISeI6s

What just happened? The CLI:

  1. Fetched the transaction from Bitcoin via RPC
  2. Extracted your identity document from the witness data
  3. Verified the signature matches your public key
  4. Confirmed the fingerprint is correct

Your identity is now live on Bitcoin.


Identity Issuance Flow


Want to Do It Programmatically?

The CLI wraps the low-level cryptographic operations. If you need programmatic control (e.g., for automated agent deployment), here's the JavaScript version:

javascript
const { createHash } = require('crypto');
const nacl = require('tweetnacl');

// Generate keypair
const keyPair = nacl.sign.keyPair();

// Compute fingerprint (from k[0])
const fingerprint = createHash('sha256')
  .update(keyPair.publicKey)
  .digest('base64url');

// Identity document (unsigned, keys sorted alphabetically)
const unsignedIdentity = {
  k: [
    {
      t: 'ed25519',
      p: Buffer.from(keyPair.publicKey).toString('base64url')
    }
  ],
  n: 'YourAgent',
  t: 'id',
  ts: Math.floor(Date.now() / 1000),
  v: '1.0'
};

// Serialize to compact sorted JSON
const canonicalBytes = Buffer.from(JSON.stringify(unsignedIdentity), 'utf8');

// Prepend domain separator
const domainSep = Buffer.from('ATP-v1.0:', 'utf8');
const messageToSign = Buffer.concat([domainSep, canonicalBytes]);

// Sign
const signature = nacl.sign.detached(messageToSign, keyPair.secretKey);

// Build final identity with signature
const identity = {
  ...unsignedIdentity,
  s: {
    f: fingerprint,
    sig: Buffer.from(signature).toString('base64url')
  }
};

console.log('Fingerprint:', fingerprint);
console.log('Identity:', JSON.stringify(identity, null, 2));

See the full API documentation for more examples.


Next Steps


Next: Creating an Identity →

Released under the MIT License.