Skip to main content

BTC Restaking (Babylon)

The x/babylon module integrates QoreChain with the Babylon Protocol to inherit Bitcoin's proof-of-work finality guarantees. Through BTC restaking, QoreChain gains a secondary finality layer backed by Bitcoin's hashrate — without requiring any changes to the Bitcoin protocol itself.

Overview

Babylon Protocol enables proof-of-stake chains to leverage Bitcoin's security through a timestamping and checkpointing mechanism. QoreChain's integration works as follows:

  1. BTC stakers lock Bitcoin in Babylon staking transactions and register their positions on QoreChain.
  2. Epoch checkpoints from QoreChain are periodically relayed to Babylon, which timestamps them on Bitcoin.
  3. Finality inheritance: Once a QoreChain epoch is checkpointed on Bitcoin, the state covered by that epoch inherits Bitcoin's proof-of-work finality guarantees.

This provides a defense against long-range attacks and equivocation that is anchored to Bitcoin's accumulated hashrate rather than relying solely on QoreChain's own validator set.

BTC Staking Positions

Users can register BTC staking positions on QoreChain by submitting a MsgBTCRestake transaction that references a Bitcoin staking transaction.

Registration Requirements

ParameterValueDescription
Minimum stake100,000 satoshis (0.001 BTC)Minimum BTC required per staking position
Unbonding period144 BTC blocks (~1 day)Waiting period before staked BTC can be withdrawn
Checkpoint intervalEvery 10 QoreChain epochsHow often state is checkpointed to Babylon

Staking Position Structure

Each BTC staking position tracks the following on-chain state:

FieldDescription
staker_addressQoreChain address of the staker (qor1...)
btc_tx_hashBitcoin transaction hash of the staking transaction
amount_satoshisAmount of BTC staked in satoshis
statusPosition lifecycle state: active, unbonding, or withdrawn
staked_atTimestamp of position registration
unbonding_heightBlock height at which unbonding was initiated (if applicable)
validator_addrQoreChain validator address this stake is delegated to

Registration Flow

  1. Create BTC staking transaction — On the Bitcoin network, create the BTC staking transaction.
  2. Submit MsgBTCRestake on QoreChain — On QoreChain, submit MsgBTCRestake with btc_tx_hash, amount, and validator.
  3. Position recorded — The position is recorded on-chain as "active".

Epoch Checkpoints

QoreChain's epoch state roots are periodically checkpointed to Bitcoin through the Babylon relay chain.

Checkpoint Flow

  1. Submit checkpoint — A QoreChain validator submits MsgSubmitBTCCheckpoint containing the epoch number, BTC block hash, BTC block height, and QoreChain state root.
  2. IBC relay — The checkpoint data is relayed to the Babylon chain via IBC.
  3. Timestamping on Bitcoin — Babylon includes the checkpoint in a Bitcoin transaction, anchoring QoreChain's state to Bitcoin's blockchain.
  4. Confirmation — Once the Bitcoin transaction is confirmed, finality flows back through Babylon to QoreChain.
  5. Finalization — The checkpoint status transitions from pending to confirmed to finalized.

Checkpoint Structure

FieldDescription
epoch_numQoreChain epoch number being checkpointed
btc_block_hashBitcoin block hash containing the checkpoint
btc_block_heightBitcoin block height
state_rootQoreChain state root at the epoch boundary
submitted_atTimestamp of checkpoint submission
statusCheckpoint state: pending, confirmed, or finalized

Epoch Snapshots

At each checkpoint boundary, an epoch snapshot captures aggregate network state:

FieldDescription
total_stakedTotal BTC staked across all positions (satoshis)
active_positionsNumber of active staking positions
validator_countNumber of validators with BTC-backed delegations
block_heightQoreChain block height at snapshot

Secondary Finality Layer

The Babylon integration provides a secondary finality guarantee that complements QoreChain's native consensus finality:

Finality LayerSourceSpeedSecurity
PrimaryQoreChain Consensus Engine~5 secondsBacked by QOR stake + PQC signatures
SecondaryBabylon + Bitcoin~60 minutesBacked by Bitcoin's cumulative hashrate

The secondary layer is particularly valuable for:

  • Long-range attack prevention: Even if an attacker accumulates significant QOR stake, they cannot rewrite history that has been checkpointed on Bitcoin.
  • Cross-chain bridge security: Bridge operations involving large values can wait for Bitcoin-level finality before releasing funds.
  • Institutional confidence: The Bitcoin timestamp provides an independently verifiable proof of QoreChain's state history.

Configuration

ParameterDefaultDescription
enabledfalseMaster switch for BTC restaking features
min_stake_amount100,000 satoshisMinimum BTC per staking position
unbonding_period144 BTC blocksBTC-denominated unbonding duration
checkpoint_interval10 epochsEpochs between Babylon checkpoints
babylon_chain_idbbn-1Chain ID of the connected Babylon network

Events

The module emits the following on-chain events:

Event TypeAttributesDescription
btc_restakestaker, btc_tx_hash, amount, validatorNew BTC staking position registered
btc_unbondstaker, amountBTC staking position entered unbonding
btc_checkpointepoch, checkpoint_idEpoch checkpoint submitted to Babylon
babylon_epoch_completeepochBabylon epoch finalized with Bitcoin timestamp

API Endpoints

REST

MethodEndpointDescription
GET/babylon/v1/staking/{address}Get BTC staking positions for an address
GET/babylon/v1/checkpoint/{epoch}Get checkpoint data for a specific epoch
GET/babylon/v1/paramsGet module configuration parameters

JSON-RPC

MethodParametersDescription
qor_getBTCStakingPositionaddress (string)Returns the BTC staking position for the given QoreChain address

CLI Commands

Query Commands

# Query BTC restaking configuration
qorechaind query babylon config

# Query a staking position by address
qorechaind query babylon position <staker-address>

Transaction Commands

# Register a BTC restaking position
qorechaind tx babylon restake \
--btc-tx-hash <hash> \
--amount-satoshis <amount> \
--validator <qorvaloper1...> \
--from <key-name>

# Submit a BTC checkpoint
qorechaind tx babylon submit-checkpoint \
--epoch <epoch-number> \
--btc-block-hash <hash> \
--btc-block-height <height> \
--state-root <root> \
--from <key-name>