OffchainStateCommitments
Defined in: index.ts:183
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 treeactionState
: 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;
length: Field;
root: Field;
}): OffchainStateCommitments
Defined in: lib/provable/types/struct.ts:133
Parameters
value
actionState
Field
= Field
length
Field
= Field
root
Field
= Field
Returns
Inherited from
OffchainState_.OffchainStateCommitments.constructor
Properties
actionState
actionState: Field = Field;
Defined in: lib/mina/v1/actions/offchain-state-rollup.ts:45
Inherited from
OffchainState_.OffchainStateCommitments.actionState
length
length: Field = Field;
Defined in: lib/mina/v1/actions/offchain-state-rollup.ts:42
Inherited from
OffchainState_.OffchainStateCommitments.length
root
root: Field = Field;
Defined in: lib/mina/v1/actions/offchain-state-rollup.ts:41
Inherited from
OffchainState_.OffchainStateCommitments.root
_isStruct
static _isStruct: true;
Defined in: lib/provable/types/struct.ts:133
Inherited from
OffchainState_.OffchainStateCommitments._isStruct
check()
static check: (value: {
actionState: Field;
length: Field;
root: Field;
}) => void;
Defined in: lib/provable/types/provable-intf.ts:76
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.
actionState
Field
= Field
length
Field
= Field
root
Field
= Field
Returns
void
Inherited from
OffchainState_.OffchainStateCommitments.check
empty()
static empty: () => {
actionState: Field;
length: Field;
root: Field;
};
Defined in: lib/provable/types/struct.ts:143
Returns
{
actionState: Field;
length: Field;
root: Field;
}
actionState
actionState: Field = Field;
length
length: Field = Field;
root
root: Field = Field;
Inherited from
OffchainState_.OffchainStateCommitments.empty
fromFields()
static fromFields: (fields: Field[]) => {
actionState: Field;
length: Field;
root: Field;
};
Defined in: lib/provable/types/provable-intf.ts:115
Parameters
fields
Field
[]
Returns
{
actionState: Field;
length: Field;
root: Field;
}
actionState
actionState: Field = Field;
length
length: Field = Field;
root
root: Field = Field;
Inherited from
OffchainState_.OffchainStateCommitments.fromFields
fromJSON()
static fromJSON: (x: {
actionState: string;
length: string;
root: string;
}) => {
actionState: Field;
length: Field;
root: Field;
};
Defined in: lib/provable/types/struct.ts:142
Parameters
x
actionState
string
= Field
length
string
= Field
root
string
= Field
Returns
{
actionState: Field;
length: Field;
root: Field;
}
actionState
actionState: Field = Field;
length
length: Field = Field;
root
root: Field = Field;
Inherited from
OffchainState_.OffchainStateCommitments.fromJSON
fromValue
static fromValue: (x:
| {
actionState: Field;
length: Field;
root: Field;
}
| {
actionState: bigint;
length: bigint;
root: bigint;
}) => {
actionState: Field;
length: Field;
root: Field;
} & (value: {
actionState: string | number | bigint | Field;
length: string | number | bigint | Field;
root: string | number | bigint | Field;
}) => {
actionState: Field;
length: Field;
root: Field;
};
Defined in: lib/provable/types/provable-intf.ts:86
Convert provable type from a normal JS type.
Inherited from
OffchainState_.OffchainStateCommitments.fromValue
toAuxiliary()
static toAuxiliary: (value?: {
actionState: Field;
length: Field;
root: Field;
}) => any[];
Defined in: lib/provable/types/provable-intf.ts:47
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.
actionState
Field
= Field
length
Field
= Field
root
Field
= Field
Returns
any
[]
An array of any type describing how this T
element is made up of "auxiliary" (non-provable) data.
Inherited from
OffchainState_.OffchainStateCommitments.toAuxiliary
toCanonical()?
static optional toCanonical: (x: {
actionState: Field;
length: Field;
root: Field;
}) => {
actionState: Field;
length: Field;
root: Field;
};
Defined in: lib/provable/types/provable-intf.ts:104
Optional method which transforms a provable type into its canonical representation.
This is needed for types that have multiple representations of the same underlying value, and might even not have perfect completeness for some of those representations.
An example is the ForeignField
class, which allows non-native field elements to exist in unreduced form.
The unreduced form is not perfectly complete, for example, addition of two unreduced field elements can cause a prover error.
Specific protocols need to be able to protect themselves against incomplete operations at all costs.
For example, when using actions and reducer, the reducer must be able to produce a proof regardless of the input action.
toCanonical()
converts any input into a safe form and enables us to handle cases like this generically.
Note: For most types, this method is the identity function.
The identity function will also be used when the toCanonical()
is not present on a type.
Parameters
x
actionState
Field
= Field
length
Field
= Field
root
Field
= Field
Returns
{
actionState: Field;
length: Field;
root: Field;
}
actionState
actionState: Field = Field;
length
length: Field = Field;
root
root: Field = Field;
Inherited from
OffchainState_.OffchainStateCommitments.toCanonical
toFields()
static toFields: (value: {
actionState: Field;
length: Field;
root: Field;
}) => Field[];
Defined in: lib/provable/types/provable-intf.ts:36
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.
actionState
Field
= Field
length
Field
= Field
root
Field
= Field
Returns
Field
[]
A Field array describing how this T
element is made up of Field elements.
Inherited from
OffchainState_.OffchainStateCommitments.toFields
toInput()
static toInput: (x: {
actionState: Field;
length: Field;
root: Field;
}) => {
fields: Field[];
packed: [Field, number][];
};
Defined in: lib/provable/types/struct.ts:137
Parameters
x
actionState
Field
= Field
length
Field
= Field
root
Field
= Field
Returns
{
fields: Field[];
packed: [Field, number][];
}
fields?
optional fields: Field[];
packed?
optional packed: [Field, number][];
Inherited from
OffchainState_.OffchainStateCommitments.toInput
toJSON()
static toJSON: (x: {
actionState: Field;
length: Field;
root: Field;
}) => {
actionState: string;
length: string;
root: string;
};
Defined in: lib/provable/types/struct.ts:141
Parameters
x
actionState
Field
= Field
length
Field
= Field
root
Field
= Field
Returns
{
actionState: string;
length: string;
root: string;
}
actionState
actionState: string = Field;
length
length: string = Field;
root
root: string = Field;
Inherited from
OffchainState_.OffchainStateCommitments.toJSON
toValue()
static toValue: (x: {
actionState: Field;
length: Field;
root: Field;
}) => {
actionState: bigint;
length: bigint;
root: bigint;
};
Defined in: lib/provable/types/provable-intf.ts:81
Convert provable type to a normal JS type.
Parameters
x
actionState
Field
= Field
length
Field
= Field
root
Field
= Field
Returns
{
actionState: bigint;
length: bigint;
root: bigint;
}
actionState
actionState: bigint = Field;
length
length: bigint = Field;
root
root: bigint = Field;
Inherited from
OffchainState_.OffchainStateCommitments.toValue
Methods
emptyFromHeight()
static emptyFromHeight(height: number): OffchainStateCommitments
Defined in: lib/mina/v1/actions/offchain-state-rollup.ts:47
Parameters
height
number
Returns
OffchainStateCommitments
Inherited from
OffchainState_.OffchainStateCommitments.emptyFromHeight
sizeInFields()
static sizeInFields(): number
Defined in: lib/provable/types/provable-intf.ts:66
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