prepare_btc_lifi_swap
Build a PSBT to bridge native BTC to tokens on EVM chains or Solana via LiFi, with clear-signed outputs for Ledger hardware wallets.
Instructions
Build an unsigned Bitcoin PSBT-v0 that bridges native BTC to a token on another chain via LiFi's aggregator. LiFi auctions the route across intent solvers (NEAR Intents, Garden, Thorswap, Chainflip, Symbiosis, …) and returns a PSBT depositing to the chosen solver's vault address with an OP_RETURN memo committing to the cross-chain destination. Destinations: every EVM chain (ethereum/arbitrum/polygon/base/optimism) and Solana — TRON has no LiFi route from BTC and is rejected. Source-side scope (Phase 1, mirrors prepare_btc_send): native segwit and taproot only. Returns a 15-min handle the agent forwards to send_transaction; the Ledger BTC app clear-signs every output (vault deposit + OP_RETURN + change-back-to-source + LiFi fee output) on-screen, so there is NO blind-sign hash to pre-match in chat. The verification block surfaces the vault address, OP_RETURN bytes (hex + ASCII prefix), expected and minimum output on the destination, slippage, the chosen solver, and execution duration estimate. Server-side checks before forwarding: every PSBT input belongs to the source address, exactly one OP_RETURN output is present, the deposit output address matches the LiFi-advertised vault, and nonWitnessUtxo is hydrated on every input (Ledger 2.x rejects segwit/taproot inputs without it).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | Paired Bitcoin source address. Phase 1 source-side scope: native segwit (`bc1q…`) and taproot (`bc1p…`) only. Multi-source consolidation is out of scope here — LiFi runs its own UTXO scan against `fromAddress` and bakes the input set into the PSBT. | |
| toChain | Yes | Destination chain. EVM `SupportedChain` (ethereum/arbitrum/polygon/base/optimism) for an EVM bridge, or `"solana"` for native SOL/SPL delivery. TRON is NOT routable from BTC via LiFi (rejected with a clear error). | |
| toToken | Yes | Destination token. EVM hex when `toChain` is EVM; SPL mint (base58) when `toChain === "solana"`. `"native"` resolves to the chain's conventional native sentinel (`0x0…0` for EVM, wrapped-SOL mint for Solana). | |
| toAddress | Yes | Destination wallet — REQUIRED. The Bitcoin source address is not a valid recipient on any destination chain. Format must match the destination (Solana base58 for `"solana"`, EVM hex otherwise). | |
| amount | Yes | Decimal BTC string (up to 8 fractional digits, e.g. "0.005"). "max" is NOT supported — bridges commit to an exact deposit amount via the OP_RETURN memo at quote time, so the amount must be known up-front. | |
| slippageBps | No | Slippage tolerance in basis points (50 = 0.5%, 100 = 1%). Default ~50. Hard-capped at 500 (5%); above 100 (1%) requires `acknowledgeHighSlippage: true` to opt in. Cross-chain bridges may impose their own minimums above this. | |
| acknowledgeHighSlippage | No | Required when `slippageBps > 100`. Mirrors the `prepare_swap` guard — forces the caller to state that an unusually-high slippage is intentional. |