ProofProvider
SIP Protocol API Reference v0.12.0
SIP Protocol API Reference / ProofProvider
Interface: ProofProvider
Section titled âInterface: ProofProviderâDefined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:149
Proof Provider Interface
Implementations of this interface provide ZK proof generation and verification. The SDK uses this interface to remain agnostic to the underlying ZK framework.
Example
Section titled âExampleâ// Use mock provider for testingconst mockProvider = new MockProofProvider()
// Use Noir provider for productionconst noirProvider = new NoirProofProvider()
// Configure SIP client with providerconst sip = new SIP({ network: 'testnet', proofProvider: noirProvider,})Properties
Section titled âPropertiesâframework
Section titled âframeworkâ
readonlyframework:ProofFramework
Defined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:153
The ZK framework this provider uses
isReady
Section titled âisReadyâ
readonlyisReady:boolean
Defined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:158
Whether the provider is ready to generate proofs (e.g., circuits compiled, keys loaded)
Methods
Section titled âMethodsâinitialize()
Section titled âinitialize()âinitialize():
Promise<void>
Defined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:164
Initialize the provider (compile circuits, load keys, etc.)
Returns
Section titled âReturnsâPromise<void>
Error if initialization fails
waitUntilReady()
Section titled âwaitUntilReady()âwaitUntilReady(
timeoutMs?):Promise<void>
Defined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:176
Wait for the provider to be ready, with optional timeout
This method blocks until initialization is complete or the timeout is reached. If initialization is already complete, resolves immediately. If initialization hasnât started, this method will start it.
Parameters
Section titled âParametersâtimeoutMs?
Section titled âtimeoutMs?ânumber
Maximum time to wait in milliseconds (default: 30000)
Returns
Section titled âReturnsâPromise<void>
ProofError if timeout is reached before ready
ProofError if initialization fails
generateFundingProof()
Section titled âgenerateFundingProof()âgenerateFundingProof(
params):Promise<ProofResult>
Defined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:188
Generate a Funding Proof
Proves that the user has sufficient balance without revealing the exact amount.
Parameters
Section titled âParametersâFunding proof parameters
Returns
Section titled âReturnsâPromise<ProofResult>
The generated proof with public inputs
ProofGenerationError if proof generation fails
docs/specs/FUNDING-PROOF.md (~22,000 constraints)
generateValidityProof()
Section titled âgenerateValidityProof()âgenerateValidityProof(
params):Promise<ProofResult>
Defined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:200
Generate a Validity Proof
Proves that the intent is authorized without revealing the sender.
Parameters
Section titled âParametersâValidity proof parameters
Returns
Section titled âReturnsâPromise<ProofResult>
The generated proof with public inputs
ProofGenerationError if proof generation fails
docs/specs/VALIDITY-PROOF.md (~72,000 constraints)
generateFulfillmentProof()
Section titled âgenerateFulfillmentProof()âgenerateFulfillmentProof(
params):Promise<ProofResult>
Defined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:212
Generate a Fulfillment Proof
Proves that the solver correctly delivered the output.
Parameters
Section titled âParametersâFulfillment proof parameters
Returns
Section titled âReturnsâPromise<ProofResult>
The generated proof with public inputs
ProofGenerationError if proof generation fails
docs/specs/FULFILLMENT-PROOF.md (~22,000 constraints)
verifyProof()
Section titled âverifyProof()âverifyProof(
proof):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/noir-CwPIyBLj.d.ts:219
Verify a proof
Parameters
Section titled âParametersâThe proof to verify
Returns
Section titled âReturnsâPromise<boolean>
true if the proof is valid, false otherwise