Bitcoin Integration Layer

The Bitcoin Integration Layer is responsible for anchoring IBVM state to the Bitcoin blockchain and managing the movement of BTC between the base layer and IBVM.

BTC Bridge Protocol

The bridge protocol uses a combination of threshold signatures and time-locked contracts to enable secure deposits and withdrawals.

Deposit Process

  1. User initiates deposit by sending BTC to a special bridge address

  2. Bridge monitors for deposit transactions on the Bitcoin blockchain

  3. Upon confirmation (typically 6 blocks), the bridge contract mints equivalent BTC tokens on IBVM

  4. The deposit is recorded in the IBVM state with a reference to the Bitcoin transaction

Mathematical representation:

  • Let $TX_{BTC}$ be the Bitcoin transaction

  • Let $Addr_{bridge}$ be the bridge address

  • Let $Amount_{BTC}$ be the deposit amount

  • Let $User_{addr}$ be the user's IBVM address

The bridge contract executes: $IBVM.mint(User_{addr}, Amount_{BTC}) \iff TX_{BTC}.recipient = Addr_{bridge} \land TX_{BTC}.confirmations \geq 6$

Withdrawal Process

  1. User initiates withdrawal from IBVM

  2. System burns the equivalent BTC tokens on IBVM

  3. Bridge validators sign a multi-signature transaction

  4. After the challenge period expires, BTC is released to the user's Bitcoin address

Mathematical representation:

  • Let $H_s$ be the IBVM state root before withdrawal

  • Let $H_{s'}$ be the IBVM state root after withdrawal

  • Let $Proof_w$ be the validity proof for the withdrawal

  • Let $Addr_{BTC}$ be the recipient's Bitcoin address

The bridge validators verify: $Verify(H_s, H_{s'}, Proof_w) = true$

Then execute: $TX_{withdrawal} = Sign_{threshold}(Addr_{BTC}, Amount_{BTC})$

Commitment Scheme

The commitment scheme anchors IBVM state roots to the Bitcoin blockchain, using an efficient representation to minimize on-chain data.

  1. The state root $H_s$ is a Merkle root of all accounts and their states in IBVM

  2. For each batch of transactions, a new state root $H_{s'}$ is computed

  3. A ZK-SNARK proof $\pi$ is generated that verifies the correctness of the state transition from $H_s$ to $H_{s'}$

  4. The commitment $C = Hash(H_{s'} || \pi)$ is stored on the Bitcoin blockchain

This commitment uses OP_RETURN or Taproot to store the minimal footprint on Bitcoin:

OP_RETURN <IBVM_IDENTIFIER> <BATCH_ID> <STATE_ROOT_HASH> <VALIDITY_PROOF_HASH>

Last updated