Skip to main content

@midnight-ntwrk/compact-runtime v0.6.13Readme | API


@midnight-ntwrk/compact-runtime v0.6.13 / persistentCommit

Function: persistentCommit()

persistentCommit<a>(
rt_type,
value,
opening): Uint8Array

The Compact builtin persistent_commit function

This function is a non-circuit-optimised commitment function from arbitrary values representable in Compact, and a 256-bit bytestring opening, to a 256-bit bytestring. It is guaranteed to persist between upgrades, with the exception of devnet, where this function is provided, but mocked using transientCommit. It should be used to derive state data, and not for consistency checks where avoidable.

Type parameters

a

Parameters

rt_type: CompactType<a>

value: a

opening: Uint8Array

Returns

Uint8Array

Throws

If opening are not 32 bytes long