| Crates.io | lazarus-receipts |
| lib.rs | lazarus-receipts |
| version | 1.0.2 |
| created_at | 2026-01-15 01:15:28.840097+00 |
| updated_at | 2026-01-15 01:15:28.840097+00 |
| description | Lazarus Receipts SDK - Cryptographic receipt verification |
| homepage | https://github.com/805-ai/lazarus-receipts-rust |
| repository | https://github.com/805-ai/lazarus-receipts-rust |
| max_upload_size | |
| id | 2044298 |
| size | 17,515 |
Rust SDK for Lazarus Receipts verification.
[dependencies]
lazarus-receipts = "1.0"
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));
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) -> boolVerifies 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) -> boolLegacy sorted-pair verification (NOT auditor-grade). Deprecated.
Apache 2.0