Skip to main content
Version: dev

BarretenbergBackend

Implements

Constructors

new BarretenbergBackend(acirCircuit, options)

new BarretenbergBackend(acirCircuit, options): BarretenbergBackend

Parameters

ParameterType
acirCircuitCompiledCircuit
optionsBackendOptions

Returns

BarretenbergBackend

Methods

destroy()

destroy(): Promise<void>

Returns

Promise<void>

Implementation of

Backend.destroy

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

ParameterType
decompressedWitnessUint8Array

Returns

Promise<ProofData>

Implementation of

Backend.generateFinalProof


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

ParameterType
witnessUint8Array

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

ParameterTypeDefault value
proofDataProofDataundefined
numOfPublicInputsnumber0

Returns

Promise<object>

Implementation of

Backend.generateIntermediateProofArtifacts

Example

const artifacts = await backend.generateIntermediateProofArtifacts(proof, numOfPublicInputs);

verifyFinalProof()

verifyFinalProof(proofData): Promise<boolean>

Parameters

ParameterType
proofDataProofData

Returns

Promise<boolean>

Implementation of

Backend.verifyFinalProof

Description

Verifies a final proof


verifyIntermediateProof()

verifyIntermediateProof(proofData): Promise<boolean>

Parameters

ParameterType
proofDataProofData

Returns

Promise<boolean>

Implementation of

Backend.verifyIntermediateProof

Example

const isValidIntermediate = await backend.verifyIntermediateProof(proof);

Generated using typedoc-plugin-markdown and TypeDoc