Liquid peg-ins require a moderate level of technical proficiency and around a day to confirm (102 Bitcoin blocks), therefore most users will prefer to acquire their Liquid Bitcoin (L-BTC) from a third party that handles the peg-ins for them.
Warning: Do not peg-in L-BTC without having a method of converting it back to BTC. L-BTC peg-outs can only be performed by a Liquid Federation member.
Preparation
Before you start the peg-in process, you will need to make sure you have the following prepared on your desktop computer:
- A Bitcoin node (Bitcoin Core) installed and fully synced
- A Liquid node (Elements Core) installed and fully synced
- Peg-in validation enabled on Elements Core
Step-by-Step Guide
1.
Run Elements Core, and open the console window: Window > Console.
2.
Get a peg-in address by using the following command in the terminal.
getpeginaddress
Warning: The duration between generating a peg-in address with ‘getpeginaddress’ and claiming it with ‘claimpegin’ should be kept as small as possible. Peg-in addresses are not long-term durable and should not be reused.
3.
Record the mainchain_address
and claim_script
values.
4.
Send the bitcoin to be converted to the mainchain_address
and record the transaction ID provided by your wallet.
5.
Wait for 102 confirmations on the Bitcoin blockchain. You can track the transaction on Blockstream Explorer.
6.
After the transaction has received 102 confirmations, run Bitcoin Core and open the console: Window > Console.
7.
Enter the following two commands in the console using the transaction ID recorded in Step 4. Record each result—you'll need these to claim the peg-in on Liquid.
getrawtransaction <yourTXID>
gettxoutproof '["<yourTXID>"]'
8.
Enter the following command in the Elements Core console to initiate a claim transaction on Liquid.
- Replace
<raw>
with the result fromgetrawtransaction <yourTXID>
in Step 7. - Replace
<proof>
with the result fromgettxoutproof '["<yourTXID>"]'
in Step 7. - Replace
<claim_script>
with theclaim_script
value obtained in Step 3.
claimpegin <raw> <proof> <claim_script>
9.
After the transaction confirms on the Liquid sidechain (around two minutes), your L-BTC balance in Elements Core should be updated.
All done! You now should have successfully converted your BTC to L-BTC using a peg-in.
Note: Unless you are Liquid Federation member, converting L-BTC back to BTC requires a third party. See our guide for a variety of methods on how to achieve this.