# Collaborative zk-SNARKs --- Problem: zk-SNARKs do not work on distributed secrets --- ![Screenshot 2024-05-06 at 09.09.03](https://hackmd.io/_uploads/Hy3Gf-8fR.png) --- ![Screenshot 2024-05-06 at 10.16.39](https://hackmd.io/_uploads/SJweMzUzA.png) --- co-SNARKs and Publicly Auditable MPC (PA-MPC) are *almost* the same thing. The first solves the following problem: *generating a proof when the secret data is distributed among multiple parties* The second solves the following problem: *Output generated by a MPC protocol are not verifiable by a party that wasn't involved into the MPC (third-party verifiability)* --- ### t zero knowledge ![Screenshot 2024-05-06 at 10.21.02](https://hackmd.io/_uploads/Bkjl7GUf0.png) --- ### Implementation The paper defines the implementation of co-SNARKs with Elliptic-curve and pairing based zk-SNARKs constructions such as: - Groth16 - Marlin (KZG) - Plonk (KZG) --- ### Constraint Defintion co-SNARKs work with R1CS relations to define arithmetic constraints inside the circuit. Computation -> Arithmetic Circuits -> R1CS constraints. In order to support the MPC protocol, co-SNARKs work with secret shares of the witness to be fed into the R1CS. In particular, we assume that at the beginning of the protocol the witness $w$ is secret shared among the parties $[w]$. --- ### Approaches to PA-MPC --- **Approach #1**: Snarkify the MPC ![Screenshot 2024-05-06 at 16.33.44](https://hackmd.io/_uploads/Byr8cw8f0.png) --- **Approach #2**: MPC the Prover ![Screenshot 2024-05-06 at 16.34.30](https://hackmd.io/_uploads/BJXKqP8M0.png) --- Paper goes for Approach #2 --- ![Screenshot 2024-05-06 at 09.15.53](https://hackmd.io/_uploads/ByLnX-Lf0.png) --- The goal of the paper is to define techniques that are able to achieve this composition between two protocols without incurring into a 1M times slowdown. Schemes used are: - SPDZ - authenticated additive shares - malicious and dishonest majority - GSZ - shamir shares - passive (honest-but-curious) and honest majority --- ![Screenshot 2024-05-06 at 11.21.00](https://hackmd.io/_uploads/H1EzWXIMA.png) --- Do not support the property of *guaranteed output delivery*. Therefore we are gonna assume that all the $N$ parties joining the protocol as provers do want to generate the proof and therefore dropping off the protocol is against their interest. --- ### Bottlenecks "Traditional" zk prover bottlenecks: - Elliptic curve operations - Fourier Transforms - Polynomial Commitments --- ### Bottlenecks MPC bottlenecks: - Polynomial Division - Sequence of products (typical to PLONK) - Merkle Tree evaluations and hashing (for hashing-based SNARKs) --- ### Elliptic Curve Operations - Naive A naive approach to perform EC operations inside MPC would be to define a point on the curve as a set of $x, y$ coordinates. This approach is not efficient because the EC addition formula involves a lot of multiplications in the field, which is not good in MPC! --- ### Elliptic Curve Operations - Efficient The second option is to share the points themselves using an EC additive secret sharing. ![Screenshot 2024-05-06 at 11.37.04](https://hackmd.io/_uploads/r1pTN78G0.png) Now elliptic curve addition (and scalar multiplication) become a linear operation that can be performed locally with no-cost and no-communication between the parties. --- ### KZG Commitments Each party locally commits to their individual share of the polynomial to be committed. The results can be interpreted as shares of the desired polynomial commitment. Given that such polynomial commitment it is required to be public, the polynomial commitment can be recovered starting from the shares of the parties. --- ### Performance --- ![Screenshot 2024-05-06 at 12.17.06](https://hackmd.io/_uploads/SkCmCXIGC.png) --- ![Screenshot 2024-05-06 at 12.20.26](https://hackmd.io/_uploads/S1tgkNIf0.png) --- ![Screenshot 2024-05-06 at 12.37.33](https://hackmd.io/_uploads/rJpgm48GR.png) --- ![Screenshot 2024-05-06 at 12.41.45](https://hackmd.io/_uploads/BJYeNNUfC.png) --- ## Conclusions - Collaborative snarks suits better for elliptic curve based SNARK rather than hashing based SNARKs because performing hashing is an highly non-linear computation that is not efficient inside a MPC - Wrapping ZKP inside MPC makes more sense as a general approach rather than the opposite - In particular, the performance shows a 1x/2x slowdown between the single player proof generation and the multi-party proof generation. This is due to optimization techniques that transformed many of the main zkp bottlenecks into linear operations that are really efficient to translate into MPC. --- ### Followups - [ ] Compare it to other publicly verifiable MPC protocols such as https://eprint.iacr.org/2014/075.pdf - [ ] How to write a circuit with Co-SNARKs? - [ ] Does it support the offline phase too?
{"title":"Collaborative zk-SNARKs","description":"Short intro video","contributors":"[{\"id\":\"6fc8cf86-6443-4cf4-9910-5b710ec4704d\",\"add\":12209,\"del\":7363}]"}
    415 views