Skip to main content
Version: dev

BarretenbergBackend

Implements

Constructors

new BarretenbergBackend(acirCircuit, options)

new BarretenbergBackend(acirCircuit, options): BarretenbergBackend

Parameters

ParameterType
acirCircuitCompiledCircuit
optionsBackendOptions

Returns

BarretenbergBackend

Properties

PropertyTypeDescription
acirComposerany-
acirUncompressedBytecodeUint8Array-
apiBarretenberg-
optionsBackendOptions-

Methods

destroy()

destroy(): Promise<void>

Returns

Promise<void>

Implementation of

Backend.destroy

Description

Destroys the backend


generateProof()

generateProof(compressedWitness): Promise<ProofData>

Parameters

ParameterType
compressedWitnessUint8Array

Returns

Promise<ProofData>

Implementation of

Backend.generateProof

Description

Generates a proof


generateRecursiveProofArtifacts()

generateRecursiveProofArtifacts(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 a circuit that has the #[recursive] attribute on its main 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.generateRecursiveProofArtifacts

Example

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

getVerificationKey()

getVerificationKey(): Promise<Uint8Array>

Returns

Promise<Uint8Array>


verifyProof()

verifyProof(proofData): Promise<boolean>

Parameters

ParameterType
proofDataProofData

Returns

Promise<boolean>

Implementation of

Backend.verifyProof

Description

Verifies a proof


Generated using typedoc-plugin-markdown and TypeDoc