BaseProofComposer
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / BaseProofComposer
Class: BaseProofComposer
Section titled “Class: 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
Example
Section titled “Example”const composer = new BaseProofComposer()
// Register providersawait composer.registerProvider(noirProvider)await composer.registerProvider(halo2Provider)
// Initializeawait composer.initialize()
// Compose proofsconst result = await composer.compose({ proofs: [proof1, proof2], strategy: ProofAggregationStrategy.PARALLEL,})Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BaseProofComposer(
config?):BaseProofComposer
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2171
Parameters
Section titled “Parameters”config?
Section titled “config?”Partial<ProofCompositionConfig>
Returns
Section titled “Returns”BaseProofComposer
Accessors
Section titled “Accessors”config
Section titled “config”Get Signature
Section titled “Get Signature”get config():
ProofCompositionConfig
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2172
Current configuration
Returns
Section titled “Returns”Current configuration
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”updateConfig()
Section titled “updateConfig()”updateConfig(
config):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2173
Update configuration.
Parameters
Section titled “Parameters”config
Section titled “config”Partial<ProofCompositionConfig>
Partial configuration to merge
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”registerProvider()
Section titled “registerProvider()”registerProvider(
provider,options?):Promise<ProofProviderRegistration>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2174
Register a proof provider.
Parameters
Section titled “Parameters”provider
Section titled “provider”The provider to register
options?
Section titled “options?”Registration options
Returns
Section titled “Returns”Promise<ProofProviderRegistration>
Registration entry
Implementation of
Section titled “Implementation of”ProofComposer.registerProvider
unregisterProvider()
Section titled “unregisterProvider()”unregisterProvider(
providerId):boolean
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2175
Unregister a provider.
Parameters
Section titled “Parameters”providerId
Section titled “providerId”string
Provider ID to unregister
Returns
Section titled “Returns”boolean
true if provider was removed
Implementation of
Section titled “Implementation of”ProofComposer.unregisterProvider
getProvider()
Section titled “getProvider()”getProvider(
providerId):ComposableProofProvider|undefined
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2176
Get a registered provider by ID.
Parameters
Section titled “Parameters”providerId
Section titled “providerId”string
Provider ID
Returns
Section titled “Returns”ComposableProofProvider | undefined
Provider or undefined
Implementation of
Section titled “Implementation of”getProviderForSystem()
Section titled “getProviderForSystem()”getProviderForSystem(
system):ComposableProofProvider|undefined
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2177
Get provider for a specific proof system.
Parameters
Section titled “Parameters”system
Section titled “system”Proof system
Returns
Section titled “Returns”ComposableProofProvider | undefined
Provider or undefined
Implementation of
Section titled “Implementation of”ProofComposer.getProviderForSystem
getProviders()
Section titled “getProviders()”getProviders():
ProofProviderRegistration[]
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2178
Get all registered providers.
Returns
Section titled “Returns”Array of provider registrations
Implementation of
Section titled “Implementation of”getAvailableSystems()
Section titled “getAvailableSystems()”getAvailableSystems():
ProofSystem[]
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2179
Get available proof systems.
Returns
Section titled “Returns”Array of available systems
Implementation of
Section titled “Implementation of”ProofComposer.getAvailableSystems
generateProof()
Section titled “generateProof()”generateProof(
request):Promise<ProofGenerationResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2180
Generate a proof using the appropriate provider.
Parameters
Section titled “Parameters”request
Section titled “request”Proof generation request
Returns
Section titled “Returns”Promise<ProofGenerationResult>
Generation result
Implementation of
Section titled “Implementation of”generateProofs()
Section titled “generateProofs()”generateProofs(
requests):Promise<ProofGenerationResult[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2181
Generate multiple proofs in parallel.
Parameters
Section titled “Parameters”requests
Section titled “requests”Array of proof requests
Returns
Section titled “Returns”Promise<ProofGenerationResult[]>
Array of generation results
Implementation of
Section titled “Implementation of”compose()
Section titled “compose()”compose(
options):Promise<CompositionResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2182
Compose multiple proofs into a single composed proof.
Parameters
Section titled “Parameters”options
Section titled “options”Composition options
Returns
Section titled “Returns”Promise<CompositionResult>
Composition result
Implementation of
Section titled “Implementation of”aggregate()
Section titled “aggregate()”aggregate(
options):Promise<AggregationResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2186
Aggregate proofs into a single proof (if supported).
Parameters
Section titled “Parameters”options
Section titled “options”Aggregation options
Returns
Section titled “Returns”Promise<AggregationResult>
Aggregation result
Implementation of
Section titled “Implementation of”verify()
Section titled “verify()”verify(
options):Promise<ProofVerificationResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2187
Verify a composed proof.
Parameters
Section titled “Parameters”options
Section titled “options”Verification options
Returns
Section titled “Returns”Promise<ProofVerificationResult>
Verification result
Implementation of
Section titled “Implementation of”verifySingle()
Section titled “verifySingle()”verifySingle(
proof):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2188
Verify a single proof.
Parameters
Section titled “Parameters”Proof to verify
Returns
Section titled “Returns”Promise<boolean>
true if valid
Implementation of
Section titled “Implementation of”convert()
Section titled “convert()”convert(
options):Promise<ConversionResult>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2189
Convert a proof to a different format.
Parameters
Section titled “Parameters”options
Section titled “options”Conversion options
Returns
Section titled “Returns”Promise<ConversionResult>
Conversion result
Implementation of
Section titled “Implementation of”getCompatibilityMatrix()
Section titled “getCompatibilityMatrix()”getCompatibilityMatrix():
CompatibilityMatrix
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2190
Get the compatibility matrix for proof systems.
Returns
Section titled “Returns”Compatibility matrix
Implementation of
Section titled “Implementation of”ProofComposer.getCompatibilityMatrix
areSystemsCompatible()
Section titled “areSystemsCompatible()”areSystemsCompatible(
source,target):boolean
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2191
Check if two systems are compatible for composition.
Parameters
Section titled “Parameters”source
Section titled “source”Source system
target
Section titled “target”Target system
Returns
Section titled “Returns”boolean
true if compatible
Implementation of
Section titled “Implementation of”ProofComposer.areSystemsCompatible
getCacheStats()
Section titled “getCacheStats()”getCacheStats():
CacheStats
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2192
Get cache statistics.
Returns
Section titled “Returns”Cache stats
Implementation of
Section titled “Implementation of”clearCache()
Section titled “clearCache()”clearCache(
olderThan?):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2193
Clear the proof cache.
Parameters
Section titled “Parameters”olderThan?
Section titled “olderThan?”number
Optional: only clear entries older than this timestamp
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”getWorkerPoolStatus()
Section titled “getWorkerPoolStatus()”getWorkerPoolStatus():
WorkerPoolStatus
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2194
Get worker pool status.
Returns
Section titled “Returns”Worker pool status
Implementation of
Section titled “Implementation of”ProofComposer.getWorkerPoolStatus
scaleWorkerPool()
Section titled “scaleWorkerPool()”scaleWorkerPool(
targetWorkers):Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2195
Scale worker pool.
Parameters
Section titled “Parameters”targetWorkers
Section titled “targetWorkers”number
Target number of workers
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”setFallbackConfig()
Section titled “setFallbackConfig()”setFallbackConfig(
config):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2196
Set fallback configuration.
Parameters
Section titled “Parameters”config
Section titled “config”Fallback configuration
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”ProofComposer.setFallbackConfig
getFallbackConfig()
Section titled “getFallbackConfig()”getFallbackConfig():
FallbackConfig|undefined
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2197
Get current fallback configuration.
Returns
Section titled “Returns”FallbackConfig | undefined
Fallback config or undefined
Implementation of
Section titled “Implementation of”ProofComposer.getFallbackConfig
addEventListener()
Section titled “addEventListener()”addEventListener(
listener): () =>void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2198
Add an event listener.
Parameters
Section titled “Parameters”listener
Section titled “listener”Event listener
Returns
Section titled “Returns”Unsubscribe function
():
void
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”ProofComposer.addEventListener
removeEventListener()
Section titled “removeEventListener()”removeEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2199
Remove an event listener.
Parameters
Section titled “Parameters”listener
Section titled “listener”Listener to remove
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”ProofComposer.removeEventListener
setTelemetryCollector()
Section titled “setTelemetryCollector()”setTelemetryCollector(
collector):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2201
Set telemetry collector.
Parameters
Section titled “Parameters”collector
Section titled “collector”Telemetry collector
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”ProofComposer.setTelemetryCollector
initialize()
Section titled “initialize()”initialize():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2202
Initialize the composer and all providers.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”dispose()
Section titled “dispose()”dispose():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2203
Dispose of resources.
Returns
Section titled “Returns”Promise<void>