lazarus-receipts

Crates.iolazarus-receipts
lib.rslazarus-receipts
version1.0.2
created_at2026-01-15 01:15:28.840097+00
updated_at2026-01-15 01:15:28.840097+00
descriptionLazarus Receipts SDK - Cryptographic receipt verification
homepagehttps://github.com/805-ai/lazarus-receipts-rust
repositoryhttps://github.com/805-ai/lazarus-receipts-rust
max_upload_size
id2044298
size17,515
Abraham Man (805-ai)

documentation

https://docs.rs/lazarus-receipts

README

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

Commit count: 0

cargo fmt