Docs
  • Overview
  • Our Product Suite
    • Fiamma Bridge (Trust-minimized Bitcoin Bridge, Powered by BitVM2)
      • Introduction
      • Fiamma Bridge Status
      • Consensus Proof
      • Fungible Transfer
      • Multi-Operators
      • Permissionless Challenger
      • Yield opportunities
        • Operator
        • Challenger
        • Fungibility Provider
      • User Guides
        • Testnet Alpha
        • Testnet Beta
          • How to Deposit and Withdraw on Fiamma Bridge?
          • How to run the Fiamma Operator?
            • Operator for Mac
              • 1. Install Fiamma Operator App
              • 2. Register
              • 3. Deposit and Stake BTC
              • 4. Start & Pause Operator
              • 5. Quit Operator and Withdraw Funds
            • Operator for Linux
              • 1. Install and Set Up Fiamma Operator Backend Program
              • 2. Start and Register
              • 3. Deposit and Stake
              • 4. Query Operator Status
              • 5. Manage the Operator Program
              • 6. Quit Operator
              • 7. Troubleshooting
          • How to run a challenger?
    • Fiamma Layer (BitVM-Powered Settlement Layer)
      • Introduction
        • Key Highlights
        • Challenges Tackled
        • Core Technologies
      • Architecture
        • General Flow (Soft Finality)
          • For Programmable Blockchains
          • For Non-Programmable Blockchains :
        • ZKP Verification Process
      • Ecosystem Layout
      • User Guides
        • QuickStart
        • Installation
        • Wallet and Tokens
          • Connect Keplr Wallet
          • Get $FIA
        • Manage Keys
        • Fiamma Testnet Explorer
      • Developer Guides
        • Network Information
        • Fiamma CLI
          • CLI Command Overview
          • CLI Tutorial
        • Fiamma-Committee CLI
        • Run a Fiamma Node
          • Set up a Node
          • Getting Testnet Tokens
          • Become a Bitvm Staker
          • Become a Validator
        • Rest API And GRPC
        • Fiamma ZKPVerify SDK
        • Supported ProofSystem
      • Roadmap
    • Other Essential Protocols
  • Support
Powered by GitBook
On this page
  • Overall flow
  • Abnormal case 1
  • Abnormal case 2
  • Abnormal case 3
  • Forced exit module with fungible case
Edit on GitHub
  1. Our Product Suite
  2. Fiamma Bridge (Trust-minimized Bitcoin Bridge, Powered by BitVM2)

Fungible Transfer

It's an important module in BitVM2-based trustless bridge design. In this section, we will describe how to support fungible transfer. It should be noted that design still being optimized.

PreviousConsensus ProofNextMulti-Operators

Last updated 6 months ago

Overall flow

There are 4 scenarios that we have to consider:

  1. Normal case: Mike could PEG-OUT successfully with 10 BTC

  2. Abnormal case 1: The amount that Jane wants to PEG-OUT exceeds the maximum value (102 BTC > 100 BTC)

  3. Abnormal case 2: The amount that Bob wants to PEG-OUT doesn't exist currently (0.5 BTC does not exist)

  4. Abnormal case 3: Some wrapped BTC were transferred to the Burn address (0.5 BTC in the Burn address)

Then how can we solve these problems?

Abnormal case 1

This case could be easily solved. We set up the maximum limitation for the PEG-IN process. But maybe one user on the sidechain might get more wrapped BTC and then plan to PEG-OUT. So, for this case, the user has to PEG-OUT all the wrapped BTC with a few separate transactions.

However, we will provide an additional approach (liquidity provider) to improve the user experience.

So, in this approach, the user could directly peg-out with the help of LP (liquidity provider). The LP should get more fees and the users should pay it.

Abnormal case 2

Ideally, we hope that the amount distribution between bitcoin and sidechain should be like this:

In this scenario, everyone could PEG-OUT smoothly. But in the real case, most of the amount is not the same

To solve this problem, we use a few ways:

  1. Support a wider range of amount types;

  2. Introduce the roles of liquidity providers-- they could get some tokens and additional fees as rewards;

There is a little difference between Abnormal Case 2 and Abnormal Case 1. In Abnormal Case 2: the user does not need to pay additional fees for the LP In Abnormal Case 1: the user does need to pay additional fees for the LP

Now, the overall flow should be like in the following picture:

Abnormal case 3

If there is some wrapped BTC transferred to a burn (black hole) address by accident. This means that there will be some BTC locked in Bridge.

The good thing is that the LPs can also help users take BTC back only if they can provide proof to prove that they really transferred some wrapped BTC to this address.

In this case, we have to ensure the burn address is a black hole address, like the 0x00...000 address.

Forced exit module with fungible case

In the normal case, the receiver (operator) is deterministic at the pre-signed phase and each operator will maintain a transaction list (all transactions that the receiver is himself) to know how much BTC he can take.

For example: Operator A could take 100 BTC Operator B could take 50 BTC

It means there are 150 wrapped BTC in the sidechain total, but now operator A is offline. So for operator B, it could only pay 50BTC. For other users, they can not PEG-OUT successfully unless Operator A is online again.

To solve this problem, we introduce the forced exit module for users. The general idea is the user will pre-sign a few additional transactions with the bridge committee but not specify the receiver (SIGHHASH_NONE). But the condition is, that the user has to provide a valid proof for the burn transaction, otherwise, he cannot take the BTC back

A more radical approach:

In the normal case, the receiver (operator) is non-deterministic at the pre-signed phase and all operators share a common BTC pool they can take.

For example: Operator A could take 100 BTC Operator B could take the same 100 BTC as well

So the advantage is that only one operator is honest. All users could peg out smoothly

But let's assume all operators are offline, we should support forced exit module as well.