DocsReference@proto-kit/protocolClassesPrefixedProvableHashList

@proto-kit/protocolDocs


Documentation / @proto-kit/protocol / PrefixedProvableHashList

Class: PrefixedProvableHashList<Value>

Utilities for creating a hash list from a given value type.

Extends

Type Parameters

Value

Constructors

new PrefixedProvableHashList()

new PrefixedProvableHashList<Value>(valueType, prefix, internalCommitment): PrefixedProvableHashList<Value>

Parameters

valueType: ProvablePure<Value>

prefix: string

internalCommitment: Field = ...

Returns

PrefixedProvableHashList<Value>

Overrides

ProvableHashList.constructor

Defined in

packages/protocol/src/utils/PrefixedProvableHashList.ts:9

Properties

commitment

commitment: Field

Inherited from

ProvableHashList.commitment

Defined in

packages/protocol/src/utils/ProvableHashList.ts:26


valueType

protected readonly valueType: ProvablePure<Value>

Inherited from

ProvableHashList.valueType

Defined in

packages/protocol/src/utils/ProvableHashList.ts:29

Methods

empty()

empty(): Field

Returns

Field

Overrides

ProvableHashList.empty

Defined in

packages/protocol/src/utils/PrefixedProvableHashList.ts:18


fastForward()

fastForward(transition, message): void

Fast-forwards the state of the hashlist to a specified new tip. This assumes the transition (from -> to) to be already verified somewhere else that is outside this scope.

Parameters

transition: VerifiedTransition<Field>

message: string = "some hashlist"

Returns

void

Inherited from

ProvableHashList.fastForward

Defined in

packages/protocol/src/utils/ProvableHashList.ts:62


fastForwardIf()

fastForwardIf(transition, condition, message): void

Parameters

transition: VerifiedTransition<Field>

condition: Bool

message: string = "some hashlist"

Returns

void

Inherited from

ProvableHashList.fastForwardIf

Defined in

packages/protocol/src/utils/ProvableHashList.ts:75


getUnconstrainedValues()

getUnconstrainedValues(): Unconstrained<ProvableHashListData<Value>[]>

Returns

Unconstrained<ProvableHashListData<Value>[]>

Inherited from

ProvableHashList.getUnconstrainedValues

Defined in

packages/protocol/src/utils/ProvableHashList.ts:140


hash()

protected hash(elements): Field

Parameters

elements: Field[]

Returns

Field

Overrides

ProvableHashList.hash

Defined in

packages/protocol/src/utils/PrefixedProvableHashList.ts:22


isEmpty()

isEmpty(): Bool

Returns

Bool

Inherited from

ProvableHashList.isEmpty

Defined in

packages/protocol/src/utils/ProvableHashList.ts:136


push()

push(value): PrefixedProvableHashList<Value>

Converts the provided value to Field[] and appends it to the current hashlist.

Parameters

value: Value

Value to be appended to the hash list

Returns

PrefixedProvableHashList<Value>

Current hash list.

Inherited from

ProvableHashList.push

Defined in

packages/protocol/src/utils/ProvableHashList.ts:106


pushIf()

pushIf(value, condition): PrefixedProvableHashList<Value>

Parameters

value: Value

condition: Bool

Returns

PrefixedProvableHashList<Value>

Inherited from

ProvableHashList.pushIf

Defined in

packages/protocol/src/utils/ProvableHashList.ts:117


toField()

toField(): Field

Returns

Field

Traling hash of the current hashlist.

Inherited from

ProvableHashList.toField

Defined in

packages/protocol/src/utils/ProvableHashList.ts:132


witnessTip()

witnessTip(preimage, value): Bool

Parameters

preimage: Field

value: Value

Returns

Bool

Inherited from

ProvableHashList.witnessTip

Defined in

packages/protocol/src/utils/ProvableHashList.ts:93