Documentation Index
Fetch the complete documentation index at: https://docs.arcium.com/llms.txt
Use this file to discover all available pages before exploring further.
Getting started with deployment
Deploy afterarcium build and arcium test pass locally. This guide covers program preparation, cluster offsets, RPC setup, migration, and closing accounts.
This guide walks you through deploying to devnet first. Once you’ve validated your MXE on devnet, see Deploying to Mainnet for mainnet-specific configuration.
What you’ll need
Before deploying, make sure you have:- Your MXE built successfully with
arcium build - Tests passing locally with
arcium test - A Solana keypair with around 2-5 SOL for deployment costs (program deployment and account initialization)
- Access to a reliable RPC endpoint
Preparing your program
Before deploying, decide how your program stores computation definitions.Handling large circuits with offchain storage
Arcis compiled circuits can be several MB. Uploading the full bytecode onchain can require many transactions and high rent. For larger circuits, upload the compiled.arcis file to public storage and initialize the computation definition with its URL and hash.
Standard approach (works for small circuits):
The
circuit_hash! macro embeds the SHA-256 hash of your compiled circuit at compile time. The hash is read from build/{circuit_name}.hash, which is generated automatically during arcium build. Arx nodes verify this hash when fetching your circuit to ensure the circuit hasn’t been tampered with.Important: Always use circuit_hash! for offchain circuits. Don’t use a placeholder like [0u8; 32] - this will cause verification to fail on Arx nodes.- Build your project with
arcium buildto generate the circuit files and hashes - Upload the
.arcisfiles frombuild/folder to your preferred storage service - Update your init functions with the public URLs and
circuit_hash!macro calls
Note on cluster configuration
When testing locally, you’ve been usingarciumEnv.arciumClusterOffset with getClusterAccAddress() in your test code. For devnet deployment, you’ll use the same pattern with your chosen cluster offset - we’ll show you exactly how in the post-deployment section.
Basic deployment
Thearcium deploy command handles both deploying your program and initializing the MXE account. Here’s the basic command structure:
Understanding cluster offsets
The--cluster-offset tells your MXE which Arcium cluster it should connect to. Think of clusters as groups of nodes that will perform your confidential computations. Available offsets:
Devnet cluster:
456
2026
Recovery set size
The--recovery-set-size parameter specifies how many nodes form the recovery set that holds confidential key shares of your MXE’s key. This enables key reconstruction when needed, whether due to node failure or cluster migration. This is required. The absolute minimum is 4; larger clusters may require a larger recovery set, and the CLI prints the required value if the one you pass is too small.
Choosing your RPC provider
Always pass--rpc-url <your-rpc-url>. Solana’s default RPC endpoints (-u d, -u m) can drop transactions during deployment.
Recommended approach with a reliable RPC:
Advanced deployment options
Once you’re comfortable with basic deployment, you might want to customize things further.Using a custom program address
If you need your program at a specific address (maybe for consistency across deployments), you can provide a program keypair:Partial deployments
Sometimes you might need to run just part of the deployment process. For instance, if you’ve already deployed the program but need to reinitialize the MXE account:After deployment
Initialize your computation definitions
Your MXE is deployed, but you still need to initialize the computation definitions. This tells the Arcium Network what confidential operations your MXE can perform. Computation definitions only need to be initialized once - they persist onchain and don’t need to be re-initialized unless you’re deploying to a new program address. You can initialize them anytime after deployment completes successfully. Remember how we mentioned you’d need to update your cluster configuration? Now’s the time! You’ll need to update your test or client code to derive the cluster account (and the related PDAs) from the cluster offset you selected during deployment. Local testing pattern:cluster_offset value that you used during deployment! This ensures your program talks to the right cluster.
Once you’ve updated the cluster configuration, you can run the initialization:
Verify everything’s working
Let’s make sure your deployment succeeded:Arcium.toml:
Arcium.toml and configures the test environment automatically. For RPC configuration, set the cluster and wallet in your Anchor.toml:
Deploying to mainnet
Once you’ve validated your MXE on devnet, you can deploy to Arcium mainnet-alpha. The deployment process is the same, with a few key differences:Mainnet cluster offset
Use the mainnet cluster offset from the Understanding Cluster Offsets section:Mainnet configuration
Configure the mainnet cluster offset in yourArcium.toml (see Understanding Cluster Offsets for the current value):
Common issues and solutions
The examples below use devnet. For mainnet, replace
-u d with -u m and use a mainnet RPC URL.Dealing with dropped transactions
If your deployment fails with transaction errors, it’s almost always the RPC. Switch to a dedicated provider:Running out of SOL
Check your balance before deploying:Deployment partially failed?
If your deployment was interrupted (e.g., due to a dropped transaction or network issue), use the--resume flag to pick up where it left off:
--resume flag is also available on init-mxe and migrate-cluster for the same purpose. For finer control, you can also skip specific phases: --skip-deploy (skip program deployment, only initialize MXE) or --skip-init (deploy program only, skip MXE initialization).
Managing your MXE
Cluster migration
If you need to move your MXE from one cluster to another, use themigrate-cluster command:
MXEs deployed with v0.9.x already have the recovery material needed for
migrate-cluster; no separate remediation command is required before migrating them with v0.10.x.--resume:
--resume/--abort the CLI infers the cluster offset from onchain state; --cluster-offset is required only on the initial call.
Closing an MXE or computation definition
When you no longer need an MXE or one of its computation definitions, close the accounts to reclaim rent. Comp defs close in two steps: deactivate, wait 180 slots, then close. MXEs can close only after all user-defined comp defs are closed.--rpc-url — the CLI defaults to mainnet without it.
For the full state machine, authority rules, error codes, and common mistakes, see Account lifecycle and closing.
What’s next?
After deployment, update your client code to use the correct cluster offset, initialize your computation definitions onchain, and run end-to-end tests on devnet.Arcis best practices
Learn patterns and optimizations for efficient confidential instructions.
Examples repository
Explore complete example projects and reference implementations.