Bridging - Peg-in / Peg-out

Bridge User Manual

Looking for information on how to use the Bridge? Visit the Bridge documentation!

Botanix enables seamless movement of Bitcoin between the Bitcoin mainchain and the Botanix Layer 2 through a secure bridging mechanism. This chapter explains how users can deposit Bitcoin to receive tokens on Botanix (peg-in) and withdraw their tokens back to Bitcoin (peg-out), along with the security measures and federation processes that make this possible.

Overview of Botanix Bridging

The Botanix bridge maintains a 1:1 peg between Bitcoin on the mainchain and tokens on the Layer 2 network. When users deposit Bitcoin, an equivalent amount of tokens is minted on Botanix. When they withdraw, the tokens are burned on Botanix and the corresponding Bitcoin is released from the federation's multi-signature wallet.

This bidirectional bridge is secured by the 16-member federation through a 12-of-16 multi-signature scheme, ensuring that no single entity can unilaterally access user funds while providing sufficient redundancy for reliable operations. The bridge maintains strict accounting to ensure the total supply of Botanix tokens never exceeds the Bitcoin held in custody.

Peg-in Process: Bitcoin to Botanix

User Initiates Deposit

The peg-in process begins when a user wants to move Bitcoin to Botanix. The user connects their EVM wallet to the Botanix bridge interface, which generates a unique Bitcoin deposit address derived from their EVM wallet address. The user then sends Bitcoin to this personalized deposit address, eliminating the need for additional metadata or complex transaction formatting.

This deposit address derivation system creates a direct mapping between the user's EVM wallet and their Bitcoin deposit address, ensuring that deposits are automatically attributed to the correct Botanix address.

Bitcoin Network Confirmation

Once the user broadcasts their Bitcoin transaction to their derived deposit address, it enters the Bitcoin mempool and awaits confirmation by Bitcoin miners. The federation monitors the Bitcoin network for incoming transactions to all derived deposit addresses, automatically detecting deposits and associating them with the correct user accounts based on the address derivation system.

The federation waits for 18 Bitcoin confirmations to ensure the deposit transaction is sufficiently secure against potential reorganizations. This waiting period provides strong confidence in transaction finality and represents approximately 3 hours under normal Bitcoin network conditions.

Federation Verification

After the required Bitcoin confirmations, federation members begin the verification process. Each member independently verifies that the Bitcoin transaction is valid, sent to a properly derived deposit address, and meets all technical requirements.

The verification process includes checking the transaction's inclusion in the Bitcoin blockchain through cryptographic proofs, validating the transaction structure and signatures, and ensuring the deposit address derivation is mathematically correct. This comprehensive verification protects against various attack vectors and ensures only legitimate deposits are processed.

Proof Generation and Validation

Federation members verify cryptographic proofs demonstrating that a valid Bitcoin deposit has occurred to a properly derived address. These proofs include merkle tree proofs showing the transaction's inclusion in a Bitcoin block, along with the address derivation proof that links the deposit to the intended Botanix recipient.

The proof generation process involves creating a complete audit trail from the Bitcoin transaction to the intended Botanix mint operation. This includes block header information, merkle proofs, transaction details, and cryptographic verification of the address derivation to ensure accurate processing of the user's deposit. The proof is generated by the entity that is submitting the mint transaction, in our case Sidecar.

Token Minting on Botanix

The minting process begins when the user "claims" the funds on Botanix. During the claim process, Sidecar (and in the future, anyone using an SDK) creates the cryptographic proof and includes it in the peg-in transaction, then broadcasts this transaction to the federation. The federation members validate both the proof and the mint transaction simultaneously, and upon successful validation, authorize the creation of new tokens equivalent to the deposited Bitcoin amount on the Botanix minting contract.

The minting contract performs additional validation checks to prevent double-spending, ensures the proofs are properly formatted and verified, and maintains accurate accounting of the total token supply. Upon successful validation, new tokens are minted to the user's specified Botanix address, completing the peg-in process.

Transaction Cost Handling

The minting process includes mechanisms for handling transaction costs associated with processing the deposit. The system calculates the gas costs required for the minting operation and deducts these costs from the deposited amount, ensuring that users receive the net amount after accounting for processing fees.

A portion of the transaction costs is allocated to a refund address (typically controlled by the entity facilitating the deposit) to incentivize bridge operation and maintenance. This cost structure ensures sustainable operation while minimizing fees for users.

Peg-out Process: Botanix to Bitcoin

Withdrawal Request

The peg-out process begins when a user wants to withdraw tokens from Botanix back to Bitcoin. The user calls the burn function on the minting contract, specifying the amount to withdraw and providing their Bitcoin destination address along with any additional metadata required for the withdrawal.

The burn operation immediately removes the specified tokens from circulation on Botanix, reducing the total token supply to maintain the 1:1 peg with Bitcoin held in custody. The burn transaction also creates a withdrawal request that enters the federation's processing queue.

Federation Processing Queue

Federation members monitor the Botanix network for burn events and maintain a shared queue of pending withdrawal requests. Each member independently validates the burn transactions, confirms the legitimacy of the withdrawal requests, and prepares for the collective signing process required to release Bitcoin.

The processing queue operates on an epoch-based system. Epoch blocks are created every 10 Botanix blocks (roughly once a minute).

Bitcoin Transaction Creation

When processing withdrawals, federation members collaborate to create Bitcoin transactions that release funds to users' specified addresses. This process involves selecting appropriate UTXOs from the federation's Bitcoin holdings, calculating transaction fees, and creating outputs that match the withdrawal requests.

The transaction creation process must account for Bitcoin's UTXO model, ensuring efficient use of available UTXOs while minimizing transaction fees. Federation members also coordinate to include multiple withdrawal requests in single transactions when possible, reducing overall costs and improving efficiency.

FROST Signature Generation

The federation uses FROST (Flexible Round-Optimized Schnorr Threshold signatures) to collectively sign Bitcoin transactions without requiring all members to be online simultaneously. This threshold signature scheme allows any 12 of the 16 federation members to create valid signatures for Bitcoin transactions.

The FROST signing process involves multiple rounds of communication between federation members, where they share partial signatures and combine them into complete transaction signatures. This approach provides security through distribution while maintaining operational flexibility for handling member availability.

Bitcoin Network Broadcasting

Once the Bitcoin transaction is fully signed by at least 12 federation members, it is broadcast to the Bitcoin network for confirmation. The transaction releases the appropriate amount of Bitcoin to users' specified addresses, completing the withdrawal process.

Federation members monitor the Bitcoin network to confirm successful broadcast and track the transaction's confirmation status. Users can track their withdrawal transactions using standard Bitcoin block explorers and wallet software.

Finality and Confirmation

The peg-out process is considered complete once the Bitcoin transaction receives sufficient confirmations on the Bitcoin network. Users receive their Bitcoin at the specified addresses and can use it freely on the Bitcoin network or other platforms.

The federation maintains records of all completed withdrawals for auditing and reconciliation purposes, ensuring accurate accounting and enabling detection of any discrepancies in the bridging process.

Security Measures and Safeguards

Multi-signature Security

The 12-of-16 multi-signature requirement ensures that no small group of federation members can unilaterally access user funds. Even if several members are compromised or become unavailable, the bridge continues operating securely with the remaining honest members.

This threshold provides an optimal balance between security and operational efficiency, requiring sufficient consensus for legitimate operations while maintaining resilience against various failure modes and attack vectors.

Proof Validation

The bridge implements comprehensive cryptographic proof validation to prevent invalid deposits from being processed. All proofs must demonstrate valid Bitcoin transactions with proper confirmation depth and correct metadata formatting.

The validation process includes multiple independent checks by different federation members, ensuring that consensus is required not only for signing transactions but also for validating the legitimacy of bridge operations.

Supply Integrity

The bridge maintains strict accounting to ensure the total supply of tokens on Botanix never exceeds the Bitcoin held in custody. This 1:1 backing provides users with confidence that their tokens are fully collateralized by actual Bitcoin.

Regular audits and reconciliation processes verify the integrity of the supply relationship, with transparent reporting of Bitcoin holdings and token supply to enable community verification of the bridge's solvency.

Replay Protection

The system implements robust replay protection to prevent the same Bitcoin deposit from being processed multiple times. This includes tracking processed transactions, maintaining comprehensive records of completed operations, and implementing technical measures to detect and prevent duplicate processing.

The replay protection extends across different aspects of the bridge operation, ensuring that both peg-in and peg-out operations are processed exactly once and cannot be manipulated or duplicated by malicious actors.

Operational Considerations

Processing Times

Peg-in operations require 18 Bitcoin confirmations (approximately 3 hours) plus additional processing time for federation verification and proof generation. The total time from Bitcoin transaction broadcast to availability on Botanix is generally 3-4 hours under normal conditions.

Peg-out operations are processed in batches on every epoch block, which occurs every 10 Botanix blocks (roughly once every minute). Users can expect their withdrawal requests to be processed in the next epoch block after their burn transaction is confirmed. This means that a typical withdrawal takes about 1 minute plus the time it takes to be included in an L1 block.

Minimum Amounts and Fees

The bridge enforces minimum withdrawal amounts to ensure economic viability and prevent dust attacks. These minimums are set to cover transaction costs while remaining accessible to typical users.

Transaction fees for bridge operations are dynamically calculated based on current Bitcoin network conditions and operational costs. The fee structure is designed to ensure sustainable bridge operation while minimizing costs for users.

Monitoring and Support

Federation members continuously monitor bridge operations to ensure reliable service and quick resolution of any operational issues. This includes monitoring Bitcoin and Botanix networks, tracking transaction processing times, and maintaining system health metrics.

Users can monitor their bridge transactions through standard block explorers and dedicated bridge monitoring tools that provide real-time status updates for peg-in and peg-out operations.


The Botanix bridge provides secure, reliable transfer of Bitcoin between the mainchain and Layer 2, enabling users to access fast, low-cost transactions while maintaining the security and value backing of their Bitcoin holdings.

Last updated

Was this helpful?