StarkFiStarkFi

Confidential Commands

Privacy-preserving transfers via Tongo Cash — fund, transfer, withdraw, ragequit, rollover

Prerequisite: All confidential commands require an active authenticated session and Tongo credentials. Run starkfi auth login first, then starkfi conf-setup.

Typical Flow

1. starkfi conf-setup --key <KEY> --contract <ADDR>  →  One-time credential setup
2. starkfi conf-balance                              →  Check state
3. starkfi conf-fund 100 --token USDC                →  Fund from public balance
4. starkfi conf-transfer 50 --recipient-x … --recipient-y …  →  Private transfer
5. starkfi conf-rollover                             →  Activate received balance
6. starkfi conf-withdraw 25                          →  Withdraw to public
7. starkfi conf-ragequit                             →  Emergency full exit

conf-setup

Configures Tongo Cash credentials. The private key is stored locally at ~/.local/share/starkfi/confidential.json with strict 0o600 permissions and is never sent to the network. Must be called before any other confidential command.

How to get a Tongo Key? You can generate or export your confidential Tongo private key through the Tongo Cash or refer to the Tongo Documentation for more details. Keep this key completely separate from your Starknet wallet key; treat it as sensitive data.

starkfi conf-setup --key <tongo_key> --contract <contract_address>

Flags:

FlagRequiredDescription
--key <key>YesTongo private key (kept locally)
--contract <address>YesTongo contract address on Starknet (0x…)

conf-balance

Returns the confidential account state: active balance, pending balance, nonce, and Tongo address.

starkfi conf-balance
starkfi conf-balance --json

Flags:

FlagDefaultDescription
--jsonfalseOutput raw JSON

conf-fund

Funds the confidential account by converting public ERC-20 tokens into private confidential balance.

starkfi conf-fund <amount> [flags]

Arguments:

ArgumentDescription
amountAmount to fund

Flags:

FlagDefaultDescription
--token <symbol>USDCToken symbol
--simulatefalseEstimate fees without executing
--jsonfalseOutput raw JSON

Examples:

starkfi conf-fund 100
starkfi conf-fund 50 --token USDC --simulate

conf-transfer

Sends tokens confidentially to another Tongo account. ZK proofs are generated locally and submitted on-chain. Recipient is identified by their elliptic curve public key coordinates (x, y), not a Starknet address.

starkfi conf-transfer <amount> --recipient-x <x> --recipient-y <y> [flags]

Arguments:

ArgumentDescription
amountAmount to transfer

Flags:

FlagRequiredDefaultDescription
--recipient-x <x>YesRecipient public key X coordinate
--recipient-y <y>YesRecipient public key Y coordinate
--token <symbol>NoUSDCToken symbol
--simulateNofalseEstimate fees without executing
--jsonNofalseOutput raw JSON

Examples:

starkfi conf-transfer 50 --recipient-x 0xABC --recipient-y 0xDEF
starkfi conf-transfer 25 --recipient-x 0xABC --recipient-y 0xDEF --simulate

conf-withdraw

Withdraws from confidential account to a public Starknet address. Converts private balance back to public ERC-20 tokens.

starkfi conf-withdraw <amount> [flags]

Arguments:

ArgumentDescription
amountAmount to withdraw

Flags:

FlagDefaultDescription
--to <address>Own walletRecipient Starknet address
--token <symbol>USDCToken symbol
--simulatefalseEstimate fees without executing
--jsonfalseOutput raw JSON

Examples:

starkfi conf-withdraw 100
starkfi conf-withdraw 50 --to 0x1234… --simulate

conf-ragequit

Emergency exit — withdraws the entire confidential balance to a public address. Use only when you need to exit immediately.

starkfi conf-ragequit [flags]

Flags:

FlagDefaultDescription
--to <address>Own walletRecipient Starknet address
--jsonfalseOutput raw JSON

Examples:

starkfi conf-ragequit
starkfi conf-ragequit --to 0x1234…

conf-rollover

Activates pending confidential balance. When you receive a confidential transfer, it starts as pending and must be rolled over before it becomes spendable.

starkfi conf-rollover
starkfi conf-rollover --json

Key Concepts

ConceptDescription
Active balanceSpendable confidential tokens
Pending balanceReceived transfers waiting for rollover
RagequitEmergency full withdrawal to a public address
RolloverConverts pending → active balance
RecipientIdentified by elliptic curve point (x, y), not a Starknet address

MCP equivalent: Confidential Toolsconfidential_setup, confidential_fund, confidential_transfer, confidential_withdraw, confidential_ragequit, confidential_rollover

Edit on GitHub

Last updated on

On this page