Skip to content

CLI Reference

The bridge repository provides a Rust CLI named bridge-cli that exposes user, authority, and governance actions.

Global flags

Every command accepts these top-level flags:

FlagTypePurpose
--keypairPathPath to the payer/signer keypair file
--urlURLRPC endpoint for the chain the command targets
bash
bridge-cli --keypair ./authority.json --url http://localhost:8899 <command> [flags]

Configuration commands

These commands manage bridge setup and governance. They require authority-level access.

add-chain

Initialize a new bridge to another chain. Creates the Bridge account and its associated trackers.

FlagTypeRequiredPurpose
--chain-idu16YesNumeric identifier for the other chain
--authoritiesPUBKEY...YesInitial authority public keys
--thresholdu64YesVoting threshold (raw U0F64 bits)
--flat-feeu64YesFlat fee in native sub-tokens
--fee-targetPubkeyYesAccount that receives collected fees
--other-chain-nameStringYesHuman-readable name for the paired chain

edit-auth-proposal

Create or extend an authority proposal. A proposal collects one or more configuration changes that are applied atomically when voted through.

FlagTypeRequiredPurpose
--chain-idu16YesTarget bridge's chain ID
--proposal-keypairPathNoKeypair for the proposal account; omit to create a new one
--completeflagNoMark the proposal as ready for voting

Subcommand: add-token-pair

Adds a new bridgeable token pair to the proposal.

FlagTypeDefaultPurpose
--mintPubkeyThis-chain token mint
--other-chain-mintPubkeyOther-chain token mint
--bridge-modeStringvaultvault or mint-burn
--import-limitu64Maximum inbound tokens per period
--import-periodu64Import limit period in seconds
--export-limitu64Maximum outbound tokens per period
--export-periodu64Export limit period in seconds
--limit-authorityPubkeyNoneKey that can adjust limits without a proposal
--freeze-authorityPubkeyNoneKey that can freeze/unfreeze the pair
--frozenboolfalseWhether the pair starts frozen

Bridge-specific

Both mints in an AddTokenPair item must be unique within the bridge's existing token pairs. Use ModifyTokenPair (via the program directly, if not yet exposed in CLI) to change operational parameters on an existing pair.

vote-auth-proposal

Cast a weighted vote on an existing proposal.

FlagTypeDefaultPurpose
--chain-idu16Target bridge's chain ID
--proposalPubkeyProposal account address
--voteStringforVote direction: for or against
--mintPubkeyNoneOptional: scope vote to a specific token pair item

User commands

These commands are available to any user with a funded keypair.

deposit

Create a source-side deposit, escrowing tokens and creating a DepositEntry.

FlagTypeRequiredPurpose
--chain-idu16YesTarget bridge's chain ID
--mintPubkeyYesToken mint being deposited
--amountu64YesAmount to deposit (in sub-tokens)
--min-amountu64YesMinimum acceptable amount at destination
--destinationPubkeyYesDestination address on the other chain
--refund-toPubkeyNoOverride refund address (defaults to depositor)

Bridge-specific

The min-amount flag sets a floor for the destination-side result. If authorities determine the deliverable amount is below this threshold, the deposit may be rejected and the user will receive a refund at cleanup instead of a transfer. Set this thoughtfully — too high and the deposit risks rejection; too low and fees may consume more than expected.

withdraw

Execute a finalized withdrawal on the destination chain.

FlagTypeRequiredPurpose
--chain-idu16YesBridge chain ID
--entry-idu64YesWithdraw entry index to execute

This instruction is permissionless. It succeeds only if the WithdrawEntry at the given index is Finalized with DepositResult::Confirmed.

cleanup-deposit

Run cleanup on a finalized source-side deposit. Refunds fees and, for rejected deposits, returns escrowed tokens.

FlagTypeRequiredPurpose
--chain-idu16YesBridge chain ID
--entry-idu64YesDeposit entry index to clean up
--mintPubkeyYesToken mint of the deposit
--refund-toPubkeyYesAddress to receive refunds

This instruction is permissionless. It succeeds only if the DepositEntry is Finalized and cleanup_completed is false.

Authority commands

These commands require the signer to be a registered bridge authority. They are typically executed by the crank loop, but can be run manually for recovery or debugging.

ack-deposit

Acknowledge source-chain deposits and create/update destination-side withdraw entries.

FlagTypeRequiredPurpose
--source-chain-idu16YesChain ID of the source (where deposits exist)
--target-chain-idu16YesChain ID of the destination (where this command submits)
--source-urlURLYesRPC endpoint for the source chain

The command reads the source DepositTracker, compares it against the destination WithdrawTracker, and submits votes for any unacknowledged entries. The --url global flag should point to the destination chain's RPC.

ack-withdraw

Acknowledge destination-chain withdrawal results back on the source chain.

FlagTypeRequiredPurpose
--source-chain-idu16YesChain ID of the source (where this command submits)
--target-chain-idu16YesChain ID of the destination (where results exist)
--target-urlURLYesRPC endpoint for the destination chain

The command reads the destination WithdrawTracker, identifies finalized entries, and votes the observed results back onto the source DepositTracker. The --url global flag should point to the source chain's RPC.

Reading the CLI correctly

Bridge-specific

This CLI is not just a "bridge user tool." It exposes three distinct categories of action — user, authority, and governance — each with different trust requirements and operational contexts. Automation should treat them separately: user commands can be triggered by end-user wallets, authority commands should only run from secured operator infrastructure, and governance commands require multi-party coordination.

Zink is a general-purpose SVM network for programs, operators, and bridge integrations.