Documentation ¶
Index ¶
Constants ¶
const KeyPathPrefix = "merkleswap"
KeyPathPrefix denotes the file name for Merkle MultiSwap circuits
const TreeDepth = 28
TreeDepth denotes the depth of Merkle in the test circuit.
Variables ¶
This section is empty.
Functions ¶
func LoadVerifyingKey ¶
func LoadVerifyingKey(filepath string) (verifyingKey groth16.VerifyingKey, err error)
LoadVerifyingKey load the verification key from the filepath
func SetupZkMultiswap ¶
func SetupZkMultiswap(size uint32)
SetupZkMultiswap generates the circuit and public/verification keys with Groth16 "keyPathPrefix".pk* are for public keys, "keyPathPrefix".ccs* are for r1cs, "keyPathPrefix".vk,save is for verification keys
func TestMerkleMultiSwap ¶
func TestMerkleMultiSwap(testSetSize uint32)
TestMerkleMultiSwap is temporarily used for test purpose
Types ¶
type Circuit ¶
type Circuit struct { // default uses variable name and secret visibility. TestInputs []frontend.Variable `gnark:",public"` // test values //------------------------------private witness below-------------------------------------- TestOutputs []frontend.Variable // test values }
Circuit is the Merkle tree-based MultiSwap circuit for gnark. gnark is a zk-SNARK library written in Go. Circuits are regular structs. The inputs must be of type frontend.Variable and make up the witness. The Circuit is only used for test purpose to measure the overhead of MerkleSwap
func AssignCircuit ¶
AssignCircuit assign a circuit with UpdateSet32 values.
func InitCircuitWithSize ¶
InitCircuitWithSize init a circuit with challenges, OriginalHashes and CurrentEpochNum value 1, all other values 0. Use for test purpose only.