Skip to main content

OffchainStateCommitments

Commitments that keep track of the current state of an offchain Merkle tree constructed from actions. Intended to be stored on-chain.

Fields:

  • root: The root of the current Merkle tree
  • actionState: The hash pointing to the list of actions that have been applied to form the current Merkle tree

Extends

  • OffchainStateCommitments

Constructors

new OffchainStateCommitments()

new OffchainStateCommitments(value: {
"actionState": Field;
"root": Field;
}): OffchainStateCommitments

Parameters

value

value.actionState: Field= Field

value.root: Field= Field

Returns

OffchainStateCommitments

Inherited from

OffchainState_.OffchainStateCommitments.constructor

Source

lib/provable/types/struct.ts:144

Properties

actionState

actionState: Field = Field;

Inherited from

OffchainState_.OffchainStateCommitments.actionState

Source

lib/mina/actions/offchain-state-rollup.ts:44


root

root: Field = Field;

Inherited from

OffchainState_.OffchainStateCommitments.root

Source

lib/mina/actions/offchain-state-rollup.ts:41


_isStruct

static _isStruct: true;

Inherited from

OffchainState_.OffchainStateCommitments._isStruct

Source

lib/provable/types/struct.ts:144


check()

static check: (value: {
"actionState": Field;
"root": 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.actionState: Field= Field

value.root: Field= Field

Returns

void

Inherited from

OffchainState_.OffchainStateCommitments.check

Source

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


fromFields()

static fromFields: (fields: Field[]) => {
"actionState": Field;
"root": Field;
};

Parameters

fields: Field[]

Returns

{
"actionState": Field;
"root": Field;
}
actionState
actionState: Field = Field;
root
root: Field = Field;

Inherited from

OffchainState_.OffchainStateCommitments.fromFields

Source

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


fromJSON()

static fromJSON: (x: {
"actionState": Field;
"root": Field;
}) => {
"actionState": Field;
"root": Field;
};

Parameters

x

x.actionState: string= Field

x.root: string= Field

Returns

{
"actionState": Field;
"root": Field;
}
actionState
actionState: Field = Field;
root
root: Field = Field;

Inherited from

OffchainState_.OffchainStateCommitments.fromJSON

Source

lib/provable/types/struct.ts:153


fromValue

static fromValue: (x: {
"actionState": Field;
"root": Field;
} | {
"actionState": Field;
"root": Field;
}) => {
"actionState": Field;
"root": Field;
} & (value: {
"actionState": Field;
"root": Field;
}) => {
"actionState": Field;
"root": Field;
};

Convert provable type from a normal JS type.

Inherited from

OffchainState_.OffchainStateCommitments.fromValue

Source

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


toAuxiliary()

static toAuxiliary: (value?: {
"actionState": Field;
"root": 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.actionState?: Field= Field

value.root?: Field= Field

Returns

any[]

Inherited from

OffchainState_.OffchainStateCommitments.toAuxiliary

Source

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


toFields()

static toFields: (value: {
"actionState": Field;
"root": 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.actionState: Field= Field

value.root: Field= Field

Returns

Field[]

Inherited from

OffchainState_.OffchainStateCommitments.toFields

Source

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


toInput()

static toInput: (x: {
"actionState": Field;
"root": Field;
}) => {
"fields": Field[];
"packed": [Field, number][];
};

Parameters

x

x.actionState: Field= Field

x.root: Field= Field

Returns

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

Inherited from

OffchainState_.OffchainStateCommitments.toInput

Source

lib/provable/types/struct.ts:148


toJSON()

static toJSON: (x: {
"actionState": Field;
"root": Field;
}) => {
"actionState": Field;
"root": Field;
};

Parameters

x

x.actionState: Field= Field

x.root: Field= Field

Returns

{
"actionState": Field;
"root": Field;
}
actionState
actionState: string = Field;
root
root: string = Field;

Inherited from

OffchainState_.OffchainStateCommitments.toJSON

Source

lib/provable/types/struct.ts:152


toValue()

static toValue: (x: {
"actionState": Field;
"root": Field;
}) => {
"actionState": Field;
"root": Field;
};

Convert provable type to a normal JS type.

Parameters

x

x.actionState: Field= Field

x.root: Field= Field

Returns

{
"actionState": Field;
"root": Field;
}
actionState
actionState: bigint = Field;
root
root: bigint = Field;

Inherited from

OffchainState_.OffchainStateCommitments.toValue

Source

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

Methods

empty()

static empty(): OffchainStateCommitments

Returns

OffchainStateCommitments

Inherited from

OffchainState_.OffchainStateCommitments.empty

Source

lib/mina/actions/offchain-state-rollup.ts:46


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

OffchainState_.OffchainStateCommitments.sizeInFields

Source

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