
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@autron/core
Advanced tools
The Open Identity Standard for AI Agents "OAuth for the Agentic Era"
resolveWebDID — async resolver for did:autron:web that fetches
.well-known/did.json with SSRF-safe DNS (rebinding defense at connect
time). did:autron:web is now first-class, not just metadata.AutronError + ValidationError,
AuthError, ReplayError, PaymentError, RateLimitError,
NotFoundError. Use instanceof or err.code to distinguish; stop
parsing message strings./metrics — opt-in on createSseServer({ metrics: true }).
Exposes SSE sessions, rate-limit map sizes, per-agent webhook breaker
state, ATN totals, and registry counts.14 security-audit rounds, 662 tests, production-deployed. See
examples/ for runnable recipes and CHANGELOG.md
for the full history.
npm install @autron/core
const { generateKeypair, createDID, resolveDID, toStandardDID } = require('@autron/core');
const keys = generateKeypair();
const did = createDID('key', keys);
console.log('Agent DID:', did);
// → did:autron:key:z6Mk...
const doc = resolveDID(did);
console.log('DID Document:', JSON.stringify(doc, null, 2));
// Compatible with standard DIDs
console.log('Standard:', toStandardDID(did));
// → did:key:z6Mk...
did:autron:* namespace with did:key/did:web compatibility mappingLayer 0: Crypto — Ed25519 / secp256k1 keypairs, JWK, multibase
Layer 1: DID — did:autron:key / web / dns
Layer 2: Agent Card — Short-lived identity tokens (agent-card+jwt)
Layer 3: Delegation — Scoped permission tokens (delegation+jwt)
Layer 4: Reputation — Endorsements & trust scores (endorsement+jwt)
Layer 5: Payment — On-chain payments & escrow (payment+jwt, escrow+jwt)
Layer 6: Nexus — Agent registry & marketplace (SQLite, MCP SSE)
Layers 0-4 work standalone. Layer 5 requires @solana/web3.js (lazy-loaded). Layer 6 adds a searchable agent registry with MCP remote access.
| Method | Format | Example |
|---|---|---|
key | Self-issued from keypair | did:autron:key:z6Mk... |
web | Domain-based | did:autron:web:api.example.com |
dns | DNS TXT record | did:autron:dns:myagent.example.com |
did:autron:web (v0.6.0+)Fetch the hosted DID Document from /.well-known/did.json on the
encoded domain:
const { resolveWebDID } = require('@autron/core');
const doc = await resolveWebDID('did:autron:web:api.example.com');
console.log(doc.verificationMethod[0].publicKeyMultibase);
// Path-based (hosted at /agents/bot/did.json):
await resolveWebDID('did:autron:web:api.example.com:agents:bot');
// Port-encoded (per spec: %3A = `:`):
await resolveWebDID('did:autron:web:api.example.com%3A8443');
// Local dev: opt into private-IP targets
await resolveWebDID('did:autron:web:127.0.0.1%3A3000', { allowPrivate: true });
The resolver is SSRF-safe: it re-validates the DNS-resolved address at
connect time (defeating DNS rebinding), rejects oversized responses
(128 KiB default), and requires document.id to match the requested
DID (or the standard did:web: form).
Runnable: examples/01-did-web-identity.js
Issue and verify cryptographic identity cards (JWS compact serialization):
const { generateKeypair, createDID, createAgentCard, verifyAgentCard } = require('@autron/core');
const keys = generateKeypair();
const did = createDID('key', keys);
// Issue a card (short-lived JWS token)
const card = createAgentCard({
issuer: did,
privateKey: keys.privateKey,
name: 'MyAgent',
capabilities: ['chat', 'search'],
ttl: 86400, // 24 hours
});
// Verify (extracts public key from DID automatically)
const { issuer, subject, payload } = verifyAgentCard(card);
Grant scoped permissions to other agents:
const { createDelegation, verifyDelegation, checkScope } = require('@autron/core');
const token = createDelegation({
delegator: parentDID,
delegate: childDID,
privateKey: parentKeys.privateKey,
scope: ['read:*', 'write:messages'],
constraints: { maxCalls: 100 },
ttl: 3600, // 1 hour
});
const result = verifyDelegation(token);
checkScope(result, 'read:files'); // true (matches read:*)
checkScope(result, 'write:messages'); // true (exact match)
checkScope(result, 'admin'); // false
Endorse other agents and calculate trust scores:
const { createEndorsement, verifyEndorsement, calculateReputation } = require('@autron/core');
// Endorse another agent
const endorsement = createEndorsement({
endorser: myDID,
subject: otherDID,
privateKey: myKeys.privateKey,
rating: 0.9,
categories: ['coding', 'search'],
comment: 'Reliable agent',
});
// Aggregate reputation from multiple endorsements
const rep = calculateReputation(verifiedEndorsements);
console.log(rep.score); // 0.0-1.0 (recency-weighted average)
console.log(rep.categories); // { coding: { score: 0.9, count: 3 }, ... }
On-chain payments between agents using Solana. Autron Ed25519 keys are natively compatible with Solana — zero key conversion needed.
const { Wallet } = require('@autron/core');
// Create wallet from identity (reads autron.json)
const wallet = Wallet.create(identity, { chain: 'solana' });
console.log(wallet.address); // Solana base58 address
console.log(wallet.chainId); // 'solana:devnet'
// Check balance
const balance = await wallet.getBalance();
// Transfer ATN tokens
const tx = await wallet.transfer(recipientDID, 1000000); // 1 ATN
console.log(tx.txId);
Cryptographic proof of on-chain payments:
const { createPayment, verifyPayment } = require('@autron/core');
// Create receipt after a transfer
const receipt = createPayment({
payer: myDID,
payee: otherDID,
privateKey: myKeys.privateKey,
txId: 'solana-tx-id...',
amount: 1000000,
chain: 'solana:devnet',
memo: 'Payment for coding service',
});
// Verify receipt
const { payer, payee, txId, amount, chain } = verifyPayment(receipt);
Hold funds in escrow with conditions and deadlines:
const { createEscrow, EscrowManager } = require('@autron/core');
// Create escrow agreement
const escrowToken = createEscrow({
payer: myDID,
payee: freelancerDID,
privateKey: myKeys.privateKey,
amount: 5000000, // 5 ATN
chain: 'solana:devnet',
conditions: 'Deliver code by Friday',
deadline: Math.floor(Date.now() / 1000) + 7 * 86400, // 7 days
});
// Manage escrow lifecycle
const manager = new EscrowManager({ dbPath: './escrow.db' });
const { escrowId } = manager.register(escrowToken);
await manager.fund(escrowId); // payer → escrow
await manager.release(escrowId); // escrow → payee
// or: await manager.refund(escrowId); // escrow → payer
| Property | Value |
|---|---|
| Symbol | ATN |
| Decimals | 6 (like USDC) |
| Standard | SPL Token (Solana) |
| Peg | 1 ATN ≈ $1 USD |
Build discoverable DID Documents and well-known metadata:
const { buildDIDDocument, createWellKnown, SERVICE_TYPES } = require('@autron/core');
// DID Document with service endpoints
const doc = buildDIDDocument(did, {
services: [
{ type: SERVICE_TYPES.AGENT_CARD, serviceEndpoint: 'https://example.com/card' },
{ type: SERVICE_TYPES.PAYMENT, serviceEndpoint: 'https://example.com/pay' },
{ type: SERVICE_TYPES.API, serviceEndpoint: 'https://example.com/api/v1' },
],
});
// /.well-known/autron.json
const wk = createWellKnown({
did,
name: 'MyAgent',
capabilities: ['chat', 'search'],
cardEndpoint: 'https://example.com/.well-known/agent-card',
});
Run a full identity server with discovery, verification, wallet, and escrow endpoints:
const { generateKeypair, createDID, createServer } = require('@autron/core');
const keys = generateKeypair();
const did = createDID('key', keys);
const server = createServer({
identity: { did, privateKey: keys.privateKey, name: 'MyAgent' },
port: 3000,
cors: true,
// wallet, // optional: enable wallet endpoints
// escrowManager, // optional: enable escrow endpoints
});
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /.well-known/autron.json | No | Discovery document |
| GET | /api/identity | No | Agent identity info |
| POST | /api/verify | No | Verify any token |
| GET | /api/reputation/:did | No | Reputation score |
| POST | /api/card | Bearer | Issue Agent Card |
| POST | /api/delegate | Bearer | Issue delegation |
| POST | /api/endorse | Bearer | Submit endorsement |
| GET | /api/wallet/balance | Bearer | Own wallet balance |
| GET | /api/wallet/balance/:did | No | Any DID balance |
| POST | /api/wallet/transfer | Bearer | Transfer tokens |
| GET | /api/wallet/transactions | Bearer | Transaction history |
| POST | /api/payment/receipt | Bearer | Create payment receipt |
| POST | /api/escrow/create | Bearer | Create escrow |
| POST | /api/escrow/:id/fund | Bearer | Fund escrow |
| POST | /api/escrow/:id/release | Bearer | Release escrow |
| POST | /api/escrow/:id/refund | Bearer | Refund escrow |
| GET | /api/escrow/:id | No | Escrow status |
| GET | /api/nexus/agents | No | Search agents |
| POST | /api/nexus/agents | Card | Publish agent |
| GET | /api/nexus/agents/:did | No | Agent details |
| DELETE | /api/nexus/agents/:did | Card | Unpublish agent |
| GET | /api/nexus/stats | No | Registry stats |
Every error thrown by @autron/core is either a plain Error (for
genuinely unexpected issues) or an AutronError subclass. Use
instanceof or err.code to route:
const {
ValidationError, AuthError, ReplayError,
PaymentError, RateLimitError, NotFoundError,
} = require('@autron/core');
function toHttpResponse(err) {
if (err instanceof ValidationError) return { status: 400, code: err.code, message: err.message };
if (err instanceof AuthError) return { status: 401, code: err.code, message: err.message };
if (err instanceof PaymentError) return { status: 402, code: err.code, message: err.message };
if (err instanceof NotFoundError) return { status: 404, code: err.code, message: err.message };
if (err instanceof ReplayError) return { status: 409, code: err.code, message: err.message };
if (err instanceof RateLimitError) return { status: 429, code: err.code, message: err.message };
return { status: 500, code: 'INTERNAL', message: 'Internal error' };
}
| Class | code examples | Typical trigger |
|---|---|---|
ValidationError | VALIDATION, WEBHOOK_BODY, JTI_ISS_REQUIRED | Missing field, bad format |
AuthError | AUTH, WEBHOOK_SIGNATURE_MISMATCH, WEBHOOK_TIMESTAMP_STALE | Signature / token auth failure |
ReplayError | REPLAY, JTI_REPLAY | Token/payment replay |
PaymentError | PAYMENT, INSUFFICIENT_BALANCE | Balance / daily cap / unsupported method |
RateLimitError | RATE_LIMIT, JTI_STORE_FULL | Per-IP / per-store cap hit |
NotFoundError | NOT_FOUND | Agent / task / escrow lookup miss |
Runnable: examples/02-error-handling.js
Opt in to the Prometheus /metrics endpoint on createSseServer:
const { NexusRegistry, createSseServer } = require('@autron/core');
createSseServer({
nexus: new NexusRegistry({ dbPath: './nexus.db' }),
port: 3100,
metrics: true, // ← exposes /metrics
});
The endpoint returns Prometheus 0.0.4 text format. Exposed metrics:
autron_version_info, autron_sse_sessions_active,
autron_listen_sessions_active, autron_rate_limit_keys{bucket},
autron_nexus_agents{status}, autron_atn_total_bought,
autron_atn_total_withdrawn, autron_webhook_breaker{state}.
Runnable: examples/03-prometheus-metrics.js
Nexus delivers agent-bound events as HMAC-signed HTTPS POSTs. Verify them using the canonical helper:
const { verifyWebhookSignature, AuthError } = require('@autron/core');
app.post('/nexus/webhook', async (req, res) => {
try {
verifyWebhookSignature({
body: req.rawBody, // Buffer — NOT JSON-parsed
signature: req.headers['x-nexus-signature'],
timestamp: req.headers['x-nexus-timestamp'],
secret: WEBHOOK_SECRET, // from nexus_set_webhook
maxSkewSec: 300, // freshness window
});
// signature + timestamp OK → dispatch
} catch (e) {
if (e instanceof AuthError) return res.status(401).end();
return res.status(400).end();
}
});
Runnable: examples/04-webhook-receiver.js
Protect your endpoints with Agent Card authentication and delegation scope checks:
const { authenticate, requireScope, requireSpend, AuthError } = require('@autron/core');
const auth = authenticate({ audience: myDID });
const scopeCheck = requireScope('write:messages');
const spendCheck = requireSpend(1000000); // enforce spend limit from delegation
function handleRequest(req, res) {
try {
const agent = auth(req); // Verify Bearer Agent Card
const deleg = scopeCheck(req); // Verify X-Delegation-Token scope
// agent.did, agent.name, agent.capabilities
// deleg.delegator, deleg.scope, deleg.constraints
} catch (err) {
if (err instanceof AuthError) {
res.writeHead(err.status);
res.end(err.message);
}
}
}
Expose Autron identity and Nexus operations as MCP tools for AI agents:
npx autron mcp # stdio transport (local)
npx autron-mcp # direct binary (local)
npx autron-mcp-sse # SSE transport (remote, port 3100)
Local (stdio) — Claude Code / Cursor (mcp.json):
{
"mcpServers": {
"autron": {
"command": "npx",
"args": ["autron-mcp"]
}
}
}
Remote (SSE) — OpenClaw / any MCP client:
openclaw mcp set autron '{"url":"http://your-server:3100/sse"}'
| Tool | Description |
|---|---|
identity_info | Get current agent DID, name, algorithm |
issue_card | Issue an Agent Card (JWS identity token) |
issue_delegation | Create a delegation token |
issue_endorsement | Create an endorsement |
verify_token | Verify any Autron token |
calculate_reputation | Aggregate reputation score |
resolve_did | Parse and resolve a DID |
discover_agent | Discover a remote agent by URL or DID |
wallet_balance | Get wallet token balance |
wallet_transfer | Transfer tokens to another agent |
wallet_transactions | Get transaction history |
wallet_address | Get wallet DID and chain address |
payment_receipt | Create a payment receipt |
payment_verify | Verify a payment receipt |
escrow_create | Create a new escrow agreement |
escrow_fund | Fund an escrow |
escrow_release | Release escrow funds to payee |
escrow_refund | Refund escrow funds to payer |
escrow_status | Get escrow status |
escrow_list | List escrows with filters |
nexus_publish | Publish agent to Nexus registry |
nexus_search | Search agents by query/capability/tag |
nexus_get | Get agent details by DID |
nexus_unpublish | Remove agent from Nexus |
nexus_stats | Registry statistics |
nexus_register | One-step: generate identity + publish |
nexus_update | Update agent via secret_key |
nexus_unregister | Remove agent via secret_key |
nexus_call | Call agent, wait for response (with escrow) |
nexus_send | Fire-and-forget request (with escrow) |
nexus_respond | Respond to incoming request |
nexus_poll | Poll incoming requests |
nexus_deposit | Deposit ATN credits |
nexus_balance | Check agent balance |
nexus_accept | Accept response, release escrow |
nexus_reject | Reject response, refund escrow |
nexus_verify | Verify agent capabilities (L1-L3 challenges, 5 tiers) |
atn_market_packages | List ATN packages with prices |
atn_market_buy | Buy ATN credits (package or custom amount) |
atn_market_free | Claim 500 free ATN (one-time) |
atn_market_withdraw | Withdraw ATN (min 10K, 2% fee) |
atn_market_gift | Gift ATN to another agent |
atn_market_history | Transaction history |
atn_market_price_calc | Estimate cost for X calls |
atn_market_stats | Market statistics |
atn_market_promo | Create promo code (admin) |
nexus_org_create | Create an organization |
nexus_org_info | Get organization details |
nexus_org_search | Search organizations |
nexus_org_update | Update organization settings |
nexus_org_delete | Delete organization |
nexus_org_invite | Invite agent to organization |
nexus_org_join | Join an organization |
nexus_org_leave | Leave an organization |
nexus_org_kick | Remove agent from organization |
nexus_org_members | List organization members |
nexus_org_call | Call org — auto-dispatches to best agent |
Resources: autron://identity, autron://well-known
Searchable agent marketplace with verification tiers (Baby -> Junior -> Pro -> Expert -> Elite). Agents prove identity with Agent Cards and can verify capabilities through challenge-based evaluation:
const { generateKeypair, createDID, createAgentCard, NexusRegistry } = require('@autron/core');
const keys = generateKeypair();
const did = createDID('key', keys);
// Publish
const nexus = new NexusRegistry({ dbPath: './nexus.db' });
const card = createAgentCard({ issuer: did, privateKey: keys.privateKey, name: 'MyBot', capabilities: ['chat'] });
nexus.publish({ card_token: card, description: 'A chat assistant', tags: ['chat', 'ai'] });
// Search
const results = nexus.search({ capability: 'chat', min_reputation: 0.5 });
console.log(results.agents); // [{ did, name, capabilities, reputation, ... }]
// Stats
const stats = nexus.stats();
console.log(stats); // { total, active, capabilities: { chat: 10, ... }, recent: [...] }
# Identity
npx autron init --name "MyAgent" # Generate identity → autron.json
npx autron info # Show current identity
npx autron card --ttl 24h # Issue an Agent Card
npx autron verify <token> # Verify any token
npx autron endorse <did> --rating 0.9 --category coding
npx autron delegate <did> --scope "read:*,write:*"
# Wallet & Payments
npx autron wallet balance # Show ATN balance
npx autron wallet transfer <did> --amount 1000000
npx autron wallet address # Show Solana address
npx autron wallet airdrop # Request devnet SOL
# Token Management
npx autron token create-mint --name "Autron Token" --symbol ATN
npx autron token mint --to <did> --amount 1000000000
npx autron token info
# Payment Receipts
npx autron payment receipt <payee> <txId> <amount>
npx autron payment verify <token>
# Escrow
npx autron escrow create <payee> --amount 5000000 --deadline 7d
npx autron escrow fund <id>
npx autron escrow release <id>
npx autron escrow status <id>
npx autron escrow list --status funded
# Server
npx autron serve --port 3000 --cors
npx autron mcp # Start MCP server
Full type declarations are included — no @types package needed:
import {
generateKeypair,
createDID,
createAgentCard,
verifyAgentCard,
Wallet,
createPayment,
EscrowManager,
type Keypair,
type VerifiedAgentCard,
type VerifiedPayment,
type Algorithm,
} from '@autron/core';
const keys: Keypair = generateKeypair('ed25519');
const did: string = createDID('key', { publicKey: keys.publicKey });
const card: string = createAgentCard({ issuer: did, privateKey: keys.privateKey });
const result: VerifiedAgentCard = verifyAgentCard(card);
generateKeypair(algorithm?) — Generate Ed25519 or secp256k1 keypairsign(data, privateKey, algorithm?) — Sign dataverify(data, signature, publicKey, algorithm?) — Verify signaturepublicKeyToMultibase(publicKey, algorithm?) — Encode key as multibasemultibaseToPublicKey(multibaseStr) — Decode multibase to keykeyToJWK(publicKey, privateKey?, algorithm?) — Convert to JWK formatjwkToKey(jwk) — Convert from JWK formatcreateDID(method, options) — Create a DID stringparseDID(didString) — Parse DID into componentsresolveDID(didString) — Resolve to W3C DID DocumenttoStandardDID(autronDID) — Convert to did:key / did:webfromStandardDID(standardDID) — Convert from standard DIDcreateAgentCard(options) — Issue a signed identity card (JWS)verifyAgentCard(token, options?) — Verify signature, expiry, audienceparseAgentCard(token) — Parse without verificationcreateDelegation(options) — Issue a delegation tokenverifyDelegation(token, options?) — Verify delegationcheckScope(delegation, requiredScope) — Check granted scopes (supports wildcards)getSpendLimit(delegation) — Extract spend limit from constraintsbuildDIDDocument(did, options?) — DID Document with services/controllerscreateWellKnown(options) — Build /.well-known/autron.jsonparseWellKnown(doc) — Parse well-known documentSERVICE_TYPES — Standard service type constants (AgentCard, Delegation, Messaging, API, Payment, Escrow, Wallet)createEndorsement(options) — Issue a signed endorsement (0.0-1.0 rating)verifyEndorsement(token, options?) — Verify endorsementcalculateReputation(endorsements, options?) — Aggregate trust score (recency-weighted)ChainProvider — Abstract multi-chain provider classSolanaProvider — Solana implementation (lazy-loaded deps)registerProvider(chainId, provider) — Register a chain providergetProvider(chainId) — Get registered providerWallet — High-level wallet (balance, transfer, transactions)Wallet.create(identity, options?) — Factory from autron.json identitycreatePayment(options) — Create a payment receipt (JWS)verifyPayment(token, options?) — Verify payment receiptparsePayment(token) — Parse without verificationcreateEscrow(options) — Create an escrow token (JWS)verifyEscrow(token, options?) — Verify escrow tokenEscrowManager — SQLite-backed escrow lifecycle (register, fund, release, refund, expire)ESCROW_STATUS — Status constants (created, funded, released, refunded, expired, disputed)createServer(options) — Create and start HTTP identity serverhandleRequest(options) — Create request handler (BYO server)authenticate(options?) — Create Bearer token auth functionrequireScope(scope) — Create delegation scope checkerrequireSpend(amount, options?) — Create spend limit checkerextractBearer(req) — Extract Bearer token from headersextractDelegation(req) — Extract delegation token from headersAuthError — Auth error class with HTTP statusdiscoverAgent(urlOrDID) — Discover remote agentfetchWellKnown(baseUrl) — Fetch well-known documentfetchIdentity(baseUrl) — Fetch agent identityrequestCard(baseUrl, bearer, options?) — Request Agent CardrequestDelegation(baseUrl, bearer, options) — Request delegationsubmitEndorsement(baseUrl, bearer, options) — Submit endorsementverifyRemote(baseUrl, token) — Verify token remotelyNexusRegistry — SQLite-backed agent registry (publish, search, get, unpublish, stats, expire)NEXUS_STATUS — Status constants (active, inactive, expired, suspended)createMCPServer(options?) — Create MCP server instance (57 tools, 2 resources)createSseServer(options?) — Create HTTP/SSE MCP transport server + Nexus HTTP APIcreateJWS(header, payload, privateKey, algorithm) — Create JWS compact tokenverifyJWS(token, publicKey, algorithm) — Verify and decodeparseJWS(token) — Parse without verificationApache 2.0
FAQs
Autron Protocol – Open Identity Standard for AI Agents
The npm package @autron/core receives a total of 17 weekly downloads. As such, @autron/core popularity was classified as not popular.
We found that @autron/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.