Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
Public Member Functions | List of all members
libzecale::aggregator_gadget< wppT, nverifierT, NumProofs > Class Template Reference

#include <aggregator_gadget.hpp>

Inheritance diagram for libzecale::aggregator_gadget< wppT, nverifierT, NumProofs >:
Inheritance graph
[legend]
Collaboration diagram for libzecale::aggregator_gadget< wppT, nverifierT, NumProofs >:
Collaboration graph
[legend]

Public Member Functions

 aggregator_gadget (libsnark::protoboard< libff::Fr< wppT >> &pb, const verification_key_variable_gadget &vk, const std::array< libsnark::pb_variable_array< libff::Fr< wppT >>, NumProofs > &inputs, const std::array< std::shared_ptr< proof_variable_gadget >, NumProofs > &proofs, const std::array< libsnark::pb_variable< libff::Fr< wppT >>, NumProofs > &proof_results, const std::string &annotation_prefix)
 
void generate_r1cs_constraints ()
 
void generate_r1cs_witness (const std::array< const libsnark::r1cs_primary_input< libff::Fr< npp >> *, NumProofs > &in_extended_proofs)
 

Detailed Description

template<typename wppT, typename nverifierT, size_t NumProofs>
class libzecale::aggregator_gadget< wppT, nverifierT, NumProofs >

Gadget that aggregates a batch of nested proofs, creating a single wrapping proof the validity (or possible invalidity) of each proof in the batch.

A note about fields: A proof (PGHR13 or GROTH16) is made of group elements (G1 or G2 for some pairing) where the group elements belong to E/F_q (for G1) or E/F_q^n (for G2), and n varies depending on the setting. As such, the coordinates of the elements in the proof are defined over the field F_q. This field is referred to as the "base field". Primary inputs however are defined over F_r, referred to as the "scalar field".

In order to aggregate proofs, we require that the base field of the curve used in the nested proof (nppT here) be the scalar field for the wrapping pairing (wppT).

Definition at line 32 of file aggregator_gadget.hpp.

Constructor & Destructor Documentation

◆ aggregator_gadget()

template<typename wppT , typename nverifierT , size_t NumProofs>
libzecale::aggregator_gadget< wppT, nverifierT, NumProofs >::aggregator_gadget ( libsnark::protoboard< libff::Fr< wppT >> &  pb,
const verification_key_variable_gadget &  vk,
const std::array< libsnark::pb_variable_array< libff::Fr< wppT >>, NumProofs > &  inputs,
const std::array< std::shared_ptr< proof_variable_gadget >, NumProofs > &  proofs,
const std::array< libsnark::pb_variable< libff::Fr< wppT >>, NumProofs > &  proof_results,
const std::string &  annotation_prefix 
)

Member Function Documentation

◆ generate_r1cs_constraints()

template<typename wppT , typename nverifierT , size_t NumProofs>
void libzecale::aggregator_gadget< wppT, nverifierT, NumProofs >::generate_r1cs_constraints ( )

◆ generate_r1cs_witness()

template<typename wppT , typename nverifierT , size_t NumProofs>
void libzecale::aggregator_gadget< wppT, nverifierT, NumProofs >::generate_r1cs_witness ( const std::array< const libsnark::r1cs_primary_input< libff::Fr< npp >> *, NumProofs > &  in_extended_proofs)

Set the wppT scalar variables based on the nested verification key, proofs and inputs in nppT.


The documentation for this class was generated from the following file: