2. Unbond and Withdraw

Wait the end of the lock time

When your stakes reach the end of the locking time, you can just withdraw and you will receive all your funds back to your BTC wallet. (see Withdraw)

Early Unbonding

If you want to get your funds back before your funds are unlocked, you have to unbond them first. You will have to pay a slashing fee which is a percentage of the total amount staked.

POST /btc/baby/transaction/btc-unbond
{
  "stake_tx_hash": "fe5...",
}
{
  "unsigned_unbonding_psbt_hex": "73..."
}

Inputs required

  • stake_tx_hash: The BTC stake transaction hash

Output:

  • unsigned_unbonding_psbt_hex: The unsigned unbonding Psbt

Sign the Psbt and broadcast. Your funds will be locked for a certain amount of blocks. You can get the unbonding lock time in the params available at this endpoint (params) (unbonding_time_blocks). Please check for the params version corresponding to your delegation.

When the unbonding period is passed, call the withdraw endpoint (see Withdraw).

Withdraw

POST /btc/baby/transaction/btc-withdraw
{
  "stake_tx_hash": "fe5...",
  "fee_rate": 8
}
{
	"unsigned_tx_withdraw_psbt": "73..."
}

Inputs required

  • stake_tx_hash: The BTC stake transaction hash
  • fee_rate: The transaction fee rate in satoshis per byte.

Output:

  • unsigned_tx_withdraw_psbt: Psbt to sign to withdraw funds.

Sign the Psbt and broadcast the transaction, your funds should be back to your initial wallet.