Skip to main content
Version: v0.29.0

BarretenbergBackend

Extends

  • BarretenbergVerifierBackend

Implements

Constructors

new BarretenbergBackend(acirCircuit, options)

new BarretenbergBackend(acirCircuit, options): BarretenbergBackend

Parameters

ParameterType
acirCircuitCompiledCircuit
optionsBackendOptions

Returns

BarretenbergBackend

Inherited from

BarretenbergVerifierBackend.constructor

Properties

PropertyTypeDescriptionInheritance
acirComposerany-BarretenbergVerifierBackend.acirComposer
acirUncompressedBytecodeUint8Array-BarretenbergVerifierBackend.acirUncompressedBytecode
apiBarretenberg-BarretenbergVerifierBackend.api
optionsBackendOptions-BarretenbergVerifierBackend.options

Methods

destroy()

destroy(): Promise<void>

Returns

Promise<void>

Inherited from

BarretenbergVerifierBackend.destroy


generateProof()

generateProof(compressedWitness): Promise<ProofData>

Parameters

ParameterType
compressedWitnessUint8Array

Returns

Promise<ProofData>

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>

Example

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

getVerificationKey()

getVerificationKey(): Promise<Uint8Array>

Returns

Promise<Uint8Array>

Inherited from

BarretenbergVerifierBackend.getVerificationKey


verifyProof()

verifyProof(proofData): Promise<boolean>

Parameters

ParameterType
proofDataProofData

Returns

Promise<boolean>

Inherited from

BarretenbergVerifierBackend.verifyProof

Description

Verifies a proof


Generated using typedoc-plugin-markdown and TypeDoc