Description
Hi there,
I would like to know how open the dalek-cryptography/bulletproofs
maintainers and community are to add Bulletproofs rewinding functionality to the crate.
We use dalek-cryptography/bulletproofs
in our project and have a need to do wallet recovery from seed values. I have implemented Bulletproof rewinding in a fork on main that is similar to what other projects have done (e.g. Grin), demonstrated from a user perspective in this test.
The user calls pub fn prove_single_with_rewind_key
instead of pub fn prove_single
, with two additional parameters, pvt_rewind_key: &Scalar
and extra_data: &[u8; 23]
. The 23 bytes extra_data
can be any message a user wants to embed within the proof. Internally, pvt_rewind_key
is converted into a rewind nonce and a private nonce:
rewind_nonce = H( H(pub_key_from_pvt_key(pvt_rewind_key)), commitment)
private_nonce = H( H(pvt_rewind_key), commitment)
With the Party and Dealer's algorithm:
a_blinding
is replaced byrewind_nonce
s_blinding
is replaced byXOR(rewind_nonce, merge_into_word(value, extra_data))
t_1_blinding
is replaced byprivate_nonce
t_2_blinding
is replaced byprivate_nonce
Usage:
- Verifying the proof with
pub fn verify_single
still works exactly as it did before. - The owner and delegated 3rd parties can use
pub fn get_rewind_nonce_from_pub_key
to retrieverewind_nonce
for a specific commitment. - The owner can use
pub fn get_private_nonce_from_pvt_key
to retrieveprivate_nonce
for a specific commitment. - The owner and delegated 3rd parties can use
pub fn rewind_single_get_value_only
to rewind a proof for a given commitment, to get the value and 23 bytesextra_data
only. If the wrongrewind_nonce
is provided, garbage data will be returned. - The owner can use
pub fn rewind_single_get_commitment_data
to rewind the proof for a given commitment, returning the value, blinding factor and 23 bytesextra_data
upon success.
Thank you kindly.