Skip to content

IDProva launches April 7 — Registry packages coming at launch. Build from source now.

Core API

Reference for the idprova-core Rust crate. All Python and TypeScript SDK classes map directly to these Rust types.

Rust (idprova-core)Python (idprova)TypeScript (@idprova/core)
KeyPairKeyPairKeyPair
AidBuilderAIDBuilderAidBuilder
Aid / AID DocumentAIDAid
DelegationTokenDATDat
ScopeScopeScope
TrustLevelTrustLevelTrustLevel
ReceiptLogReceiptLogReceiptLog
AgentIdentityAgentIdentity

AgentIdentity is a high-level convenience class available in the Python and TypeScript SDKs that combines KeyPair, AidBuilder, and DelegationToken into a single interface.


Ed25519 key pair for signing and verification.

// Generate
let kp = KeyPair::generate()?;
// Sign / verify
let sig = kp.sign(b"message");
assert!(kp.verify(b"message", &sig));
// Public key access
let multibase: String = kp.public_key_multibase();
let bytes: &[u8; 32] = kp.public_key_bytes();
// Restore from secret
let kp2 = KeyPair::from_secret_bytes(&secret)?;

Hashing functions.

FunctionAlgorithmOutput Format
hash::blake3(data)BLAKE3blake3:<hex>
hash::sha256(data)SHA-256sha256:<hex>

Fluent builder for creating Agent Identity Documents.

MethodTypeDescription
new()ConstructorCreate a new builder
id(did)&strSet the DID identifier
controller(did)&strSet the controller DID
name(name)&strSet human-readable name
description(desc)&strSet description
model(model)&strSet AI model identifier
runtime(runtime)&strSet runtime environment
trust_level(level)&strSet trust level (L0-L4)
add_verification_key(pk)Public keyAdd an Ed25519 key
build()Build and validate the AID
Property / MethodReturn TypeDescription
id() / didStringDID identifier
controller()StringController DID
trust_level()Option<String>Trust level
to_json()StringJSON serialization
from_json(json)AidParse from JSON
validate()Result<()>Validate structure

MethodDescription
issue(key, issuer, subject, scopes, duration)Issue a signed DAT
from_compact(jws)Parse from JWS compact serialization
compact() / to_compact()Serialize to JWS compact format
verify(public_key) / verify_signature(pk_bytes)Verify signature
validate_timing()Check expiry and not-before
issuer()Issuer DID
subject()Subject DID
jti()Unique token ID
scopes() / scopeGranted scope strings
expires_at()Expiration Unix timestamp
is_expired()Boolean expiry check
MethodDescription
parse(str) / new(str)Parse a scope string
covers(other)Check if this scope permits the other scope
to_string()String representation

Scope format: namespace:resource:action — wildcards (*) match any segment.

MethodDescription
new(dats)Create a chain from ordered DATs
validate()Verify signatures, scope narrowing, timing

MethodDescription
new(agent_did)Create empty log for an agent
verify_integrity()Verify hash chain integrity
len() / lengthNumber of entries
last_hash()Hash of most recent entry
next_sequence()Next sequence number
to_json()Serialize to JSON

VariantDescription
L0Self-declared — no external verification
L1Domain-verified — DNS TXT record confirms control
L2Organisation-verified — third-party attestation of org identity
L3Third-party attested — independent security audit
L4Continuously monitored — real-time compliance and behavioural monitoring
MethodDescription
meets_minimum(required)Check if this level >= required
descriptionHuman-readable description

VariantDescription
Crypto(String)Key generation, signing, or verification failure
Aid(String)DID parsing, document validation error
Dat(String)Token issuance, verification, or scope error
Receipt(String)Receipt creation or chain integrity error
Trust(String)Trust level parsing or comparison error
Serialization(String)JSON serialization/deserialization error

FeatureDefaultDescription
defaultYesCore protocol types and Ed25519 cryptography
pyo3/extension-moduleNoPython bindings (used by idprova Python package)
napiNoTypeScript/Node.js bindings (used by @idprova/core)