Skip to main content
Deploying to mainnet requires careful preparation and security considerations. The Privacy Cash mainnet deployment is fully audited and uses multisig governance.

Program Information

  • Network: Solana Mainnet Beta
  • Program ID: 9fhQBbumKEFuXtMBDw8AaQyAjCorLGJQiS3skWZdQyQD
  • Upgrade Authority: AWexibGxNFKTa1b5R5MN4PJr9HWnWRwf8EW9g8cLx3dM (Squad Multisig)
  • Verification Hash: c6f1e5336f2068dc1c1e1c64e92e3d8495b8df79f78011e2620af60aa43090c5
Mainnet deployment requires real SOL and affects real user funds. Ensure thorough testing on devnet first.

Pre-Deployment Checklist

1

Complete Devnet Testing

  • All unit tests pass
  • Integration tests successful
  • User acceptance testing complete
2

Security Audit

  • Code has been audited by reputable security firms
  • All critical issues resolved
  • Audit reports reviewed
3

Prepare Keypairs

  • Secure the program keypair (zkcash-keypair.json)
  • Secure the deployment keypair with sufficient SOL
  • Set up multisig wallet for upgrade authority
4

Plan Upgrade Authority Transfer

  • Configure Squad multisig wallet
  • Plan authority transfer transaction
  • Coordinate with multisig signers

Build for Mainnet

1

Navigate to Anchor Directory

cd anchor
2

Build Verifiable Program

Always use verifiable builds for mainnet:
anchor build --verifiable
This ensures the build can be reproduced and verified by anyone.
3

Copy Program Keypair

rm target/deploy/zkcash-keypair.json
cp zkcash-keypair.json target/deploy/zkcash-keypair.json

Deploy to Mainnet

Ensure you have sufficient SOL for deployment. Program deployment typically costs 5-10 SOL depending on program size.

Deploy Command

anchor deploy --verifiable --provider.cluster mainnet
This command:
  • Deploys the program to mainnet
  • Sets your deploy-keypair.json as the initial upgrade authority
  • Creates the program account at the address specified in zkcash-keypair.json

Initialize Mainnet Program

Initialize SPL Token Trees (via Squad)

For mainnet, program initialization is done through Squad multisig for security.

Generate Squad Transaction

cd ../scripts
npx ts-node initialize_spl_tree_mainnet_squads.ts
This script generates a base58-encoded transaction that can be submitted to Squad: Configuration:
  • USDT Mint: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
  • Max Deposit: 200,000 USDT
  • Squad Vault: AWexibGxNFKTa1b5R5MN4PJr9HWnWRwf8EW9g8cLx3dM

Submit to Squad Multisig

1

Copy Transaction

Copy the base58 transaction output from the script
2

Create Squad Proposal

Go to your Squad multisig interface and create a new proposal
3

Paste Transaction

Paste the base58 transaction into the proposal
4

Get Signatures

Coordinate with multisig members to approve and execute

Transfer Upgrade Authority

After successful deployment, transfer upgrade authority to the Squad multisig:
solana program set-upgrade-authority 9fhQBbumKEFuXtMBDw8AaQyAjCorLGJQiS3skWZdQyQD \
  --new-upgrade-authority AWexibGxNFKTa1b5R5MN4PJr9HWnWRwf8EW9g8cLx3dM \
  --upgrade-authority deploy-keypair.json \
  --skip-new-upgrade-authority-signer-check \
  --url mainnet-beta
This command:
  • Sets the Squad vault as the new upgrade authority
  • Removes single-key control over program upgrades
  • Requires multisig approval for future updates
This operation is irreversible. After transfer, only the Squad multisig can upgrade the program. Verify the multisig address before executing.

Address Lookup Tables (ALT)

For transaction size optimization, Privacy Cash uses Address Lookup Tables.

Create ALT

npx ts-node create_alt_mainnet.ts
This script:
  • Creates a new Address Lookup Table
  • Adds all frequently-used protocol addresses
  • Includes PDAs for SOL and SPL token trees
  • Adds token program accounts and ATAs
Addresses included:
  • Program ID and PDAs
  • SOL tree account and token account
  • USDC tree account and associated token accounts
  • Fee recipient accounts
  • Relayer addresses
  • System programs

Extend Existing ALT

To add new tokens (e.g., USDT) to an existing ALT:
npx ts-node extend_alt_mainnet.ts
Current ALT: HEN49U2ySJ85Vc78qprSW9y6mFDhs1NczRxyppNHjofe

Update Configuration (via Squad)

Configuration updates like deposit limits must go through Squad multisig.

Update SPL Deposit Limit

npx ts-node update_spl_deposit_limit_via_squad.ts
This generates a Squad transaction to update the deposit limit for an SPL token. Example Configuration:
  • Token: USDC (EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v)
  • New Limit: 1,000,000 USDC
The script outputs:
  • Instruction discriminator
  • Serialized parameters
  • Complete base58 transaction for Squad

Verify Deployment

After deployment:
1

Verify Program ID

solana program show 9fhQBbumKEFuXtMBDw8AaQyAjCorLGJQiS3skWZdQyQD --url mainnet-beta
2

Verify Upgrade Authority

Confirm the upgrade authority is the Squad multisig:
Upgrade Authority: AWexibGxNFKTa1b5R5MN4PJr9HWnWRwf8EW9g8cLx3dM
3

Run Verification Build

See the Verification guide for build verification steps

Monitoring

Check Program Health

# View program account
solana account 9fhQBbumKEFuXtMBDw8AaQyAjCorLGJQiS3skWZdQyQD --url mainnet-beta

# Monitor transactions
solana transaction-history 9fhQBbumKEFuXtMBDw8AaQyAjCorLGJQiS3skWZdQyQD --url mainnet-beta

Security Best Practices

Follow these security guidelines for mainnet deployment:
  • Never commit keypairs to version control
  • Use hardware wallets for multisig signers
  • Test on devnet before every mainnet upgrade
  • Coordinate multisig operations with all signers in advance
  • Monitor program activity after deployment
  • Keep backups of all keypairs and configuration
  • Document changes for audit trail

Mainnet Configuration Summary

ParameterValue
Program ID9fhQBbumKEFuXtMBDw8AaQyAjCorLGJQiS3skWZdQyQD
Upgrade AuthorityAWexibGxNFKTa1b5R5MN4PJr9HWnWRwf8EW9g8cLx3dM
Fee RecipientAWexibGxNFKTa1b5R5MN4PJr9HWnWRwf8EW9g8cLx3dM
RelayerAF8VuwCncKd5ZBnLYYnMjqh4vLch8mjqE75sFe5ZjRFW
USDC MintEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDT MintEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
ALT AddressHEN49U2ySJ85Vc78qprSW9y6mFDhs1NczRxyppNHjofe

Next Steps

Verify Deployment

Verify your mainnet build matches the deployed bytecode

Build docs developers (and LLMs) love