Expand description
§acdp — Rust library for the Agent Context Distribution Protocol
Reference implementation of ACDP v0.1.0 Final (specification promoted to Final on 2026-05-19).
ACDP lets agents publish immutable, producer-signed context descriptors, retrieve and verify them locally, discover them by keyword, and follow signed references across registries.
§Quick start — producer
// In production, load from secure storage; `generate` uses OsRng.
let key = SigningKey::generate();
let prod = Producer::new(
key,
AgentDid::new("did:web:agents.example.com:my-agent"),
"did:web:agents.example.com:my-agent#key-1",
);
let req = prod.publish_request()
.title("Q1 snapshot")
.context_type(ContextType::DataSnapshot)
.visibility(Visibility::Public)
.build()
.unwrap();
println!("content_hash: {}", req.content_hash);§Quick start — consumer (feature = “client”)
use acdp::{client::{RegistryClient, VerifiedContext}, did::WebResolver, types::CtxId};
let client = RegistryClient::new("https://registry.example.com")?;
let resolver = WebResolver::new();
let ctx_id = CtxId("acdp://registry.example.com/…".into());
let ctx = VerifiedContext::fetch(&client, &resolver, &ctx_id).await?;
println!("title: {}", ctx.body().title);Re-exports§
pub use error::AcdpError;pub use error::SupersessionReason;pub use types::AgentDid;pub use types::Body;pub use types::CapabilitiesDocument;pub use types::ContentHash;pub use types::ContextType;pub use types::CtxId;pub use types::DataRef;pub use types::DataRefType;pub use types::FullContext;pub use types::LineageId;pub use types::Location;pub use types::PublishRequest;pub use types::PublishResponse;pub use types::RegistryState;pub use types::SearchParams;pub use types::SearchResponse;pub use types::Status;pub use types::Visibility;pub use types::WireError;
Modules§
- client
client - crypto
- did
- error
- Error types for the ACDP library.
- limits
- Network-policy constants shared by client and server code.
- pagination
server - Cursor-pagination helpers for registry store backends.
- producer
- profile
- ACDP conformance profiles (RFC-ACDP-0001 §9.1).
- registry
server - safe_
http - SSRF defenses for server-side cross-registry resolution (RFC-ACDP-0006 §7).
- time
- Time helpers shared by the producer builder and search-params formatter.
- types
- validation
- Runtime validation against the ACDP schemas.
Constants§
- ACDP_
SCHEMA_ NAMESPACE - The JSON Schema namespace (
$idprefix) for this protocol version, e.g.<ACDP_SCHEMA_NAMESPACE>/acdp-error.schema.json. - ACDP_
VERSION - The ACDP protocol version this library implements.