@vauban-org/claim-verifier-wasm
v0.1.0
Published
WASM bindings for vauban-claim-verifier forensic verifier (OSS-13)
Downloads
143
Maintainers
Readme
vauban-claim-verifier
Forensic offline verifier for Vauban Claim Algebra (OSS-13).
Zero Vauban infrastructure dependency — auditors, regulators, and design partners can verify claims without any Vauban API access, SDKs, or network connectivity.
What it verifies
A Vauban Claim encodes a verifiable statement in CBOR format per
draft-vauban-claim-algebra-00. This crate checks:
| Check | Description |
|---|---|
| Signature | Ed25519 over canonical CBOR bytes (if public key provided) |
| Anchor inclusion | SHA-256 Merkle proof against a Starknet-anchored batch root |
| Temporal frame | valid-from ≤ now ≤ valid-until, issued-at in the past |
| Evidence structure | Required fields present for the declared evidence scheme |
| Delegation chain | R-1 scope-narrowing invariant (structural check) |
All checks produce a structured VerificationReport with a step-by-step evidence trace.
Usage — Library
use vauban_claim_verifier::{verify_claim_offline, AnchorWitness};
// Offline mode: skip on-chain anchor check (suitable for forensic review)
let claim_cbor: &[u8] = &[/* CBOR bytes from claim.cbor */];
let report = verify_claim_offline(claim_cbor, "draft-vauban-claim-algebra-00")?;
assert!(report.temporal_frame_valid);
println!("{}", serde_json::to_string_pretty(&report)?);With Ed25519 signature verification:
use vauban_claim_verifier::verify_claim_offline_with_pubkey;
let report = verify_claim_offline_with_pubkey(
claim_cbor,
"0xabc123...", // hex-encoded 32-byte Ed25519 public key
"draft-vauban-claim-algebra-00",
)?;With full Merkle anchor witness (on-chain inclusion proof):
use vauban_claim_verifier::{verify_claim_with_anchor, AnchorWitness};
let witness = AnchorWitness::on_chain(
"0xdeadbeef...", // Merkle root (32 bytes hex)
vec!["0xsibling1...", "0xsibling2..."], // Merkle path
3, // leaf index in batch
891_234, // Starknet block number
);
let report = verify_claim_with_anchor(claim_cbor, &witness, None, "draft-vauban-claim-algebra-00")?;Compute claim hash (the Starknet-anchored leaf value):
use vauban_claim_verifier::claim_hash;
let hash = claim_hash(claim_cbor); // "0x<sha256 hex>"Usage — CLI
Requires the cli feature (included by default in the binary release):
# Install
cargo install vauban-claim-verifier --features cli
# Verify a claim file offline
vauban-verify --offline --cbor-file claim.cbor
# Verify with a public key
vauban-verify --offline --cbor-file claim.cbor --pubkey 0xabc123...
# Output as JSON
vauban-verify --offline --cbor-file claim.cbor --output json
# Verify with full Merkle witness
vauban-verify \
--cbor-file claim.cbor \
--merkle-root 0xdeadbeef... \
--merkle-path 0xsibling1...,0xsibling2... \
--leaf-index 3 \
--block-number 891234Features
| Feature | Default | Description |
|---|---|---|
| std | yes | Standard library (SystemTime for timestamps) |
| cli | no | Enable vauban-verify binary (requires std, pulls clap) |
| wasm | no | WebAssembly target (uses js_sys::Date for timestamps) |
No-std is supported with default-features = false (timestamps replaced with "unknown").
Security Properties
#![forbid(unsafe_code)]— no unsafe Rust anywhere in the crate- Zero network calls — offline mode makes no I/O (anchor check is explicitly opt-in)
- Constant-time comparison — Ed25519 verification via
ed25519-dalek(timing-safe) - Panic-free parsing — all CBOR errors return
VerifyError, no panics on malformed input - Dependency-minimal — 6 production dependencies, all audited crates
Design Principles (OSS-13)
This crate implements the OSS-13 deliverable of SNF V2 Work Package 2. The design constraints are:
- Zero Vauban dependency: no
vauban-claim, no Brain API, no Starknet RPC required - Auditor-grade transparency: every check produces a named
EvidenceStepin the report - Apache 2.0 / MIT dual license: usable by any party without copyleft restrictions
- WASM-compatible: browser-based verification for design partner integration
Spec Version Support
| Spec version | Status |
|---|---|
| draft-vauban-claim-algebra-00 | Supported |
| draft-vauban-claim-algebra-01 | Supported |
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
