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
A circuit-compatible Witness.
Overrides
CircuitValue.constructor
Source
lib/provable/merkle-tree.ts:187
Properties
isLeft
isLeft: Bool[];
Source
lib/provable/merkle-tree.ts:177
path
path: Field[];
Source
lib/provable/merkle-tree.ts:176
height
static height: number;
Source
lib/provable/merkle-tree.ts:175
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
Index of the leaf.
Source
lib/provable/merkle-tree.ts:221
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
The calculated root.
Source
lib/provable/merkle-tree.ts:204
equals()
equals(x: this): Bool
Parameters
• x: this
Returns
Inherited from
CircuitValue.equals
Source
lib/provable/types/circuit-value.ts:126
height()
height(): number
Returns
number
Source
lib/provable/merkle-tree.ts:178
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:230
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:208
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
toCanonical()
static toCanonical<T>(this: T, value: InstanceType<T>): InstanceType<T>
Type parameters
• T extends AnyConstructor
Parameters
• this: T
• value: InstanceType
\<T
>
Returns
InstanceType
\<T
>
Inherited from
CircuitValue.toCanonical
Source
lib/provable/types/circuit-value.ts:177
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:189
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:197
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