lazarus-receipts 1.0.2

Lazarus Receipts SDK - Cryptographic receipt verification
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented1 out of 9 items with examples
  • Size
  • Source code size: 17.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.76 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • 805-ai

lazarus-receipts

Rust SDK for Lazarus Receipts verification.

Installation

[dependencies]
lazarus-receipts = "1.0"

Quick Start

use lazarus_receipts::{hash256, verify_merkle_proof_directional, ProofNode};

// Build leaves
let leaf_a = hash256(b"leaf_a");
let leaf_b = hash256(b"leaf_b");

// Build root: H(leaf_a || leaf_b)
let mut combined = Vec::new();
combined.extend_from_slice(&leaf_a);
combined.extend_from_slice(&leaf_b);
let root = hash256(&combined);

// Proof for leaf_a: sibling (leaf_b) is on RIGHT
let proof = vec![ProofNode { side: 'R', hash: leaf_b }];

assert!(verify_merkle_proof_directional(leaf_a, root, &proof));

API

hash256(data: &[u8]) -> [u8; 32]

SHA-256 hash.

receipt_hash_from_json_bytes(bytes: &[u8]) -> [u8; 32]

Hash receipt JSON bytes (placeholder until canonicalization lands).

verify_merkle_proof_directional(leaf, root, proof) -> bool

Verifies a Merkle proof using positional v1.0.1 rule:

  • L: cur = H(sibling || cur)
  • R: cur = H(cur || sibling)

verify_merkle_proof_legacy_sorted(leaf, root, siblings) -> bool

Legacy sorted-pair verification (NOT auditor-grade). Deprecated.

License

Apache 2.0