dalek-cryptography / bulletproofs

A pure-Rust implementation of Bulletproofs using Ristretto.
MIT License
1.02k stars 216 forks source link

Updated: Bulletproof rewinding proposed for a single range proof #335

Open hansieodendaal opened 3 years ago

hansieodendaal commented 3 years ago

This is a proposal to add Bulletproofs rewinding functionality to the Bulletproofs crate as a user option. (updates #329)

We use dalek-cryptography/bulletproofs in our Mimblewimble implementation project and have a need to do wallet recovery from seed values. The proposal for the Bulletproof rewinding scheme is implemented here, in a fork on main, and demonstrated from a user perspective in this test. Note: This proposal is similar to what has been proposed and implemented for Grin, as discussed here.

Three additional parameters are introduced when creating a proof for a value commitment:

The 23 bytes worth of proof message can be any message a user wants to embed within the proof. Internally the two private keys, in combination with the value commitment, are converted into two rewind nonces and two blinding nonces:

rewind_nonce_1 = H( H(pub_key_from_pvt_key(pvt_rewind_key)), value_commitment)
rewind_nonce_2 = H( H(pub_key_from_pvt_key(pvt_blinding_key)), value_commitment)
blinding_nonce_1 = H( H(pvt_rewind_key), value_commitment)
blinding_nonce_2 = H( H(pvt_blinding_key), value_commitment)

With the Party and Dealer's algorithm:

image

  1. a_blinding is replaced by rewind_nonce_1
  2. s_blinding is replaced by XOR(rewind_nonce_2, merge_into_word(value, proof_message))

image

  1. t_1_blinding is replaced by blinding_nonce_1
  2. t_2_blinding is replaced by blinding_nonce_2

Usage:

Notes:

delta1 commented 3 years ago

Hi @cathieyun @isislovecruft @hdevalence - do you have any feedback on this proposal please? We would be very grateful to hear your thoughts 🙏

cathieyun commented 3 years ago

Do you have a proof of security for the updated scheme? Given that in the previous scheme I could find a vulnerability within a few minutes, I am a bit skeptical with this update but don't have the time to dig into it.

hansieodendaal commented 3 years ago

Hi there, no proof of security, no yet anyway, just improved as per your previous comments. The question that remains is if Bulletproofs rewinding is fundamentally flawed or if such a scheme as this can be made into a proper solution.