Requesting a quote
A quote for Bitcoin can be requested using the same endpoints as EVM. The only difference will be the transaction data when source chain is Bitcoin.fromAddress when source chain is Bitcoin supports flexible formats for maximum convenience:- Single Bitcoin address:
bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh - Multiple addresses (semicolon-separated):
address1;address2;address3 - Extended public key (xpub):
xpub6CUG... - Multiple xpubs:
xpub1,xpub2 - Combination of xpubs and addresses:
xpub1;address1;address2
- Provided addresses directly, OR
- Addresses derived from the provided xpub(s) that contain UTXOs
fromAddress must have enough UTXOs to cover the requested transaction amount, otherwise no quote will be returned. UTXOs are checked and combined in the most efficient way to build the transaction.Transaction Signing: All input addresses (wallets) that contribute UTXOs to the transaction must sign the PSBT. This ensures that funds from each participating address are properly authorized.Refund Address: The third output in the PSBT is a refund/change output that will be returned to the address that contributed the most significant input to the transaction.Executing a transaction
Transaction data
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. The memo in the BTC transaction specifies the swap’s destination address and chain.
- 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 (~30min). It is always
recommended to request an up-to-date quote to ensure to get the latest
information.
data in transactionRequest object is PSBT (partially signed bitcoin
transaction) and memo needs to be retrieved from PSBT by decoding it.Retrieving memo from PSBT
PSBT can be decoded using any library like bitcoinjs or scure-btc-signer. Here’s an example usingbitcoinjs

