StarkFiStarkFi

Confidential Tools

7 tools for privacy-preserving transfers via Tongo Cash — fund, transfer, withdraw, ragequit, rollover

Prerequisite: Confidential tools require an active authenticated session and Tongo configuration. Call get_auth_status first, then confidential_setup.

1. confidential_setup     →  One-time credential setup
2. confidential_balance   →  Check state before operations
3. confidential_fund      →  Move public tokens to private balance
4. confidential_transfer  →  Send tokens privately
5. confidential_rollover  →  Activate received pending balance
6. confidential_withdraw  →  Convert private balance to public
7. confidential_ragequit  →  Emergency full exit (if needed)

confidential_setup

Configures Tongo Cash credentials. The private key is stored locally and never sent to the network. Must be called before any other confidential tool.

Tip: Obtaining a Tongo Key Users can generate or export their 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.

ParamTypeRequiredDescription
tongo_keystringYesTongo private key (kept locally, never sent to network)
contract_addressstringYesTongo contract address on Starknet (0x…)

Important: This is a configuration tool. It writes credentials to local storage, not to the blockchain.


confidential_balance

Returns the confidential account state: active balance, pending balance, nonce, and Tongo address. Call this before fund/transfer/withdraw to verify current state.

No input parameters required.

This is a read-only tool — safe to call without user confirmation.


confidential_fund

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

ParamTypeRequiredDescription
amountstringYesAmount to fund (e.g. 100)
tokenstringNoToken symbol (default: USDC)
simulatebooleanNoSet true to estimate fees without sending a transaction

Important: This is a transactional tool. Always confirm with the user before moving funds.


confidential_transfer

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

ParamTypeRequiredDescription
amountstringYesAmount to transfer
recipient_xstringYesRecipient public key X coordinate (BigNumberish)
recipient_ystringYesRecipient public key Y coordinate (BigNumberish)
tokenstringNoToken symbol (default: USDC)
simulatebooleanNoSet true to estimate fees without sending a transaction

Important: This is a transactional tool. Always confirm the recipient public key and amount with the user before sending.


confidential_withdraw

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

ParamTypeRequiredDescription
amountstringYesAmount to withdraw
tostringNoRecipient Starknet address (default: own wallet)
tokenstringNoToken symbol (default: USDC)
simulatebooleanNoSet true to estimate fees without sending a transaction

Important: This is a transactional tool. Always confirm the withdrawal amount and recipient with the user.


confidential_ragequit

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

ParamTypeRequiredDescription
tostringNoRecipient Starknet address (default: own wallet)

Important: This is a destructive tool — it empties the entire confidential balance. Always warn the user and get explicit confirmation.


confidential_rollover

Activates pending confidential balance. Received transfers start as "pending" and must be rolled over to become spendable.

No input parameters required.

Tip: After confirming a confidential transfer was received, remind the user to call this tool to activate their pending balance.


CLI equivalent: Confidential Commands

Edit on GitHub

Last updated on

On this page