UPP — Universal Private PoolSDK Reference

SDK Overview

UPP SDK module structure, subpath exports, and integration paths — a composable toolkit, not a monolithic client.

UPP SDK

@permissionless-technologies/upp-sdk is a TypeScript SDK for integrating UPP privacy into any application. It's built on viem (not ethers) and ships as a composable toolkit — pure transaction encoders, crypto primitives, an indexer, and optional React hooks — rather than a single client object.

Installation

npm install @permissionless-technologies/upp-sdk

Peer dependencies: viem (required), wagmi + react (only for the React hook surface).

Two integration paths

PathUse whenStart here
React hooksYou have a wagmi-based app and want privacy primitives that fit your existing wallet + write-contract flowReact Hooks
Encoders + cryptoServer-side integrations, non-React frontends, custom indexers, or anything that needs to compose the building blocks differentlyTransaction Encoders

The React hooks compose the encoders, indexer, and crypto. Anything you can do in React you can do in plain TypeScript by calling the same pieces directly.

Subpath exports

// Main entry — encoders, crypto, key derivation, deployments
import { … } from '@permissionless-technologies/upp-sdk'

// React hooks (UPPAccountProvider, useUPPAccount, useShield, …)
import { … } from '@permissionless-technologies/upp-sdk/react'

// Indexer + sync engine (makeRpcIndexer, createSyncEngine, helpers)
import { … } from '@permissionless-technologies/upp-sdk/indexer'

// Proof worker entry point (Web Worker module URL)
import workerUrl from '@permissionless-technologies/upp-sdk/worker?worker&url'

// STARK prover (WebAssembly, lazy-loaded)
import { … } from '@permissionless-technologies/upp-sdk/stwo-prover'
Import pathSurface
@permissionless-technologies/upp-sdkEncoders, RELAYER_FEE_AUTH, crypto primitives (createNote, encryptNote, decryptNote, stealth-address helpers), key derivation, deployment configs, constants
@permissionless-technologies/upp-sdk/reactUPPAccountProvider, useUPPAccount, useShield, usePoolTransfer, useWithdraw, useSwap, usePrivateBalance, usePersonalASP, useCircuitCache, useStarkVerifierType, useProofWorker, useUPPCrypto, plus the bundled UI components
@permissionless-technologies/upp-sdk/indexercreateSyncEngine, makeRpcIndexer, decryption helpers (decryptCandidates, tryDecryptHashBased), nullifier verifiers (verifyNullifiers, verifyStarkNullifiers), storage adapters
@permissionless-technologies/upp-sdk/workerWeb Worker entry for off-main-thread PLONK proving
@permissionless-technologies/upp-sdk/stwo-proverCircle STARK prover (WASM)

Quick examples

Non-React (encoders + viem):

import { encodeShieldTx } from '@permissionless-technologies/upp-sdk'

const tx = encodeShieldTx({ token, amount, ownerHash, blinding, encryptedNote })
await walletClient.writeContract({ address: poolAddress, ...tx })

React (hooks + wagmi):

import { useShield } from '@permissionless-technologies/upp-sdk/react'
import { encodeShieldTxFromBuildData } from '@permissionless-technologies/upp-sdk'

const { build } = useShield({ poolAddress, tokenAddress: UPD_ADDRESS })
const data = await build({ amount: parseUnits('100', 18), originAddress: address })
await writeContractAsync({ address: poolAddress, ...encodeShieldTxFromBuildData(data) })

In both cases the SDK never holds your wallet client — you submit transactions yourself with viem or wagmi.

Module pages

On this page