BarretenbergBackend
Implements
Constructors
new BarretenbergBackend(acirCircuit, options)
new BarretenbergBackend(acirCircuit, options): BarretenbergBackend
Parameters
Parameter | Type |
---|---|
acirCircuit | CompiledCircuit |
options | BackendOptions |
Returns
Methods
destroy()
destroy(): Promise<void>
Returns
Promise
<void
>
Implementation of
Description
Destroys the backend
generateFinalProof()
generateFinalProof(decompressedWitness): Promise<ProofData>
Generate a final proof. This is the proof for the circuit which will verify intermediate proofs and or can be seen as the proof created for regular circuits.
Parameters
Parameter | Type |
---|---|
decompressedWitness | Uint8Array |
Returns
Promise
<ProofData
>
Implementation of
generateIntermediateProof()
generateIntermediateProof(witness): Promise<ProofData>
Generates an intermediate proof. This is the proof that can be verified in another circuit.
This is sometimes referred to as a recursive proof. We avoid this terminology as the only property of this proof that matters is the fact that it is easy to verify in another circuit. We could choose to verify this proof outside of a circuit just as easily.
Parameters
Parameter | Type |
---|---|
witness | Uint8Array |
Returns
Promise
<ProofData
>
Implementation of
Backend
.generateIntermediateProof
Example
const intermediateProof = await backend.generateIntermediateProof(witness);
generateIntermediateProofArtifacts()
generateIntermediateProofArtifacts(proofData, numOfPublicInputs): Promise<object>
Generates artifacts that will be passed to a circuit that will verify this proof.
Instead of passing the proof and verification key as a byte array, we pass them as fields which makes it cheaper to verify in a circuit.
The proof that is passed here will have been created using the generateIntermediateProof
method.
The number of public inputs denotes how many public inputs are in the inner proof.
Parameters
Parameter | Type | Default value |
---|---|---|
proofData | ProofData | undefined |
numOfPublicInputs | number | 0 |
Returns
Promise
<object
>
Implementation of
Backend
.generateIntermediateProofArtifacts
Example
const artifacts = await backend.generateIntermediateProofArtifacts(proof, numOfPublicInputs);
verifyFinalProof()
verifyFinalProof(proofData): Promise<boolean>
Parameters
Parameter | Type |
---|---|
proofData | ProofData |
Returns
Promise
<boolean
>
Implementation of
Description
Verifies a final proof
verifyIntermediateProof()
verifyIntermediateProof(proofData): Promise<boolean>
Parameters
Parameter | Type |
---|---|
proofData | ProofData |
Returns
Promise
<boolean
>
Implementation of
Backend
.verifyIntermediateProof
Example
const isValidIntermediate = await backend.verifyIntermediateProof(proof);
Generated using typedoc-plugin-markdown and TypeDoc