open-agent-id
Rust SDK for the Open Agent ID protocol. Allows AI agents to register identities, sign HTTP requests, and verify other agents' signatures using Ed25519 cryptography.
Installation
Add to your Cargo.toml:
[]
= { = "../agent-id-rust" }
Usage
Register a new agent
use ;
let identity = register.await?;
println!;
println!;
Load an existing identity
use AgentIdentity;
let identity = load?;
Sign a payload
let signature = identity.sign?;
println!;
Sign an HTTP request
let headers = identity.sign_request?;
// headers contains:
// - X-Agent-DID
// - X-Agent-Timestamp
// - X-Agent-Nonce
// - X-Agent-Signature
Verify another agent's signature
use AgentIdentity;
let valid = verify.await?;
assert!;
Look up agent info
use AgentIdentity;
let info = lookup.await?;
println!;
println!;
DID Format
did:agent:{platform}:{unique_id}
- platform: 3-20 lowercase alphanumeric characters
- unique_id:
agt_followed by 10 base62 characters
Examples:
did:agent:tokli:agt_a1B2c3D4e5
did:agent:openai:agt_X9yZ8wV7u6
Signing Specification
HTTP requests are signed by constructing a canonical payload:
{METHOD}\n{URL}\n{BODY_SHA256}\n{TIMESTAMP}\n{NONCE}
The payload is signed with Ed25519 and the signature is base64url-encoded (no padding).
License
Apache-2.0