Skip to main content

Crate open_agent_id

Crate open_agent_id 

Source
Expand description

§Open Agent ID — Rust SDK

Sign, verify, and manage AI agent identities using the Open Agent ID protocol (V2).

§DID Format

did:oaid:{chain}:{agent_address}
  • chain: lowercase chain identifier (e.g. "base")
  • agent_address: 0x + 40 lowercase hex chars (CREATE2-derived contract address)

§Quick Start

use open_agent_id::{crypto, did::Did, signing};

// Generate a keypair
let (signing_key, verifying_key) = crypto::generate_keypair();

// Parse a DID
let did = Did::parse("did:oaid:base:0x7f4e3d2c1b0a9f8e7d6c5b4a3f2e1d0c9b8a7f6e").unwrap();

// Sign an HTTP request
let output = signing::sign_http(
    &signing::HttpSignInput {
        method: "POST",
        url: "https://api.example.com/v1/agents",
        body: b"{}",
        timestamp: None,
        nonce: None,
    },
    &signing_key,
).unwrap();

// Verify
let valid = signing::verify_http(
    "POST",
    "https://api.example.com/v1/agents",
    b"{}",
    output.timestamp,
    &output.nonce,
    &output.signature,
    &verifying_key,
).unwrap();
assert!(valid);

Re-exports§

pub use did::Did;
pub use error::Error;
pub use types::*;

Modules§

client
Registry API client for agent registration, lookup, and verification.
crypto
Ed25519 key generation, signing, verification, and encoding utilities.
did
DID parsing, validation, and formatting for the did:oaid method.
error
Error types for the Open Agent ID SDK.
signer
Client for the oaid-signer daemon.
signing
Canonical payload construction, signing, and verification for the two V2 signing domains.
types
Shared types used across the SDK.