Skip to content

Advanced bark

There are two additional bark features that we don't expect most users will ever need to do, but that advanced users might want to try out:

  • Boarding: Taking on-chain bitcoin off-chain, onto an Ark.
  • Unilateral exit: Taking off-chain bitcoin on-chain, without any cooperation from the Ark server.

Boarding

We expect most users will receive their first sats over Ark directly, in the same way you received yours from our faucet. But it is definitely possible to move your on-chain funds into the Ark as well—we call it boarding!

Boarding is currently only possible from within bark's internal on-chain wallet. So for you to try it out, you need to have an on-chain balance.

Check your on-chain balance using:

bark onchain balance

If you don't have any, our faucet can help you out. Grab an on-chain address from your bark wallet:

bark onchain address
Then use the faucet to send some on-chain (signet) sats to this address.

You can use bark balance to double-check they've arrived.

Once you have some on-chain sats, you can board the Ark:

# Board entire on-chain balance
bark board --all

# Board a specified amount
bark board "10000 sat"

After boarding, you should see that you now have a new VTXO with the type board:

bark vtxos

You've successfully taken your on-chain bitcoin off-chain!

Unilateral exit

Finally, let's walk through performing a unilateral exit.

This process requires broadcasting multiple transactions sequentially, so please allocate 1-2 hours to complete this test.

Note

We're currently addressing some known issues with unilateral exits that may occur in certain edge cases. Let us know if you need help.

What you'll need

To get started, you will need the following:

  • At least one VTXO
  • At least 15,000 on-chain sats per VTXO you're exiting (just to be on the safe side!)
  • Make sure you have at least one confirmation each on-chain UTXO. Check this using bark onchain utxos or at mempool.space.
  • Patience

Under the hood

Each of your VTXOs consists of a series of off-chain transactions that must be broadcast to retrieve your sats on-chain.

The unilateral exit process will work as follows:

  • Each of the transactions in your unilateral exit will have to be broadcast and confirmed using a child-pays-for-parent transaction (CPFP).
  • Each child transaction has to wait an average of 10 minutes for its parent to confirm.
  • Once the final transaction of a VTXO's exit is confirmed, you will have to wait for a timelock to expire. The timelock is 12 blocks or about two hours.

Note

If you are using your own bitcoin node instead of the esplora backend, make sure the -txindex is enabled.

Performing the exit

First, you'll need to mark one or more VTXOs that you'd like to exit.

Mark a single VTXO for exit

bark exit start --vtxo <your_vtxo_id>

Mark multiple VTXOs for exit

bark exit start --vtxo <your_first_vtxo_id> --vtxo <your_second_vtxo_id>

Mark all VTXOs in your wallet for exit

bark exit start --all

Initiate your exits

Run the following command to begin the exit process:

bark exit progress --wait

Exits are a multi-step process, requiring multiple transactions broadcast in sequence, so the --wait flag ensures the operation will keep running until the entire VTXO has been exited. We'd recommend going to get a coffee while you wait!

Note

Be aware that you might see some scary logging, this does not necessarily mean that your exit will not succeed, often the process will automatically recover (e.g., retrying after an additional confirmation). If you really want to dig deeper, use the --verbose flag to follow everything that happens under the hood.

Claiming funds from a completed exit

Once an exit reaches a spendable state (has been fully exited and exists on the blockchain), you must also "claim" it. Basically, when you unilaterally exit a VTXO, it doesn't become a part of your wallet, instead your bark wallet just knows how to spend the newly published onchain UTXO. If you attempt to recover your bark wallet from a seed phrase you will be unable to recover your unclaimed exits. Don't worry though, claiming your funds is really simple:

Get an onchain address from your wallet

bark onchain address

Claim unilateral exits using your onchain address

bark exit claim <your_onchain_address> --vtxo <your_exited_vtxo_id>

When claiming an exit, you can either specify the --vtxo flag multiple times or just use the --all flag.

Checking the status of an exit

If you are ever confused about the status of your exit, or you are having issues which need debugging, you can use one of the following commands:

bark exit list
bark exit status <your_vtxo_id>

Both commands support the --transactions and --history flags which can be extremely helpful when debugging issues.