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
| Network | Description |
|---|---|
local | localhost:8545 (Anvil) |
remote | rpc.zkprivacy.dev (VPS Anvil) |
testnet | Base Sepolia |
mainnet | Base 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
- Check hostname:
localhost→'local'*.zkprivacy.dev→'remote'
- Check RPC connection (if provided)
- 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:
| Contract | Address |
|---|---|
| Pool | 0x5c616ef9765b2D94B9e24Bc850349f203820A8F5 |
| TransferVerifier | 0x22C8844ED34CB225CAE2C7b24F81c9cC093c6A9C |
| UnshieldVerifier | 0xAeD9f571499475aa74e4fF00eD2D6De4f996E471 |
| Poseidon2 | 0x9593E072e5bBD48637222F2c759671894144C384 |
| zkUSD | 0x79eFE8da34E2AC4838331f016a4C4D9330996752 |
| zkEUR | 0xc4772653B01b191eabAA0960a712F20711BCdBc8 |
| zkPLN | 0x60291F4EbD7Cf21C9206DB216321AE81E36e920C |
INFO
Local and remote use identical addresses for developer convenience. Production networks (Base) will have different addresses.
Service URLs
Remote Network
| Service | URL |
|---|---|
| RPC | https://rpc.zkprivacy.dev |
| Relayer | https://relayer.zkprivacy.dev |
| QuickSync | https://sync.zkprivacy.dev |
| Faucet | https://faucet.zkprivacy.dev |
| FX Rates | https://fx.zkprivacy.dev |
Local Network
| Service | URL |
|---|---|
| RPC | http://localhost:8545 |
| Relayer | http://localhost:3200 |
| QuickSync | http://localhost:3202 |
| Faucet | http://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.