Bulletproofs
To prove correct mixing of confidential assets, the Zei library makes use of Bulletproofs. The protocol here follows a modular design. We first present the shuffle gadget and RHS-merge-or-not gadget as well as some helper functions, and then we describe how to construct the mixing protocol.
- :
- This gadget enforces thatis a result of shuffling from, where the amount and the asset type are being shuffled together, and each vector has length.
- Obtain two random challengesfrom the Bulletproofs R1CS interface. Note that Bulletproofs R1CS interface allows the program to pull random challenges in the middle.
- Compute a random linear combination for.
- .
- .
- Enforce.
- :
- This gadget enforces thatis obtained by doing \emph{optional} RHS merging overwhen the asset types of the two consecutive ones are the same. Each vector has length.
- Copyand. We will be working over these two temporary vectors.
- For,
- If, then a merge is \emph{permitted}. Otherwise, a merge is prohibited.
- If a merge is permitted and, then the merge happens, we updateand,
-
-
- Otherwise, the merge does not happen, we do not updateand.
- Requireand.
- :
- Require.
- Appendto the end ofandto the end of, until their length reaches.
- :
- For:
- Ask the prover for two bits,. An honest prover is expected to letbe the-th bit ofand let.
- Requireand.
- Require.
The entire Bulletproofs-based mixing protocol is as follows:
- :
- Ask the prover to provide a shuffled version ofand. An honest prover is expected to sort the entries in each vector in a way that the entries for the same asset type are consecutive to each other. There is no particular requirement on the order of this sorting.
- Letandbe the vectors that the prover provides.
- Invoke the shuffle gadget:
-
-
- Ask the prover to provide a merged version ofand. An honest prover is expected to perform RHS merging whenever possible.
- Letandbe the vectors that the prover provides.
- Invoke the RHS merging-or-not gadget:
-
-
- Requireand.
- Let.
- Compute the padded vectors by invoking the pad gadget:
-
-
- Invoke the shuffle gadget that the padded vectors are equivalent:
-
- For:
- Invoke the range-check gadget:.
To prove that a pair of Pedersen commitments are committing a valid amount in confidential payments, the Zei library makes use of Bulletproofs.
This is a proof of knowledge, since a Pedersen commitment could be committing any number. What is being shown in this proof is that a prover knows a binding that can interpret a Pedersen commitment with a specific valid number that the prover knows. Assuming that the discrete log problem is hard and the CRS is secure, it is sufficient for confidential payments.
We omit a detailed description, as it simply invokes the proving and verifying algorithms for range checks in the Bulletproofs library that the Zei library depends on.
Last modified 4mo ago