Delegated Schnorr
The Zei library implements a protocol that is specifically used to open Pedersen commitments over Ristretto inside zk-SNARK over BLS12-381. This is a new protocol that has not been documented and studied before.
For now, we call this protocol delegated Schnorr, though we believe that a better name exists. Since this protocol is special-purpose, we feel it helpful to describe the problem that this protocol wants to solve.
Problem: lifting a Pedersen commitment to a Rescue commitment
In Findora, we support two types of privacy payments: confidential payments and anonymous payments.
- Confidential payment: The private tokens are represented by two Pedersen commitments over the Ristretto group, one for the amount, another one for the asset type. We represent the commitment for the amount as where is the amount and is the randomizer, and we represent the commitment for the asset type as where is the asset type and is the randomizer. This confidential payment is therefore able to hide the amount and the asset type, but is unable to hide the sender. The zero-knowledge proof protocol used for confidential payment is Bulletproofs.
- Anonymous payment: The private tokens are represented by a Rescue commitment, which commits the amount, the asset type, and the owner's public key, as well as a randomizer. This Rescue commitment corresponds to, and is invalidated by, a Rescue nullifier, which commits the amount, the asset type, the owner's public key, as well as the owner's private key. This is able to hide the sender and the receiver, the amount, and the asset type, and we sometimes refer to it as ``triple masking''. The Rescue commitment is defined over BLS12-381 curve, and the zero-knowledge proof protocol used for anonymous payment is a five-wire high-degree TurboPlonk.
The problem that we face in production is that, we want to enable the user to transform a confidential token into an anonymous token, and during this transform, we want to keep the amount and asset type hidden. The challenge is that the Pedersen commitments are defined over the Ristretto group, but the Rescue commitments are defined over the BLS12-381 scalar field. Verifying such a Pedersen commitment in zk-SNARK over BLS12-381 requires field simulation. That is, we need to perform the computation for point multiplication over a different field, through the use of field simulation that we describe before.
Problem: field simulations are costly
Naively, the field simulation would require about simulated multiplication steps. Since field simulation is expensive, it would take a significant amount of time for the user, and would not be feasible in production.
In our implementation, we try to reduce the number of field simulations. The approach is that, instead of doing point simulation inside the zk-SNARK, we push the point operations out of zk-SNARK, in which case simulation is not needed, and we permit only a few field simulations inside the zk-SNARK, for the purposes of connecting with the point operations done externally.
This protocol, delegated Schnorr, describes the part that is being pushed out from zk-SNARK from the naive construction. It is an extension of the classical Schnorr protocol, with the additional change that the witness, below, is committed in the protocol under a randomizer , using the Rescue hash function.
Protocol
As follows, we assume that the order of the Ristretto scalar field is , and the order of the BLS12-381 scalar field is . We let and be two generators suitable for Pedersen commitments over the Ristretto group.
:
- Require and .
- Sample .
- Let , , be the limb representations of when these values are represented in field simulation. This gives us limbs in total, where each limb has at most bits.
- Compress these limbs into elements in :
- This step differs from classical Schnorr protocol. Use a Rescue hash function to compute a commitment, using as the randomizer.
- Compute , .
- Put into the cryptographic sponge for Fiat-Shamir transform and squeeze out a random challenge .
- Compute the responses:
- Put into the cryptographic sponge for the Fiat-Shamir transform and squeeze out a random challenge .
- Let .
- Let .
- Output .
:
- Parse .
- Put into the cryptographic sponge for the Fiat-Shamir transform and squeeze out a random challenge .
- Continue by putting into the cryptographic sponge and squeeze out a random challenge .
- Check that .
- Check that .S$
- Output if all the checks pass, and otherwise.