How funding works
Shield Swap runs on the Aleo network and uses token records for private trading. Each record holds an amount your account can spend in a swap.To fund your trading account from a supported EVM chain or Solana, you bridge assets to Aleo, then convert the received public balance into token records. This conversion is called shielding. USDC can be bridged directly into USDCx records, without a separate shielding step.Once trading is complete, you can bridge your funds out to another supported chain. If your account already holds spendable token records, you can go straight to getting a quote.Check spendable funds
Prerequisites: Your account and trading clients from Setup:client for Typescript, dex for Python, or a configured CLI profile. For practice with test assets, use the separate testnet funding flow.Check your USDCx balance to decide whether you need funding or record preparation.- Typescript
- Python
- CLI
privateBalance is a decimal string in USDCx units. For example, "1" means 1 USDCx, not one base unit.Bridge assets
Use these mainnet examples to transfer ETH between Ethereum and Aleo through Hyperlane. Choose Typescript, Python, or REST, and use the same interface through delivery so you can track one transfer throughout.For the supported pairs and examples covering Solana, USDCx delivery modes, frontend integration, and embedded wallets, see the Bridging integration guide. Use the Shield Swap CLI to check balances before and after funding.1. Configure access
You need a source account that can sign the transfer and a destination address to receive it. Keep funds for network fees in the source account in addition to the transfer amount. When funding, use your mainnet Aleo account from Setup as the recipient.The examples below use private keys managed by your application. For a Dynamic or Privy signer, follow Use Embedded Wallets for bridging, then continue at route discovery.Your application must supply the keys, RPC URL, and wallet addresses from an external source, such as its configuration or a secret manager. The examples below use environment variables:- Typescript
- Python
- REST
Install the packages in an ES module application using Node.js 22 or later:You now have a mainnet
--legacy-peer-deps avoids a conflict between the bridge package’s optional Solana and server-wallet peers in npm.Connect your Aleo trading account and Ethereum signer to the bridge. Your Ethereum RPC connection handles chain reads and transaction submission:bridge client and Aleo account. Keep both in the same session for the Typescript steps that follow.2. Discover assets and routes
Prerequisites: Thebridge client or REST shell configuration from Configure access.A route identifies the asset and the provider that can move it between two chains. Discover routes to check where you can send your funds. Use the returned chain and asset identifiers when quoting; a symbol alone does not identify an asset across chains.- Typescript
- Python
- REST
assets lists the registered assets; inboundRoutes and outboundRoutes list routes in each direction. Check availability before quoting: metadata-required means deployment metadata is still needed.For an Aleo-to-Ethereum withdrawal, Hyperlane spends your public balance. If your ETH is held in records, unshield the withdrawal amount and wait for acceptance before quoting.
3. Request and review a quote
Prerequisites: The client or REST shell configuration from Configure access, a supported route from Discover assets and routes, and your recipient address.Request a quote to see how much your recipient can expect and the route fees before you move funds. Choose one direction below. Each example requests 0.01 ETH in display units, not base units.For an Ethereum destination, replaceETHEREUM_RECIPIENT with the receiving wallet’s Ethereum address. For an Aleo destination, the SDKs use your configured trading account. In REST, set SOURCE_ADDRESS and DESTINATION_ADDRESS to the wallets for your chosen direction.- Typescript
- Python
- REST
Ethereum to Aleo:
ETHEREUM_RECIPIENT:quote.plan contains the selected route, amount, and recipient. Review the returned fees and transfer details before using that plan to submit.4. Submit the reviewed transfer
Prerequisites: Your client from Configure access and thequote or QUOTES response you reviewed in Request and review a quote.Submission moves funds into the bridge. Save a reference so you can check delivery after a restart: the SDKs use checkpoints, while REST uses an order ID.- Typescript
- Python
- REST
Supply You receive
saveCheckpoint, your storage callback, before running this example. It receives a BridgeCheckpoint and must persist it before returning; it can return void or Promise<void>. The SDK has no default persistent store for this callback.execution.receipt, which identifies the submitted work for the delivery check. Some token routes require an approval before the transfer.5. Check delivery
Prerequisites: Your configured client and the submission result from Submit the reviewed transfer:quote.plan and execution.receipt for Typescript, progress for Python, or ORDER_ID for REST.Your source transaction can be confirmed while delivery is still pending. Check the existing transfer to see whether the destination has received the funds. These calls do not sign another transaction.- Typescript
- Python
- REST
progress.next to decide what to do:For Hyperlane withdrawals from Aleo, both SDKs can use the recipient’s balance increase to detect delivery. Spending from that destination account before the check can leave a delivered transfer marked as pending; unrelated incoming funds can also make the balance check misleading. Confirm the original transfer in the Hyperlane explorer and check its destination transaction before resubmitting or treating the balance change as proof.After inbound Hyperlane delivery, shield your public balance to prepare it for trading. After a withdrawal, check the destination receipt and recipient balance.
6. Recover an interrupted transfer
Prerequisites: Recreate the client from Configure access with the same account, then load the checkpoint or order ID saved during submission.You can inspect an interrupted transfer without sending funds again. Recovery uses its saved reference to find how far the original transfer progressed.- Typescript
- Python
- REST
Load
checkpoint, the BridgeCheckpoint object saved by your saveCheckpoint callback. Pass that object to your recreated client:recovered.next using the delivery result table. If it requests resume or complete, follow the route’s packaged example. A Circle mint using a secret nonce also needs the original nonce; retain it separately because checkpoints and public transaction history cannot reconstruct it.Shield public balances
Prerequisites: Yourbridge client from Configure access, plus a public ETH balance for shielding or a sufficient ETH record for unshielding.Shield the amount you want to trade after Hyperlane delivers it to your public balance. To withdraw through Hyperlane, unshield that amount instead. Unshielding exposes the recipient and amount in public balance state.Each example converts 0.01 ETH in display units and submits a separate transaction with a fee. The CLI and wallet services order endpoints do not provide this conversion.- Typescript
- Python
Use your configured mainnet client to shield 0.01 ETH:To unshield, supply You receive
record as an encoded plaintext string from your account’s record scanner. It must be an unspent ETH record covering at least 0.01 ETH:conversion.transactionId. Wait for acceptance before spending the converted amount. A connected wallet that supports record requests can select the record if you omit it; the local-key example supplies it explicitly.Request testnet tokens
Testnet prerequisites: The separate account and clients from the Developer Quickstart:client and account for Typescript, shield_swap_client for Python, or the CLI testnet profile. For the Python examples below, set dex = shield_swap_client.Use the faucet to practice without transferring mainnet assets. The SDK calls wait for the faucet transfer and its token records. With the Developer Quickstart’s delegated proving setup, you do not need a public ALEO balance.A faucet job can deliver USDCx even if another asset transfer fails. Check the same account’s USDCx records before requesting more tokens; an available record covering your input is enough to continue the testnet swap.- Typescript
- Python
- CLI
jobId to the job ID reported by the timeout, then inspect that request:Next steps
Get a trading quote
Use the Quote guide to find a pool and review a swap once your input is available in a record.Run packaged examples
Run a complete mainnet example for your chosen route. Each repository documents the accounts and connections you need.- Typescript
- Python
Follow the Typescript bridge examples README to configure your accounts, then run the ETH example for your direction from its example directory:You receive a quote without submitting funds. To execute, supply the acknowledgement documented in the example. The same directory covers USDC/USDCx routes and checkpoint recovery.
In the app
This section moves assets between another network and your confidential balance in Shield Wallet, using Fund Wallet in the Shield Swap app, and shows how to make an asset tradable if it arrived as a public balance.How funding works
Shield Swap trades from the confidential balance in Shield Wallet. Fund Wallet moves a supported asset from Ethereum or Solana into that balance, and moves it back out to a wallet on the other network.Each asset uses one bridge. USDC travels through Circle xReserve and arrives as USDCx. ETH, wBTC, USDT, and SOL travel through Hyperlane. The bridge decides the fee, the number of wallet signatures, and the time a transfer takes, and the review screen shows all three before you confirm.A transfer into Shield Wallet is paid in the asset you send. A Hyperlane transfer out of Shield Wallet is different: its fee is taken from your public ALEO balance, not from your confidential balance and not from the asset you are sending. If your public ALEO balance is empty, the transfer cannot start.The source transaction, the destination transaction, and the amount are public on both networks. Your Shield Wallet address is shown as the recipient on the review screen and in the public transfer.Move assets into Shield Wallet
Before you startYou’ll need:- Shield Wallet connected to Shield Swap. See Setup.
- A browser wallet for the source network, such as Rabby or MetaMask for Ethereum, holding the asset you want to move.
- Select Fund Wallet at the top right. The Bridge to Shield Swap panel opens.
- In You send, select Connect Wallet, then select your Ethereum or Solana wallet from the list and approve the connection in that wallet.
- In You send, select the asset and enter the amount. You receive shows the asset that will arrive in Shield Wallet and its current balance.
- Check the fee, the steps, and the estimated time shown under the amounts, then select the bridge button. Its label names the amount and asset, such as Bridge 5 USDC.
- In Review bridge, check the amounts, the fee, the steps, the estimated time, and that Recipient is your Shield Wallet address. Select Confirm & Bridge.
- Approve each request in your source wallet. A USDC transfer asks for two signatures, an approval and then the deposit. The Confirm in your wallet screen shows which step is waiting.
Move assets out of Shield Wallet
Before you startYou’ll need:- Shield Wallet connected to Shield Swap, with a confidential balance of the asset you want to move.
- A browser wallet on the destination network to receive the asset.
- For ETH, wBTC, USDT, or SOL: a public ALEO balance in Shield Wallet to pay the Hyperlane fee. To move ALEO from your confidential balance to your public balance, use Unshield in Shield Wallet. See Shielding and unshielding tokens in Shield.
- Select Fund Wallet at the top right.
- Select the arrow button between You send and You receive. The panel changes to Bridge from Shield Swap.
- In You send, select the asset and enter the amount.
- In You receive, select Connect Wallet, then select the destination wallet and approve the connection in that wallet.
- Check the fee and the estimated time, then select the bridge button.
- In Review bridge, check the amounts, the fee, and the destination address. Select Confirm & Bridge.
- Approve the request in Shield Wallet. The network fee for this request shows Covered by Shield.
Track a transfer
Your Bridging History at the bottom of the Fund Wallet page lists recent transfers. It needs both Shield Wallet and your Ethereum or Solana wallet connected. A transfer appears as soon as it is submitted, with its direction, amount, bridge, time, and transaction ID.A transfer continues after you close the progress window, change pages, or restart the browser. The progress window links to the source transaction on Etherscan while the transfer runs.The links at the bottom of the page open the bridges’ own sites: Hyperlane Bridge, USDCx Bridge, and Funding Routes, which lists other current routes.Move a public balance into your confidential balance
Shield Swap trades only from the confidential balance in Shield Wallet. If an asset arrived as a public balance, move it into your confidential balance first. Shield Wallet calls this shielding.Before you startYou’ll need: a public balance of the asset in Shield Wallet.- Open Shield Wallet and select Shield.
- Select the asset. The Public filter shows only assets with a public balance.
- With Shield selected at the top, enter the amount, or select 25%, 50%, 75%, or Max.
- Select Next.
- On the summary screen, check the amount, the network, and the estimated fee, then select Shield.
- Select Confirm.