WWW.AUSTRICH.NET

Peg-in BTC to L-BTC With Umbrel


Based on Blockstream’s documentation (https://help.blockstream.com/hc/en-us/articles/900000632703-How-do-I-peg-in-BTC-to-the-Liquid-Network-), modified for Umbrel.

Create a wallet (named “test” in this example)

~/umbrel/scripts/app compose elements exec node elements-cli -rpcuser=elements -rpcpassword=<rpc password> createwallet test
{
  "name": "test",
  "warning": ""
}

Get peg-in address:

~/umbrel/scripts/app compose elements exec node elements-cli -rpcuser=elements -rpcpassword=<rpc password> getpeginaddress
{
  "mainchain_address": "<btc address>",
  "claim_script": "<claim script>"
}

Take note of the returned <btc address> and <claim script>

Send BTC on-chain to <btc address>. Take note of the transaction ID <tx id>. Monitor in the mempool and wait for 102 confirmations (about 17 hours).

Get the transaction details:

~/umbrel/scripts/app compose bitcoin exec bitcoind bitcoin-cli getrawtransaction <txid>
<raw>

~/umbrel/scripts/app compose bitcoin exec bitcoind bitcoin-cli gettxoutproof '["<txid>"]'
<proof>

Claim the L-BTC

~/umbrel/scripts/app compose elements exec node elements-cli -rpcuser=elements -rpcpassword=<rpc password> claimpegin <raw> <proof> <claim script>

Check the L-BTC balance

~/umbrel/scripts/app compose elements exec node elements-cli -rpcuser=elements -rpcpassword=<rpc password> getbalances
{
  "mine": {
    "trusted": {
      "bitcoin": X.XXXXXXXX
    },
    "untrusted_pending": {
      "bitcoin": 0.00000000
    },
    "immature": {
      "bitcoin": 0.00000000
    }
  }
}

Send L-BTC to another wallet (35000 SATs in this example)

~/umbrel/scripts/app compose elements exec node elements-cli -rpcuser=elements -rpcpassword=<rpc password> sendtoaddress <liquid address> 0.00035000 "" "" true
<L-BTC txid>

Check the transaction using Liquid Explorer