lazarus-receipts
v1.0.2
Published
Lazarus Receipts SDK - Cryptographic receipt verification
Maintainers
Readme
lazarus-receipts
JavaScript/TypeScript SDK for Lazarus Receipts verification.
Installation
npm install lazarus-receiptsQuick Start
import {
verifyMerkleProofDirectional,
hash256,
bytesToHex
} from 'lazarus-receipts';
// Verify a directional Merkle proof (positional_v1_0_1)
const result = verifyMerkleProofDirectional(
leafHashHex,
expectedRootHex,
[
{ side: 'L', hash: sibling1Hex },
{ side: 'R', hash: sibling2Hex }
]
);
if (result.ok) {
console.log('Proof verified!');
} else {
console.error('Verification failed:', result.error);
}API
verifyMerkleProofDirectional(leafHashHex, rootHex, proof)
Verifies a Merkle proof using positional v1.0.1 rule:
L:cur = H(sibling || cur)R:cur = H(cur || sibling)
verifyMerkleProofLegacySorted(leafHashHex, rootHex, siblingHexes)
Legacy sorted-pair verification (NOT auditor-grade). Emits warning.
hash256(data: Buffer)
SHA-256 hash.
receiptHashFromJsonBytes(jsonBytes: Buffer)
Hash receipt JSON bytes (placeholder until canonicalization lands).
License
Apache 2.0
