Implement confidential payment settlement using Pedersen commitments - #565
Merged
Kingsman-99 merged 1 commit intoJul 30, 2026
Conversation
Payers can now hide payment amounts on-chain with a real elliptic-curve
Pedersen commitment C = value*G + blinding*H over BLS12-381 G1:
- initialize() derives two independent, nothing-up-my-sleeve generators
G and H via hash-to-curve and pins them in instance storage.
- pay() gains an optional `commitment: Option<BytesN<32>>` -- when set,
the contract stores a digest of the commitment instead of moving any
funds or touching the invoice total, so nothing is revealed at pay time.
- reveal_confidential_payment(invoice_id, payer, value, blinding) recomputes
the commitment from the opening and checks it against the stored digest;
on success it pulls the real amount from the payer and credits the
invoice (only now does the amount become visible on-chain). Named
differently from the existing hash-based reveal_payment to avoid
colliding with that unrelated, previously shipped feature.
- Emits ConfidentialPaymentRevealed { payer, event_seq } with no amount.
- Tampered value/blinding and double-reveal all rejected; tests cover
commit->reveal, both tamper cases, double-reveal, and double-commit.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZRyq9VXnCuCqKLUW4QLdj
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Payers can now hide payment amounts on-chain with a real elliptic-curve Pedersen commitment C = valueG + blindingH over BLS12-381 G1:
commitment: Option<BytesN<32>>-- when set, the contract stores a digest of the commitment instead of moving any funds or touching the invoice total, so nothing is revealed at pay time.Closes Implement confidential payment settlement using Pedersen commitments #352