Skip to main content

@midnight-ntwrk/midnight-js-contracts v0.2.5 • API


Midnight.js API Reference v0.2.5 / @midnight-ntwrk/midnight-js-contracts / submitInsertVerifierKeyTx

Function: submitInsertVerifierKeyTx()

submitInsertVerifierKeyTx<PSS, PSK>(providers, privateStateKey, contractAddress, circuitId, newVk): Promise<FinalizedTxData>

Constructs and submits a transaction that adds a new verifier key to the blockchain for the given circuit ID at the given contract address.

Type parameters

PSS extends PrivateStateSchema

PSK extends string

Parameters

providers: MidnightProviders<string, PrivateStateSchema>

The providers to use to manage the transaction lifecycle.

privateStateKey: PSK

The private state key for the contract.

contractAddress: string

The address of the contract containing the circuit for which the verifier key should be inserted.

circuitId: string

The circuit for which the verifier key should be inserted.

newVk: VerifierKey

The new verifier key for the circuit.

Returns

Promise<FinalizedTxData>

A promise that resolves with the finalized transaction data, or rejects if an error occurs along the way.

TODO: We'll likely want to modify ZKConfigProvider provider so that the verifier keys are automatically rotated in this function. This likely involves storing key versions along with keys in ZKConfigProvider. By default, artifacts for the latest version would be fetched to build transactions.