Skip to content

ObliviousSyncProvider

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / ObliviousSyncProvider

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

Oblivious Sync Provider Interface

This is the core interface that sync services must implement. The service processes queries but learns NOTHING about:

  • Which notes belong to the user
  • When the user spends
  • Transaction patterns or amounts
  1. Query Processing: Must process encrypted queries without decryption
  2. Note Scanning: Return all potentially matching notes (over-approximate)
  3. No Logging: Must not log query content or patterns
  4. Stateless: Should not maintain per-user state

readonly name: string

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

Get provider name/identifier


readonly supportedChains: string[]

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

Supported chains

initialize(): Promise<void>

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

Initialize the provider

Promise<void>


getHealth(chainId): Promise<SyncServiceHealth>

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

Check health of sync service for a chain

string

Chain to check

Promise<SyncServiceHealth>

Health information


scanForNotes(viewingKeyPublic, blockRange): Promise<EncryptedNote[]>

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

Scan for notes belonging to a viewing key (oblivious)

The service returns ALL notes that COULD belong to the viewing key, without knowing which ones actually do. The user filters locally.

`0x${string}`

Public viewing key (service sees this)

BlockRange

Blocks to scan

Promise<EncryptedNote[]>

Encrypted notes that might belong to user


checkNullifiers(nullifiers): Promise<Map<`0x${string}`, boolean>>

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

Check if nullifiers have been spent (oblivious)

The service checks nullifiers but cannot correlate them to specific notes due to the sync randomness included in derivation.

ObliviousNullifier[]

Oblivious nullifiers to check

Promise<Map<`0x${string}`, boolean>>

Map of nullifier → spent status


getMerkleProofs(commitments, chainId): Promise<Map<`0x${string}`, MerkleProof>>

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

Get Merkle proofs for note inclusion

`0x${string}`[]

Note commitments to get proofs for

string

Chain ID

Promise<Map<`0x${string}`, MerkleProof>>

Merkle proofs for each commitment


executeObliviousQuery(query): Promise<ObliviousSyncResponse>

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

Execute oblivious sync query

This is the fully oblivious query method where the query itself is encrypted and the service learns nothing.

ObliviousSyncQuery

Encrypted oblivious query

Promise<ObliviousSyncResponse>

Sync response with encrypted notes


getCurrentHeight(chainId): Promise<bigint>

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

Get current block height for a chain

string

Chain to query

Promise<bigint>

Current block height


subscribeToNotes(viewingKeyPublic, chainId, callback): () => void

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

Subscribe to new notes (streaming)

`0x${string}`

Public viewing key

string

Chain to watch

(notes) => void

Called when new notes found

Unsubscribe function

(): void

void


shutdown(): Promise<void>

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

Shutdown the provider

Promise<void>