Skip to main content

BaseMerkleWitness

The BaseMerkleWitness class defines a circuit-compatible base class for Merkle Witness'.

Extends

  • CircuitValue

Constructors

new BaseMerkleWitness()

new BaseMerkleWitness(witness: Witness): BaseMerkleWitness

Takes a Witness and turns it into a circuit-compatible Witness.

Parameters

witness: Witness

Witness.

Returns

BaseMerkleWitness

A circuit-compatible Witness.

Overrides

CircuitValue.constructor

Source

lib/provable/merkle-tree.ts:167

Properties

isLeft

isLeft: Bool[];

Source

lib/provable/merkle-tree.ts:157


path

path: Field[];

Source

lib/provable/merkle-tree.ts:156


height

static height: number;

Source

lib/provable/merkle-tree.ts:155

Methods

assertEquals()

assertEquals(x: this): void

Parameters

x: this

Returns

void

Inherited from

CircuitValue.assertEquals

Source

lib/provable/types/circuit-value.ts:130


calculateIndex()

calculateIndex(): Field

Calculates the index of the leaf node that belongs to this Witness.

Returns

Field

Index of the leaf.

Source

lib/provable/merkle-tree.ts:201


calculateRoot()

calculateRoot(leaf: Field): Field

Calculates a root depending on the leaf value.

Parameters

leaf: Field

Value of the leaf node that belongs to this Witness.

Returns

Field

The calculated root.

Source

lib/provable/merkle-tree.ts:184


equals()

equals(x: this): Bool

Parameters

x: this

Returns

Bool

Inherited from

CircuitValue.equals

Source

lib/provable/types/circuit-value.ts:126


height()

height(): number

Returns

number

Source

lib/provable/merkle-tree.ts:158


isConstant()

isConstant(): boolean

Returns

boolean

Inherited from

CircuitValue.isConstant

Source

lib/provable/types/circuit-value.ts:134


toConstant()

toConstant(): this

Returns

this

Inherited from

CircuitValue.toConstant

Source

lib/provable/types/circuit-value.ts:122


toFields()

toFields(): Field[]

Returns

Field[]

Inherited from

CircuitValue.toFields

Source

lib/provable/types/circuit-value.ts:85


toJSON()

toJSON(): any

Returns

any

Inherited from

CircuitValue.toJSON

Source

lib/provable/types/circuit-value.ts:118


check()

static check<T>(this: T, v: InstanceType<T>): void

Type parameters

T extends AnyConstructor

Parameters

this: T

v: InstanceType\<T>

Returns

void

Inherited from

CircuitValue.check

Source

lib/provable/types/circuit-value.ts:163


empty()

static empty<T>(): InstanceType<T>

Type parameters

T extends AnyConstructor

Returns

InstanceType\<T>

Inherited from

CircuitValue.empty

Source

lib/provable/types/circuit-value.ts:218


fromFields()

static fromFields<T>(this: T, xs: Field[]): InstanceType<T>

Type parameters

T extends AnyConstructor

Parameters

this: T

xs: Field[]

Returns

InstanceType\<T>

Inherited from

CircuitValue.fromFields

Source

lib/provable/types/circuit-value.ts:138


fromJSON()

static fromJSON<T>(this: T, value: any): InstanceType<T>

Type parameters

T extends AnyConstructor

Parameters

this: T

value: any

Returns

InstanceType\<T>

Inherited from

CircuitValue.fromJSON

Source

lib/provable/types/circuit-value.ts:196


fromObject()

static fromObject<T>(this: T, value: NonMethods<InstanceType<T>>): InstanceType<T>

Type parameters

T extends AnyConstructor

Parameters

this: T

value: NonMethods\<InstanceType\<T>>

Returns

InstanceType\<T>

Inherited from

CircuitValue.fromObject

Source

lib/provable/types/circuit-value.ts:30


fromValue()

static fromValue<T>(this: T, value: any): InstanceType<T>

Type parameters

T extends AnyConstructor

Parameters

this: T

value: any

Returns

InstanceType\<T>

Inherited from

CircuitValue.fromValue

Source

lib/provable/types/circuit-value.ts:98


sizeInFields()

static sizeInFields(): number

Returns

number

Inherited from

CircuitValue.sizeInFields

Source

lib/provable/types/circuit-value.ts:37


toAuxiliary()

static toAuxiliary(): []

Returns

[]

Inherited from

CircuitValue.toAuxiliary

Source

lib/provable/types/circuit-value.ts:59


toConstant()

static toConstant<T>(this: T, t: InstanceType<T>): InstanceType<T>

Type parameters

T extends AnyConstructor

Parameters

this: T

t: InstanceType\<T>

Returns

InstanceType\<T>

Inherited from

CircuitValue.toConstant

Source

lib/provable/types/circuit-value.ts:177


toFields()

static toFields<T>(this: T, v: InstanceType<T>): Field[]

Type parameters

T extends AnyConstructor

Parameters

this: T

v: InstanceType\<T>

Returns

Field[]

Inherited from

CircuitValue.toFields

Source

lib/provable/types/circuit-value.ts:42


toInput()

static toInput<T>(this: T, v: InstanceType<T>): HashInput

Type parameters

T extends AnyConstructor

Parameters

this: T

v: InstanceType\<T>

Returns

HashInput

Inherited from

CircuitValue.toInput

Source

lib/provable/types/circuit-value.ts:63


toJSON()

static toJSON<T>(this: T, v: InstanceType<T>): any

Type parameters

T extends AnyConstructor

Parameters

this: T

v: InstanceType\<T>

Returns

any

Inherited from

CircuitValue.toJSON

Source

lib/provable/types/circuit-value.ts:185


toValue()

static toValue<T>(this: T, v: InstanceType<T>): any

Type parameters

T extends AnyConstructor

Parameters

this: T

v: InstanceType\<T>

Returns

any

Inherited from

CircuitValue.toValue

Source

lib/provable/types/circuit-value.ts:89