@proto-kit/protocol • Docs
Documentation / @proto-kit/protocol / ProvableHashList
Class: abstract ProvableHashList<Value>
Utilities for creating a hash list from a given value type.
Extended by
Type Parameters
• Value
Constructors
new ProvableHashList()
new ProvableHashList<
Value>(valueType,commitment?,unconstrainedList?):ProvableHashList<Value>
Parameters
• valueType: ProvablePure<Value>
• commitment?: Field
• unconstrainedList?: Unconstrained<ProvableHashListData<Value>[]> = ...
Returns
ProvableHashList<Value>
Defined in
packages/protocol/src/utils/ProvableHashList.ts:28
Properties
commitment
commitment:
Field
Defined in
packages/protocol/src/utils/ProvableHashList.ts:26
valueType
protectedreadonlyvalueType:ProvablePure<Value>
Defined in
packages/protocol/src/utils/ProvableHashList.ts:29
Methods
empty()
abstractprotectedempty():Field
Returns
Field
Defined in
packages/protocol/src/utils/ProvableHashList.ts:38
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
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
Defined in
packages/protocol/src/utils/ProvableHashList.ts:75
getUnconstrainedValues()
getUnconstrainedValues():
Unconstrained<ProvableHashListData<Value>[]>
Returns
Unconstrained<ProvableHashListData<Value>[]>
Defined in
packages/protocol/src/utils/ProvableHashList.ts:140
hash()
abstractprotectedhash(elements):Field
Parameters
• elements: Field[]
Returns
Field
Defined in
packages/protocol/src/utils/ProvableHashList.ts:40
isEmpty()
isEmpty():
Bool
Returns
Bool
Defined in
packages/protocol/src/utils/ProvableHashList.ts:136
push()
push(
value):ProvableHashList<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
ProvableHashList<Value>
Current hash list.
Defined in
packages/protocol/src/utils/ProvableHashList.ts:106
pushIf()
pushIf(
value,condition):ProvableHashList<Value>
Parameters
• value: Value
• condition: Bool
Returns
ProvableHashList<Value>
Defined in
packages/protocol/src/utils/ProvableHashList.ts:117
toField()
toField():
Field
Returns
Field
Traling hash of the current hashlist.
Defined in
packages/protocol/src/utils/ProvableHashList.ts:132
witnessTip()
witnessTip(
preimage,value):Bool
Parameters
• preimage: Field
• value: Value
Returns
Bool