Skip to main content
Version: v2.0_alpha

VerifyingKey

Notice

A TS Class representing a zk-SNARK VerifyingKey

Table of contents

Constructors

Properties

Methods

Constructors

constructor

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

Generate a new VerifyingKey

Parameters

NameTypeDescription
alpha1G1Pointthe alpha1 point
beta2G2Pointthe beta2 point
gamma2G2Pointthe gamma2 point
delta2G2Pointthe delta2 point
icG1Point[]the ic points

Returns

VerifyingKey

Defined in

verifyingKey.ts:27

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(): IVkContractParams

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

Returns

IVkContractParams

the object representation of this

Defined in

verifyingKey.ts:40


copy

copy(): VerifyingKey

Produce a copy of this verifying key

Returns

VerifyingKey

the copy

Defined in

verifyingKey.ts:94


equals

equals(vk): boolean

Check whether this is equal to another verifying key

Parameters

NameTypeDescription
vkVerifyingKeythe other verifying key

Returns

boolean

whether this is equal to the other verifying key

Defined in

verifyingKey.ts:73


fromContract

fromContract(data): VerifyingKey

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

Parameters

NameTypeDescription
dataIVkContractParamsthe object representation

Returns

VerifyingKey

a new VerifyingKey

Defined in

verifyingKey.ts:55


fromJSON

fromJSON(json): VerifyingKey

Deserialize into a VerifyingKey instance

Parameters

NameTypeDescription
jsonstringthe JSON representation

Returns

VerifyingKey

the VerifyingKey

Defined in

verifyingKey.ts:115


fromObj

fromObj(data): VerifyingKey

Convert an object representation to a VerifyingKey

Parameters

NameTypeDescription
dataIVkObjectParamsthe object representation

Returns

VerifyingKey

the VerifyingKey

Defined in

verifyingKey.ts:125