Skip to main content

VerificationKey

Extends

  • {"data": String; "hash": Field; }

Constructors

new VerificationKey()

new VerificationKey(value: {
"data": String;
"hash": Field;
}): VerificationKey

Parameters

value

value.data: string= String

value.hash: Field= Field

Returns

VerificationKey

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).constructor

Source

lib/provable/types/struct.ts:145

Properties

data

data: string = String;

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).data

Source

lib/proof-system/zkprogram.ts:645


hash

hash: Field = Field;

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).hash

Source

lib/proof-system/zkprogram.ts:645


_isStruct

static _isStruct: true;

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, })._isStruct

Source

lib/provable/types/struct.ts:145


check()

static check: (value: {
"data": String;
"hash": Field;
}) => void;

Add assertions to the proof to check if value is a valid member of type T. This function does not return anything, instead it creates any number of assertions to prove that value is a valid member of the type T.

For instance, calling check function on the type Bool asserts that the value of the element is either 1 or 0.

Parameters

value

the element of type T to put assertions on.

value.data: string= String

value.hash: Field= Field

Returns

void

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).check

Source

lib/provable/types/provable-intf.ts:66


empty()

static empty: () => {
"data": String;
"hash": Field;
};

Returns

{
"data": String;
"hash": Field;
}
data
data: string = String;
hash
hash: Field = Field;

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).empty

Source

lib/provable/types/struct.ts:155


fromFields()

static fromFields: (fields: Field[], aux: any[]) => {
"data": String;
"hash": Field;
};

A function that returns an element of type T from the given provable and "auxiliary" data.

This function is the reverse operation of calling toFields and toAuxilary methods on an element of type T.

Parameters

fields: Field[]

an array of Field elements describing the provable data of the new T element.

aux: any[]

an array of any type describing the "auxiliary" data of the new T element, optional.

Returns

{
"data": String;
"hash": Field;
}
data
data: string = String;
hash
hash: Field = Field;

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).fromFields

Source

lib/provable/types/provable-intf.ts:49


fromJSON()

static fromJSON: (x: string) => {
"data": String;
"hash": Field;
};

Parameters

x: string

Returns

{
"data": String;
"hash": Field;
}
data
data: string = String;
hash
hash: Field = Field;

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).fromJSON

Source

lib/provable/types/struct.ts:154


fromValue

static fromValue: (x: {
"data": String;
"hash": Field;
} | {
"data": String;
"hash": Field;
}) => {
"data": String;
"hash": Field;
} & (value: {
"data": String;
"hash": Field;
} | {
"data": String;
"hash": Field;
}) => {
"data": String;
"hash": Field;
};

Convert provable type from a normal JS type.

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).fromValue

Source

lib/provable/types/provable-intf.ts:76


toAuxiliary()

static toAuxiliary: (value?: {
"data": String;
"hash": Field;
}) => any[];

A function that takes value (optional), an element of type T, as argument and returns an array of any type that make up the "auxiliary" (non-provable) data of value.

Parameters

value?

the element of type T to generate the auxiliary data array from, optional. If not provided, a default value for auxiliary data is returned.

value.data?: string= String

value.hash?: Field= Field

Returns

any[]

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).toAuxiliary

Source

lib/provable/types/provable-intf.ts:37


toFields()

static toFields: (value: {
"data": String;
"hash": Field;
}) => Field[];

A function that takes value, an element of type T, as argument and returns an array of Field elements that make up the provable data of value.

Parameters

value

the element of type T to generate the Field array from.

value.data: string= String

value.hash: Field= Field

Returns

Field[]

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).toFields

Source

lib/provable/types/provable-intf.ts:26


toInput()

static toInput: (x: {
"data": String;
"hash": Field;
}) => {
"fields": Field[];
"packed": [Field, number][];
};

Parameters

x

x.data: string= String

x.hash: Field= Field

Returns

{
"fields": Field[];
"packed": [Field, number][];
}
fields?
optional fields: Field[];
packed?
optional packed: [Field, number][];

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).toInput

Source

lib/provable/types/struct.ts:149


toJSON()

static toJSON: (x: {
"data": String;
"hash": Field;
}) => string;

Parameters

x

x.data: string= String

x.hash: Field= Field

Returns

string

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).toJSON

Source

lib/provable/types/struct.ts:153


toValue()

static toValue: (x: {
"data": String;
"hash": Field;
}) => {
"data": String;
"hash": Field;
};

Convert provable type to a normal JS type.

Parameters

x

x.data: string= String

x.hash: Field= Field

Returns

{
"data": String;
"hash": Field;
}
data
data: string = String;
hash
hash: bigint = Field;

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).toValue

Source

lib/provable/types/provable-intf.ts:71

Methods

sizeInFields()

static sizeInFields(): number

Return the size of the T type in terms of Field type, as Field is the primitive type.

Returns

number

A number representing the size of the T type in terms of Field type.

Inherited from

Struct({ ...provable({ data: String, hash: Field }), toJSON({ data }: { data: string }) { return data; }, }).sizeInFields

Source

lib/provable/types/provable-intf.ts:56