Skip to content

Commit 2337fb9

Browse files
Add Bulletproof rewind functionality
This is closely modelled on Grin's solution, but using two private keys: - Interfaces: - create a rewindable ZK proof with up to 23 bytes additional embedded proof data - extract the value and 23 bytes proof data only - extract the value, blinding factor and 23 bytes proof data - Required: - two rewind nonces, based on two public rewind keys and the value commitment - two blinding nonces, based on the two private rewind keys and the value commitment - Use: - the two rewind nonces are used to extract the value and 23 bytes embedded proof data - the two rewind nonces and two blinding nonces are used to extract the value, blinding factor and 23 bytes embedded proof data
1 parent 464acb7 commit 2337fb9

File tree

6 files changed

+1030
-13
lines changed

6 files changed

+1030
-13
lines changed

src/errors.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ pub enum ProofError {
4545
/// consider its errors to be internal errors.
4646
#[cfg_attr(feature = "std", error("Internal error during proof creation: {0}"))]
4747
ProvingError(MPCError),
48+
/// This error results from trying to rewind a proof with the wrong rewind nonce
49+
#[cfg_attr(
50+
feature = "std",
51+
error("Rewinding the proof failed, invalid commitment extracted")
52+
)]
53+
InvalidCommitmentExtracted,
54+
/// This error results from trying to rewind a proof with an invalid rewind key separator
55+
#[cfg_attr(
56+
feature = "std",
57+
error("Trying to rewind a proof with the wrong rewind key separator")
58+
)]
59+
InvalidRewindKeySeparator,
4860
}
4961

5062
impl From<MPCError> for ProofError {

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ mod notes {
3131
mod errors;
3232
mod generators;
3333
mod inner_product_proof;
34-
mod range_proof;
34+
// TODO: Do not expose `range_proof` publicly
35+
pub mod range_proof;
3536
mod transcript;
3637

3738
pub use crate::errors::ProofError;

0 commit comments

Comments
 (0)