Skip to main content

Crate attestix

Crate attestix 

Source
Expand description

§attestix

Offline verifier for credentials and delegation chains issued by the Attestix Python core — no Python runtime needed.

It reproduces the Attestix JCS-style canonical form byte-for-byte (see canonicalize). This is not strict RFC 8785: Attestix additionally NFC-normalizes every string value and object key, and collapses whole-number floats to integers. See the canonical-form spec at https://attestix.io/spec/bundle/v1 and the conformance vectors at spec/verify/v1/vectors.json in https://github.com/VibeTensor/attestix.

§Quick start

use attestix::{verify_credential, parse_rfc3339};
use serde_json::Value;

let vc: Value = serde_json::from_str(r#"{ "...": "a full W3C VC JSON" }"#)?;
let now = parse_rfc3339("2026-06-01T00:00:00+00:00")?;
let result = verify_credential(&vc, now)?;
if result.verify() {
    println!("credential is valid");
}

The crate is no_std-friendly for the canonicalization and crypto core (the std default feature only adds std::error::Error and the JSON/JWT helpers).

Structs§

CredentialResult
Structured result of verifying a credential.
DateTime
Re-export of time::OffsetDateTime so downstream crates need not depend on time directly to call verify_credential. A PrimitiveDateTime with a UtcOffset.
DelegationResult
Structured result of verifying a two-link delegation chain.

Enums§

VerifyError
Errors raised while decoding inputs or verifying credentials / delegations.

Constants§

ED25519_MULTICODEC_PREFIX
Multicodec prefix for an Ed25519 public key (ed25519-pub).

Functions§

canonicalize
Produce the Attestix JCS-style canonical UTF-8 bytes for a JSON value.
decode_did_key
Decode a full did:key:z… string into the raw 32-byte Ed25519 public key.
decode_multibase
Decode a z… multibase body (the part after did:key:) into the raw key.
encode_did_key
Encode a raw 32-byte Ed25519 public key as a full did:key:z… string.
encode_multibase
Encode a raw 32-byte Ed25519 public key as the z… multibase body.
parse_rfc3339
Parse an RFC 3339 / ISO 8601 timestamp (e.g. 2026-06-01T00:00:00+00:00) into an OffsetDateTime suitable for verify_credential.
verify_credential
Verify a full W3C VC JSON object against the wall-clock time now.
verify_delegation_chain
Verify a parent→child delegation chain.