Using the CLI
This guide walks you through installing and using the zERC20 command-line interface.
Installation
git clone https://github.com/zerc20io/zERC20.git
cd zERC20/cli
cargo install --path .This installs the CLI binary as zerc20-cli (older versions may install as cli). Alternatively, run directly from the repository:
cd zERC20/cli
cargo run -r -- <command> ...Prerequisites
Circuit Artifacts
Circuit artifacts are required for generating withdrawal proofs. Download the official published artifacts before using the withdrawal CLI flows:
cargo install --path ../circuit-setup
zerc20-circuit-setup download --version <ARTIFACTS_VERSION>Proof of Innocence uses proof_of_innocence_nova_pp.bin and proof_of_innocence_nova_vp.bin. The currently published official artifact versions do not include those files yet, so Proof of Innocence requires locally generated artifacts until a POI-enabled version and manifest digest are published.
See Circuit Setup for more details.
Configuration
Environment Variables
Load environment variables from .env (see .env.example in the cli directory):
See ICP Canister IDs for mainnet/testnet values.
Basic Commands
Issue an Invoice
Generate a burn address to receive payments:
List Invoices
View your invoices:
Transfer
Send zERC20 to a burn address:
Check Invoice Status
Receive Funds
Generate proofs and receive:
Gasless Receive via Relay Node
Ask the relay node to submit the redeem transaction on your behalf:
Useful flags:
--max-relay-fee <AMOUNT>to abort if the quoted fee is too high--yesto skip the confirmation prompt--localto redeem from the latest proved local root instead of the global root
Swap zERC20 into Native Gas
Use the relay node to swap zERC20 into the chain's native gas token:
Useful flags:
--slippage-bps <BPS>sets the minimum accepted native output (0..=9999, default100)--recipient <ADDRESS>sends native tokens to a different address--yesskips the confirmation prompt
Notes:
The CLI prints
Swap submitted.after the relay accepts the request and returns a transaction hashIf the quote reports
priceFallback, the CLI warns because fallback or stale oracle prices may be less favorable
Proof of Innocence
Generate an off-chain proof that a set of received transfers did not originate from OFAC-sanctioned addresses:
The directory in NOVA_ARTIFACTS_DIR must contain locally generated proof_of_innocence_nova_pp.bin and proof_of_innocence_nova_vp.bin files. The currently published official downloads are not enough for this command.
Verify the proof and expected public values:
The witness files must include transfer Merkle paths and OFAC exclusion paths. See Proof of Innocence for the JSON format.
Quick Start Example
Important Notes
Crosschain Capability: Global-mode tokens can send on one chain and receive on another. Local-mode tokens such as zJPYC settle on the connected chain.
Processing Time: Private transfers typically take 30 minutes to 1 hour on mainnet
Testnet Limitations: On testnets, cross-chain transfers may take longer due to LayerZero instability. Local-mode zJPYC does not wait for LayerZero, but it can still be delayed by RPC or indexer issues.
Next Steps
FAQ — Common questions and troubleshooting
CLI README — Full CLI documentation
Last updated
Was this helpful?