Requesting Bitcoin-specific information via the API
Chains
Tools
Tokens
Token details
Requesting a Quote
Bitcoin to Ethereum
The quote and advanced route calls target the same transfer but differ in shape:GET /quote accepts query parameters such as fromChain and fromToken, whereas POST /advanced/routes expects a JSON body with fields like fromChainId and fromTokenAddress.
Ethereum to Bitcoin
Executing the transaction
Building Custom Bitcoin Transactions
Partners may want to build custom Bitcoin transactions to select specific UTXOs for various reasons such as coin control, UTXO consolidation, or fee optimization. Requirements when building custom transactions:- Preserve the exact output structure and order from the API response
- Ensure selected UTXOs have sufficient value to cover:
- Bridge deposit amount (1st output)
- Refund output if required by the bridge (3rd output, must be above dust threshold)
- Integrator fees (additional outputs)
Transaction Data
BTC to Ethereum, Avalanche, or BNB Smart Chain (BSC) After retrieving the quote, the funds need to be sent to the BTC vault address provided in the response, along with a memo. Memo Functionality: Similar to Thorchain, LI.FI uses memos for BTC to EVM swaps. Depending on the tool, the memo in the BTC transaction specifies the bridge-specific tx data to execute and internal LI.FI details for the tracking. Transaction Handling: The transaction that leaves BTC and goes to EVM needs to be sent to an EVM address. The memo ensures that the swap details are correctly processed by the validators.NOTE: Only send transactions in a timely manner (~30 min). It is always
recommended to request an up-to-date quote to ensure to get the latest
information.
Extracting Transaction Data from PSBT
When building custom Bitcoin transactions with selected UTXOs, partners need to extract the memo and other transaction details from the PSBT (Partially Signed Bitcoin Transaction) returned by the API. Key Information:- The memo is contained in the OP_RETURN output (2nd output) of the PSBT
- This memo must be preserved exactly as provided - it contains bridge-specific calldata and LI.FI tracking details
- The depositor address is in the 1st output
- The refund address (if required) is in the 3rd output
Bitcoin transaction requirements per tool
The general requirements for the outputs structure are the following:- 1st output: Bridged amount sent to the bridge depositor address
- 2nd output: OP_RETURN containing the memo with bridge-specific and LI.FI tracking details (must be preserved exactly)
- 3rd output: Refund output back to sender’s address (optional for some bridges, mandatory for others - see details below)
- Remaining outputs: Integrator-specific fee transfers
- Pay To Witness Public Key Hash (p2wpkh) - 294 sats
- Pay To Witness Script Hash (p2wsh) - 330 sats
- Pay To Script Hash (p2sh) - 540 sats
- Pay To Public Key Hash (p2pkh) - 546 sats
- Pay To Taproot (p2tr) - 330 sats

