Overview
Add TypeScript helpers for the confidential payment flow — generate a Pedersen commitment for a payment amount, store the blinding factor securely, and build the reveal transaction when the payer is ready to settle.
Requirements
generateCommitment(amount: bigint): { commitment: Buffer, blindingFactor: Buffer } — generates a cryptographic Pedersen commitment
buildRevealTransaction(invoiceId: bigint, value: bigint, blindingFactor: Buffer, payer: string): Transaction — builds the reveal_payment contract call
storeBlindingFactor(invoiceId: bigint, blindingFactor: Buffer): void — encrypts and stores locally (using Web Crypto API)
loadBlindingFactor(invoiceId: bigint): Buffer | null — decrypts and retrieves stored blinding factor
- Use
@noble/curves or @noble/secp256k1 for elliptic curve operations (no heavy dependencies)
- Write tests verifying commitment/reveal roundtrip, tampered value detected, missing blinding factor handled
Acceptance Criteria
Definition of Done
All CI checks must pass before the PR is reviewed.
Overview
Add TypeScript helpers for the confidential payment flow — generate a Pedersen commitment for a payment amount, store the blinding factor securely, and build the reveal transaction when the payer is ready to settle.
Requirements
generateCommitment(amount: bigint): { commitment: Buffer, blindingFactor: Buffer }— generates a cryptographic Pedersen commitmentbuildRevealTransaction(invoiceId: bigint, value: bigint, blindingFactor: Buffer, payer: string): Transaction— builds thereveal_paymentcontract callstoreBlindingFactor(invoiceId: bigint, blindingFactor: Buffer): void— encrypts and stores locally (using Web Crypto API)loadBlindingFactor(invoiceId: bigint): Buffer | null— decrypts and retrieves stored blinding factor@noble/curvesor@noble/secp256k1for elliptic curve operations (no heavy dependencies)Acceptance Criteria
npm testpasses with zero failuresDefinition of Done
All CI checks must pass before the PR is reviewed.