Withdrawal Guide

This guide covers the withdrawal process from Citrea back to Bitcoin using Clementine CLI. Withdrawals follow a specific sequential process.

All available withdrawal commands can be viewed using clementine-cli withdraw --help command and clementine-cli withdraw <subcommand> --help.

triangle-exclamation

Prerequisites

Before starting a withdrawal, ensure you have:

  • A Clementine CLI wallet with withdrawal purpose ("wit" prefix address) which will be used as the signer address

  • A Bitcoin address where funds will be sent (destination address)

  • Access to Citrea wallet with 10 cBTC to withdraw. This can be on a MultiSig or an EOA wallet.

Withdrawal Process Overview

The withdrawal process follows these sequential steps:

  1. Create Withdrawal Wallet - Create a withdrawal wallet for the signer address

  2. Start Withdrawal - Initiate withdrawal process (prompts for Bitcoin transaction)

  3. Send Bitcoin Transaction - Send 330 sats to the signer address to create withdrawal UTXO

  4. Scan for Withdrawals - Find available withdrawal UTXOs

  5. Generate Withdrawal Signatures - Create signatures for optimistic and operator-paid withdrawals

  6. Send - Send withdrawal request with signature to Citrea for optimistic withdrawal along with sending 10 cBTC to the bridge contract for registration of the withdrawal operation. After successful optimistic withdrawal, you will receive your ~10 BTC on your Bitcoin address.

  7. Check Status - Monitor withdrawal progress for optimistic withdrawal for 12 hours

  8. Send Signature to Operators - If Step 6 fails, submit signature to Clementine operators for operator-paid withdrawal

  9. Check Status - Monitor withdrawal progress for operator-paid withdrawal

circle-exclamation

Step 1: Create a Wallet for Withdrawal

A new address for withdrawal is required:

Example:

For more detailed wallet usage, please check the wallet documentation.

Step 2: Start Withdrawal

Start the withdrawal process:

Parameters:

  • SIGNER_ADDRESS: Withdrawal wallet address with "wit" prefix

  • DESTINATION_ADDRESS: Bitcoin address where funds will be sent

Example:

This command will prompt the user to send 330 sats to the signer address to create the dust UTXO needed for the withdrawal operation.

circle-exclamation

Important: After running this command, you'll need to send the prompted Bitcoin transaction to the signer address before proceeding.

Step 3: Send Required Bitcoin Transaction

Send 0.00000330 BTC to the prompted address given by the start command to create your withdrawal UTXO.

circle-info

You'll notice the address used in the command above matches your signer address but lacks the wit prefix. This is intentionalβ€”the prefix is only needed for Clementine-specific operations, whereas regular transactions use the address in its standard form.

circle-exclamation

This creates the small UTXO needed for the withdrawal operation.

Step 4: Scan for Withdrawals

Scan for available withdrawal UTXOs:

Example:

What this command does:

The scan command provides detailed information about your withdrawal:

  • Why: Explains that it's locating UTXOs to withdraw funds from Citrea back to Bitcoin

  • Where: Displays the Bitcoin network, signer address, destination address, and expected UTXO amount

  • When: Shows block height and confirmation status of each found UTXO, indicating whether they're ready for withdrawal or still pending confirmation

The command will:

  1. Scan the Bitcoin network for UTXOs at your signer address

  2. Display detailed information about each UTXO including:

    • OutPoint (transaction ID and output index)

    • Amount in BTC and satoshis

    • Block height (if confirmed) or mempool status (if unconfirmed)

    • Current status (ready for withdrawal or waiting for confirmation)

  3. Filter and identify UTXOs that match the expected dust amount

  4. Filter UTXOs that are already used in a withdrawal operation, and warn user not to reuse their signer address

  5. Provide the exact command to generate withdrawal signatures for each valid UTXO

circle-check

Step 5: Generate Withdrawal Signatures

Generate the signatures for optimistic withdrawal and operator-paid withdrawal using your Clementine CLI wallet.

This command will generate two signatures: one for optimistic withdrawal (which has an exact amount of 999999760 satoshis, or 9.9999976 BTC), and one for operator-paid withdrawal (which has an exact amount of 997000000 satoshis, or 9.97 BTC).

Example:

triangle-exclamation

Step 6: Send 10 cBTC to the Bridge Contract

Send 10 cBTC to the bridge contract for registration of the withdrawal operation. After successful optimistic withdrawal, you will receive your ~10 BTC on your Bitcoin address.

Run the following command to open the webpage where you can send the 10 cBTC to the bridge contract along with the generated withdrawal signature that will be used for optimistic withdrawal.

Example:

Step 7: Check Withdrawal Status

Monitor the status of your withdrawal:

Parameters:

  • WITHDRAWAL_UTXO: Withdrawal UTXO in txid:vout format

Example:

The status will show the response from the backend.

Step 8: Send the Signature to the Operators

If the optimistic withdrawal does not complete within 12 hours, submit the generated operator-paid withdrawal signature to bridge operators for operator-paid withdrawal processing:

Example:

circle-info

After sending the operator-paid signature, Clementine Operators will validate and process the withdrawal. Use Step 7 to monitor the status.

Troubleshooting

  • Address rejected: DESTINATION_ADDRESS must be a normal Bitcoin address without the wit/dep prefix and not one of your Clementine wallet addresses.

  • No valid UTXOs found in withdraw scan: the dust UTXO must be confirmed and match dust_utxo_amount.

  • Signature rejected: regenerate signatures with the exact WITHDRAWAL_UTXO from scan and use the optimistic signature for withdraw send or the operator-paid signature for send-withdrawal-signature-to-operators.

Last updated

Was this helpful?