Skip to content

Implement confidential payment settlement using Pedersen commitments - #565

Merged
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
edwarddavid929-png:feat/pedersen-confidential-settlement
Jul 30, 2026
Merged

Implement confidential payment settlement using Pedersen commitments#565
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
edwarddavid929-png:feat/pedersen-confidential-settlement

Conversation

@edwarddavid929-png

Copy link
Copy Markdown
Contributor

Payers can now hide payment amounts on-chain with a real elliptic-curve Pedersen commitment C = valueG + blindingH 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.
    Closes Implement confidential payment settlement using Pedersen commitments #352

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
@Kingsman-99
Kingsman-99 merged commit e46794d into Stellar-split:main Jul 30, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement confidential payment settlement using Pedersen commitments

2 participants