Skip to main content
Version: v3.x

Minimal Anti Collusion Infrastructure (MACI) / VerifyingKey

Class: VerifyingKey

Defined in: verifyingKey.ts:8

Notice​

A TS Class representing a zk-SNARK VerifyingKey

Constructors​

Constructor​

new VerifyingKey(alpha1, beta2, gamma2, delta2, ic): VerifyingKey

Defined in: verifyingKey.ts:27

Generate a new VerifyingKey

Parameters​

alpha1​

G1Point

the alpha1 point

beta2​

G2Point

the beta2 point

gamma2​

G2Point

the gamma2 point

delta2​

G2Point

the delta2 point

ic​

G1Point[]

the ic points

Returns​

VerifyingKey

Properties​

alpha1​

alpha1: G1Point

Defined in: verifyingKey.ts:9


beta2​

beta2: G2Point

Defined in: verifyingKey.ts:11


delta2​

delta2: G2Point

Defined in: verifyingKey.ts:15


gamma2​

gamma2: G2Point

Defined in: verifyingKey.ts:13


ic​

ic: G1Point[]

Defined in: verifyingKey.ts:17

Methods​

asContractParam()​

asContractParam(): IVerifyingKeyContractParams

Defined in: verifyingKey.ts:40

Return this as an object which can be passed to the smart contract

Returns​

IVerifyingKeyContractParams

the object representation of this


copy()​

copy(): VerifyingKey

Defined in: verifyingKey.ts:94

Produce a copy of this verifying key

Returns​

VerifyingKey

the copy


equals()​

equals(verifyingKey): boolean

Defined in: verifyingKey.ts:73

Check whether this is equal to another verifying key

Parameters​

verifyingKey​

VerifyingKey

the other verifying key

Returns​

boolean

whether this is equal to the other verifying key


fromContract()​

static fromContract(data): VerifyingKey

Defined in: verifyingKey.ts:55

Create a new verifying key from a contract representation of the verifying key

Parameters​

data​

IVerifyingKeyContractParams

the object representation

Returns​

VerifyingKey

a new VerifyingKey


fromJSON()​

static fromJSON(json): VerifyingKey

Defined in: verifyingKey.ts:115

Deserialize into a VerifyingKey instance

Parameters​

json​

string

the JSON representation

Returns​

VerifyingKey

the VerifyingKey


fromObj()​

static fromObj(data): VerifyingKey

Defined in: verifyingKey.ts:125

Convert an object representation to a VerifyingKey

Parameters​

data​

IVerifyingKeyObjectParams

the object representation

Returns​

VerifyingKey

the VerifyingKey