Skip to content

BaseProofComposer

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / BaseProofComposer

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2159

Base implementation of the ProofComposer interface.

Provides core functionality for:

  • Provider registration and management
  • Proof generation across multiple systems
  • Proof composition and aggregation
  • Verification of composed proofs
  • Event emission for progress tracking
const composer = new BaseProofComposer()
// Register providers
await composer.registerProvider(noirProvider)
await composer.registerProvider(halo2Provider)
// Initialize
await composer.initialize()
// Compose proofs
const result = await composer.compose({
proofs: [proof1, proof2],
strategy: ProofAggregationStrategy.PARALLEL,
})

new BaseProofComposer(config?): BaseProofComposer

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2171

Partial<ProofCompositionConfig>

BaseProofComposer

get config(): ProofCompositionConfig

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2172

Current configuration

ProofCompositionConfig

Current configuration

ProofComposer.config

updateConfig(config): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2173

Update configuration.

Partial<ProofCompositionConfig>

Partial configuration to merge

void

ProofComposer.updateConfig


registerProvider(provider, options?): Promise<ProofProviderRegistration>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2174

Register a proof provider.

ComposableProofProvider

The provider to register

RegisterProviderOptions

Registration options

Promise<ProofProviderRegistration>

Registration entry

ProofComposer.registerProvider


unregisterProvider(providerId): boolean

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2175

Unregister a provider.

string

Provider ID to unregister

boolean

true if provider was removed

ProofComposer.unregisterProvider


getProvider(providerId): ComposableProofProvider | undefined

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2176

Get a registered provider by ID.

string

Provider ID

ComposableProofProvider | undefined

Provider or undefined

ProofComposer.getProvider


getProviderForSystem(system): ComposableProofProvider | undefined

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2177

Get provider for a specific proof system.

ProofSystem

Proof system

ComposableProofProvider | undefined

Provider or undefined

ProofComposer.getProviderForSystem


getProviders(): ProofProviderRegistration[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2178

Get all registered providers.

ProofProviderRegistration[]

Array of provider registrations

ProofComposer.getProviders


getAvailableSystems(): ProofSystem[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2179

Get available proof systems.

ProofSystem[]

Array of available systems

ProofComposer.getAvailableSystems


generateProof(request): Promise<ProofGenerationResult>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2180

Generate a proof using the appropriate provider.

ProofGenerationRequest

Proof generation request

Promise<ProofGenerationResult>

Generation result

ProofComposer.generateProof


generateProofs(requests): Promise<ProofGenerationResult[]>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2181

Generate multiple proofs in parallel.

ProofGenerationRequest[]

Array of proof requests

Promise<ProofGenerationResult[]>

Array of generation results

ProofComposer.generateProofs


compose(options): Promise<CompositionResult>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2182

Compose multiple proofs into a single composed proof.

ComposeProofsOptions

Composition options

Promise<CompositionResult>

Composition result

ProofComposer.compose


aggregate(options): Promise<AggregationResult>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2186

Aggregate proofs into a single proof (if supported).

AggregateProofsOptions

Aggregation options

Promise<AggregationResult>

Aggregation result

ProofComposer.aggregate


verify(options): Promise<ProofVerificationResult>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2187

Verify a composed proof.

VerifyComposedProofOptions

Verification options

Promise<ProofVerificationResult>

Verification result

ProofComposer.verify


verifySingle(proof): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2188

Verify a single proof.

SingleProof

Proof to verify

Promise<boolean>

true if valid

ProofComposer.verifySingle


convert(options): Promise<ConversionResult>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2189

Convert a proof to a different format.

ConvertProofOptions

Conversion options

Promise<ConversionResult>

Conversion result

ProofComposer.convert


getCompatibilityMatrix(): CompatibilityMatrix

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2190

Get the compatibility matrix for proof systems.

CompatibilityMatrix

Compatibility matrix

ProofComposer.getCompatibilityMatrix


areSystemsCompatible(source, target): boolean

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2191

Check if two systems are compatible for composition.

ProofSystem

Source system

ProofSystem

Target system

boolean

true if compatible

ProofComposer.areSystemsCompatible


getCacheStats(): CacheStats

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2192

Get cache statistics.

CacheStats

Cache stats

ProofComposer.getCacheStats


clearCache(olderThan?): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2193

Clear the proof cache.

number

Optional: only clear entries older than this timestamp

void

ProofComposer.clearCache


getWorkerPoolStatus(): WorkerPoolStatus

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2194

Get worker pool status.

WorkerPoolStatus

Worker pool status

ProofComposer.getWorkerPoolStatus


scaleWorkerPool(targetWorkers): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2195

Scale worker pool.

number

Target number of workers

Promise<void>

ProofComposer.scaleWorkerPool


setFallbackConfig(config): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2196

Set fallback configuration.

FallbackConfig

Fallback configuration

void

ProofComposer.setFallbackConfig


getFallbackConfig(): FallbackConfig | undefined

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2197

Get current fallback configuration.

FallbackConfig | undefined

Fallback config or undefined

ProofComposer.getFallbackConfig


addEventListener(listener): () => void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2198

Add an event listener.

CompositionEventListener

Event listener

Unsubscribe function

(): void

void

ProofComposer.addEventListener


removeEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2199

Remove an event listener.

CompositionEventListener

Listener to remove

void

ProofComposer.removeEventListener


setTelemetryCollector(collector): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2201

Set telemetry collector.

TelemetryCollector

Telemetry collector

void

ProofComposer.setTelemetryCollector


initialize(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2202

Initialize the composer and all providers.

Promise<void>

ProofComposer.initialize


dispose(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2203

Dispose of resources.

Promise<void>

ProofComposer.dispose