@midnight-ntwrk/midnight-js-fetch-zk-config-provider v0.1.15 • API
Midnight.js API Reference v0.1.15 / @midnight-ntwrk/midnight-js-fetch-zk-config-provider / FetchZkConfigProvider
Class: FetchZkConfigProvider<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.
Extends
Type parameters
• K extends string
The type of the circuit ID used by the provider.
Constructors
new FetchZkConfigProvider(baseURL, fetchFunc)
new FetchZkConfigProvider<
K
>(baseURL
,fetchFunc
):FetchZkConfigProvider
<K
>
Parameters
• baseURL: string
• fetchFunc= fetch
Returns
Overrides
Properties
baseURL
readonly
baseURL:string
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
>>
Inherited from
getProverKey()
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
>
Overrides
getVerifierKey()
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
>
Overrides
ZKConfigProvider
.getVerifierKey
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
][]>
Inherited from
ZKConfigProvider
.getVerifierKeys
getZKIR()
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
>