tari-project / tari

The Tari protocol
https://tari.com
BSD 3-Clause "New" or "Revised" License
347 stars 215 forks source link

feat: commitment proofs #6348

Closed AaronFeickert closed 1 month ago

AaronFeickert commented 4 months ago

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:

github-actions[bot] commented 4 months ago

Test Results (CI)

    3 files    120 suites   38m 43s :stopwatch: 1 280 tests 1 280 :white_check_mark: 0 :zzz: 0 :x: 3 832 runs  3 832 :white_check_mark: 0 :zzz: 0 :x:

Results for commit 1530f1a2.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 4 months ago

Test Results (Integration tests)

 2 files  11 suites   22m 58s :stopwatch: 33 tests 32 :white_check_mark: 0 :zzz: 1 :x: 34 runs  33 :white_check_mark: 0 :zzz: 1 :x:

For more details on these failures, see this check.

Results for commit 1530f1a2.

AaronFeickert commented 1 month ago

This is very out of date. Closing in favor of a fresh PR to avoid rebase headaches.