Skip to main content
Version: v0.36.0

BarretenbergBackend

Implements

Constructors

new BarretenbergBackend(acirCircuit, options)

new BarretenbergBackend(acirCircuit, options): BarretenbergBackend

Parameters

ParameterType
acirCircuitCompiledCircuit
optionsBackendOptions

Returns

BarretenbergBackend

Properties

PropertyTypeDescription
backendUltraPlonkBackend-

Methods

destroy()

destroy(): Promise<void>

Returns

Promise<void>


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>


verifyProof()

verifyProof(proofData): Promise<boolean>

Parameters

ParameterType
proofDataProofData

Returns

Promise<boolean>

Description

Verifies a proof


Generated using typedoc-plugin-markdown and TypeDoc