Skip to content

ProofProvider

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / ProofProvider

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.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.

// Use mock provider for testing
const mockProvider = new MockProofProvider()
// Use Noir provider for production
const noirProvider = new NoirProofProvider()
// Configure SIP client with provider
const sip = new SIP({
network: 'testnet',
proofProvider: noirProvider,
})

readonly framework: ProofFramework

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.d.ts:153

The ZK framework this provider uses


readonly isReady: boolean

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.d.ts:158

Whether the provider is ready to generate proofs (e.g., circuits compiled, keys loaded)

initialize(): Promise<void>

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.d.ts:164

Initialize the provider (compile circuits, load keys, etc.)

Promise<void>

Error if initialization fails


waitUntilReady(timeoutMs?): Promise<void>

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.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.

number

Maximum time to wait in milliseconds (default: 30000)

Promise<void>

ProofError if timeout is reached before ready

ProofError if initialization fails


generateFundingProof(params): Promise<ProofResult>

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.d.ts:188

Generate a Funding Proof

Proves that the user has sufficient balance without revealing the exact amount.

FundingProofParams

Funding proof parameters

Promise<ProofResult>

The generated proof with public inputs

ProofGenerationError if proof generation fails

docs/specs/FUNDING-PROOF.md (~22,000 constraints)


generateValidityProof(params): Promise<ProofResult>

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.d.ts:200

Generate a Validity Proof

Proves that the intent is authorized without revealing the sender.

ValidityProofParams

Validity proof parameters

Promise<ProofResult>

The generated proof with public inputs

ProofGenerationError if proof generation fails

docs/specs/VALIDITY-PROOF.md (~72,000 constraints)


generateFulfillmentProof(params): Promise<ProofResult>

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.d.ts:212

Generate a Fulfillment Proof

Proves that the solver correctly delivered the output.

FulfillmentProofParams

Fulfillment proof parameters

Promise<ProofResult>

The generated proof with public inputs

ProofGenerationError if proof generation fails

docs/specs/FULFILLMENT-PROOF.md (~22,000 constraints)


verifyProof(proof): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/noir-kzbLVTei.d.ts:219

Verify a proof

ZKProof

The proof to verify

Promise<boolean>

true if the proof is valid, false otherwise