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) KeyPairKeyPairKeyPairAidBuilderAIDBuilderAidBuilderAid / AID DocumentAIDAidDelegationTokenDATDatScopeScopeScopeTrustLevelTrustLevelTrustLevelReceiptLogReceiptLogReceiptLog— 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.
let kp = KeyPair :: generate () ? ;
let sig = kp . sign ( b " message " );
assert! ( kp . verify ( b " message " , & sig ));
let multibase : String = kp . public_key_multibase ();
let bytes : & [u8; 32 ] = kp . public_key_bytes ();
let kp2 = KeyPair :: from_secret_bytes ( & secret ) ? ;
sig = kp. sign ( b " message " )
assert kp. verify ( b " message " , sig )
kp.public_key_multibase # str
kp.public_key_bytes # bytes (32)
const kp = KeyPair . generate ();
const sig = kp . sign (Buffer . from ( ' message ' ));
kp . verify (Buffer . from ( ' message ' ), sig); // boolean
kp . publicKeyMultibase ; // string
kp . publicKeyBytes ; // Buffer (32)
Hashing functions.
Function Algorithm Output Format hash::blake3(data)BLAKE3 blake3:<hex>hash::sha256(data)SHA-256 sha256:<hex>
Fluent builder for creating Agent Identity Documents.
Method Type Description new()Constructor Create 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 key Add an Ed25519 key build()— Build and validate the AID
Property / Method Return Type Description 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
Method Description 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
Method Description 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.
Method Description new(dats)Create a chain from ordered DATs validate()Verify signatures, scope narrowing, timing
Method Description 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
Variant Description 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
Method Description meets_minimum(required)Check if this level >= required descriptionHuman-readable description
Variant Description 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
Feature Default Description defaultYes Core protocol types and Ed25519 cryptography pyo3/extension-moduleNo Python bindings (used by idprova Python package) napiNo TypeScript/Node.js bindings (used by @idprova/core)