Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: commitment proofs #6348

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

AaronFeickert
Copy link
Collaborator

@AaronFeickert AaronFeickert commented May 20, 2024

Description

Adds commitment proofs to the wallet.

Closes #6282.

Motivation and Context

It may be useful to assert knowledge of the opening of a commitment, and that it binds to at least a given value. Both can be accomplished through the use of a range proof, since the Bulletproofs+ range proving API supports the use of minimum value promises.

This PR adds a CreateCommitmentProof wallet command that produces such a proof. It accepts as arguments a commitment, message, and optional minimum value; and outputs a hex-encoded proof that binds to these arguments. The proof can be verified using the corresponding VerifyCommitmentProof wallet command. Both commands check that the commitment is unspent.

How Has This Been Tested?

Tests are still in progress.

What process can a PR reviewer use to test or verify this change?

Confirm that the proof is constructed and verified correctly using the range proving API.

Manually test:

  • that a valid proof verifies against the correct commitment, message, and minimum value
  • that a valid proof fails to verify against a different commitment
  • that a valid proof fails to verify against a different message
  • that a valid proof fails against a different minimum value
  • that an invalid proof (for example, a truncated or random hex value) fails to verify
  • that a proof cannot be created against a spent commitment
  • that a proof fails to verify against a spent commitment

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels May 20, 2024
Copy link

github-actions bot commented May 20, 2024

Test Results (CI)

    3 files    120 suites   38m 43s ⏱️
1 280 tests 1 280 ✅ 0 💤 0 ❌
3 832 runs  3 832 ✅ 0 💤 0 ❌

Results for commit 1530f1a.

♻️ This comment has been updated with latest results.

@AaronFeickert AaronFeickert force-pushed the commitment-proof branch 2 times, most recently from 6cbf208 to f04690e Compare May 20, 2024 16:46
Copy link

Test Results (Integration tests)

 2 files  11 suites   22m 58s ⏱️
33 tests 32 ✅ 0 💤 1 ❌
34 runs  33 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 1530f1a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add commitment opening proofs
2 participants