Skip to main content

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


Midnight.js API Reference v0.2.5 / @midnight-ntwrk/midnight-js-types / ZKConfigProvider

Class: abstract ZKConfigProvider<K>

A provider for zero-knowledge intermediate representations, prover keys, and verifier keys. All three are used by the ProofProvider to create a proof for a call transaction. The implementation of this provider depends on the runtime environment, since each environment has different conventions for accessing static artifacts.

Extended by

Type parameters

K extends string

The type of the circuit ID used by the provider.

Constructors

new ZKConfigProvider(undefined)

new ZKConfigProvider<K>(): ZKConfigProvider<K>

Returns

ZKConfigProvider<K>

Methods

get()

get(circuitId): Promise<ZKConfig<K>>

Retrieves all zero-knowledge artifacts produced by compactc for the given circuit.

Parameters

circuitId: K

The circuit ID of the artifacts to retrieve.

Returns

Promise<ZKConfig<K>>


getProverKey()

abstract getProverKey(circuitId): Promise<ProverKey>

Retrieves the prover key produced by compactc for the given circuit.

Parameters

circuitId: K

The circuit ID of the prover key to retrieve.

Returns

Promise<ProverKey>


getVerifierKey()

abstract getVerifierKey(circuitId): Promise<VerifierKey>

Retrieves the verifier key produced by compactc for the given circuit.

Parameters

circuitId: K

The circuit ID of the verifier key to retrieve.

Returns

Promise<VerifierKey>


getVerifierKeys()

getVerifierKeys(circuitIds): Promise<[K, VerifierKey][]>

Retrieves the verifier keys produced by compactc for the given circuits.

Parameters

circuitIds: K[]

The circuit IDs of the verifier keys to retrieve.

Returns

Promise<[K, VerifierKey][]>


getZKIR()

abstract getZKIR(circuitId): Promise<ZKIR>

Retrieves the zero-knowledge intermediate representation produced by compactc for the given circuit.

Parameters

circuitId: K

The circuit ID of the ZKIR to retrieve.

Returns

Promise<ZKIR>