Skip to content

Deployments

Pre-configured contract addresses and endpoints for all networks.

DEPLOYMENTS

Object containing deployment info for each network.

typescript
import { DEPLOYMENTS } from '@zkprivacy/sdk';

const deployment = DEPLOYMENTS.remote;
console.log(deployment.pool);  // 0x...

Networks

NetworkDescription
locallocalhost:8545 (Anvil)
remoterpc.zkprivacy.dev (VPS Anvil)
testnetBase Sepolia
mainnetBase mainnet

Deployment Structure

typescript
interface Deployment {
  pool: Address;              // UTXOPool contract
  chainId: number;            // Network chain ID
  rpcUrl: string;             // RPC endpoint
  relayerUrl?: string;        // Relayer service
  quickSyncUrl?: string;      // QuickSync service
  faucetUrl?: string;         // Test token faucet
  tokens: {
    zkUSD: Address;
    zkEUR: Address;
    zkPLN: Address;
  };
}

Example

typescript
import { DEPLOYMENTS } from '@zkprivacy/sdk';

const { pool, rpcUrl, tokens } = DEPLOYMENTS.remote;

console.log('Pool:', pool);
console.log('RPC:', rpcUrl);
console.log('zkUSD:', tokens.zkUSD);

detectNetwork

Auto-detect network based on hostname or RPC.

typescript
import { detectNetwork } from '@zkprivacy/sdk';

const network = await detectNetwork(): Promise<NetworkName>

Returns

'local' | 'remote' | 'testnet' | 'mainnet'

Detection Logic

  1. Check hostname:
    • localhost'local'
    • *.zkprivacy.dev'remote'
  2. Check RPC connection (if provided)
  3. Default to 'local'

Example

typescript
import { detectNetwork, DEPLOYMENTS } from '@zkprivacy/sdk';

const network = await detectNetwork();
const deployment = DEPLOYMENTS[network];

const client = new PrivacyClient({
  rpcUrl: deployment.rpcUrl,
  poolAddress: deployment.pool,
});

getDeployment

Get deployment for a specific network.

typescript
import { getDeployment } from '@zkprivacy/sdk';

const deployment = getDeployment('remote');

Throws if network is unknown.


Contract Addresses

Local & Remote (Same Addresses)

Using deterministic CREATE2 deployment:

ContractAddress
Pool0x5c616ef9765b2D94B9e24Bc850349f203820A8F5
TransferVerifier0x22C8844ED34CB225CAE2C7b24F81c9cC093c6A9C
UnshieldVerifier0xAeD9f571499475aa74e4fF00eD2D6De4f996E471
Poseidon20x9593E072e5bBD48637222F2c759671894144C384
zkUSD0x79eFE8da34E2AC4838331f016a4C4D9330996752
zkEUR0xc4772653B01b191eabAA0960a712F20711BCdBc8
zkPLN0x60291F4EbD7Cf21C9206DB216321AE81E36e920C

INFO

Local and remote use identical addresses for developer convenience. Production networks (Base) will have different addresses.


Service URLs

Remote Network

ServiceURL
RPChttps://rpc.zkprivacy.dev
Relayerhttps://relayer.zkprivacy.dev
QuickSynchttps://sync.zkprivacy.dev
Faucethttps://faucet.zkprivacy.dev
FX Rateshttps://fx.zkprivacy.dev

Local Network

ServiceURL
RPChttp://localhost:8545
Relayerhttp://localhost:3200
QuickSynchttp://localhost:3202
Faucethttp://localhost:3201

Environment Override

You can override deployment values via environment:

typescript
const client = new PrivacyClient({
  rpcUrl: process.env.RPC_URL || DEPLOYMENTS.remote.rpcUrl,
  poolAddress: process.env.POOL_ADDRESS || DEPLOYMENTS.remote.pool,
});

But prefer using DEPLOYMENTS as the single source of truth.

Released under the MIT License.