Skip to main content
Bitrune deposit addresses use a 2-of-2 MuSig2 Taproot structure with two time-locked script-path leaves for unilateral recovery. Under normal operations all spends use the MuSig2 key-path (faster, cheaper, and indistinguishable from a single-sig spend on-chain). The recovery paths exist as a safety mechanism for when cooperative spending is unavailable.

Address Structure

Each deposit address is a BIP-341 Taproot output with:
  • Key path: 2-of-2 MuSig2 aggregate of user + platform public keys
  • Leaf U (user recovery): user single-sig, timelocked (default ~30 days)
  • Leaf P (platform recovery): platform single-sig, timelocked (default ~60 days)

User Self-Recovery (Leaf U)

The user can recover funds without any platform cooperation after the CSV timelock expires. Default timelock: 4320 blocks (approximately 30 days) Eligibility: The CSV countdown begins when the deposit UTXO is confirmed on-chain, not when the deposit was initiated. Each deposit UTXO has its own independent countdown.
1

Check eligibility

Review your deposit UTXOs, their confirmation heights, and whether each UTXO has passed the CSV threshold. The confirmations field reflects actual on-chain confirmations.
2

Build the recovery spend plan

Construct a transaction spending the eligible UTXO(s) to a destination address controlled by the user. The transaction must set nSequence on each input to the CSV value (4320 by default) to satisfy the timelock.
3

Compute the sighash

Calculate the BIP-341 script-path sighash for Leaf U. This is a standard Taproot script-path spend, not a MuSig2 aggregation.
4

Sign with the user's private key

Produce a plain BIP-340 Schnorr signature over the sighash. No nonce exchange or partial-signature protocol is required.
5

Assemble the witness

The witness stack for a Taproot script-path spend is:
[signature, leaf_script, control_block]
  • signature — the BIP-340 Schnorr signature
  • leaf_script — the serialized Leaf U script
  • control_block — the Taproot control block proving Leaf U is committed in the Taproot tree
6

Broadcast

Submit the signed transaction directly to a Bitcoin node. No Bitrune interaction is needed for broadcast.

Platform Recovery (Leaf P)

The platform can recover funds from dormant accounts after a longer CSV timelock expires. Default timelock: 8640 blocks (approximately 60 days) This path is intended for accounts where the user has stopped interacting and funds would otherwise remain locked indefinitely.
  1. An administrator initiates recovery through the platform.
  2. The platform signs the transaction using Leaf P’s script path and broadcasts it.
  3. Recovered funds are returned to the platform treasury or forwarded according to the configured recovery policy.

Important Notes

CSV is per-UTXO. Each deposit creates a separate UTXO with its own confirmation height. A user with multiple deposits may have some UTXOs eligible for recovery while others are still timelocked.
  • Normal operations do not use recovery. The MuSig2 key-path is the default spending mechanism. It is cheaper (smaller witness), faster (no timelock wait), and private (looks like a single-sig Taproot spend).
  • Recovery is non-custodial for Leaf U. The user does not need the platform’s key, cooperation, or any interaction beyond the eligibility check.
  • Timelock values are fixed at address creation. The CSV block counts are embedded in the Taproot leaf scripts when the deposit address is generated. They cannot be changed after the fact.
  • Recovery does not affect LP positions. LP shares are tracked separately from deposit UTXOs. Recovering a deposit UTXO does not automatically withdraw any associated liquidity position.