Reference

Smart Contracts

All contracts open-source, verified on Basescan. Solidity 0.8.26.

Contract Addresses

Deployed on Base Sepolia testnet. Mainnet after audit.

ContractAddressPurpose
RAIL20Vault0x...Main vault, commitment tree
Verifier0x...PLONK verifier
UsernameRegistry0x....rail20 names
RAIL20Token0x...$RAIL20 (Clanker)

RAIL20Vault

solidity
// Deposit B20 into privacy pool
function shield(address token, uint256 amount, uint256 commitment) external;

// Private transfer via ZK proof
function privateTransfer(
    address token,
    uint256[24] calldata proof,
    uint256[6] calldata pubSignals
) external;

// Withdraw to public address
function unshield(
    address token,
    uint256[24] calldata proof,
    uint256[6] calldata pubSignals,
    address to, uint256 amount
) external;

Verifier

solidity
function verifyProof(
    uint256[24] calldata _proof,
    uint256[6] calldata _pubSignals
) external view returns (bool);

UsernameRegistry

solidity
function register(string calldata name, bytes32 shieldedAddress) external payable;
function resolve(string calldata name) external view returns (bool, bytes32);

Integration Guide

typescript
import { createPublicClient, http } from "viem";
import { baseSepolia } from "viem/chains";

const client = createPublicClient({ chain: baseSepolia, transport: http() });

const [found, addr] = await client.readContract({
  address: USERNAME_REGISTRY,
  abi: registryAbi,
  functionName: "resolve",
  args: ["alice"],
});