BitFlow: A Bitcoin Native Decentralized Exchange Using sBTC
by Grant Nissly on February 26, 2024
BitFlow Finance is a decentralized exchange (DEX) for Bitcoiners.

Bitflow Finance offers many features to Bitcoin holders, like trustless, decentralized, efficient, and secure trading, real yield, and single-sided liquidity. And unlike centralized exchanges (CEXs) like Binance, Coinbase, or Kraken, BitFlow enables non-custodial peer-to-peer trading of crypto assets — there is no centralized authority.

DEXs are playing an increasingly important role in the crypto industry — as noted in Hiro's “A Developer’s Guide to Bitcoin DeFi” the DEX to CEX spot trade volume has grown from about 0.94% in May 2020 to 12.63% in May 2022.

But building a decentralized exchange is not easy. This post shows how Stacks and sBTC enable BitFlow to bring a DEX to Bitcoin.
Building a Bitcoin DEX is Not Easy
BitFlow made two important design decisions.

  1. Build a secure and trusted decentralized crypto exchange (not a centralized exchange)
  2. Build the exchange on top of Bitcoin (not other blockchains like Ethereum)
Decentralized, not Centralized
Exchanges have become the defining face of the crypto industry, providing users with an easy way to buy, sell, and trade digital currencies.

CoinMarketCap lists over 200+ crypto exchanges with varying levels of traffic, trading volumes, and liquidity. However, most crypto exchanges are centralized, meaning a single entity operates them.

Centralized exchanges are dangerous. The collapse of FTX, a centralized exchange, taught the industry that trusting an exchange with custody of your assets is a risky endeavor.

To overcome this, BitFlow is building a decentralized exchange that provides users with financial inclusivity, quick liquidity, security, and 100% transparency, without an intermediary.
Bitcoin > other blockchains
In addition to a decentralized exchange, BitFlow decided to build its DEX with Bitcoin as the base layer. Why?

Bitcoin's (intended) limitations
Bitcoin’s decentralization, simplicity, and security make it the best place to build. However, these attributes come at a cost.

1. Limited Smart Contract Functionality
Bitcoin's scripting language is limited and does not natively support smart contracts. Rather than using an account model that enables smart contracts, Bitcoin uses an unspent transaction output (UTXO) model. The UTXO model makes smart contracts difficult. In addition, Bitcoin Script is a limited programming language that prevents on-chain smart contracts altogether.

2. Slow Confirmation Times
When compared to other blockchains, Bitcoin is slow. The Bitcoin network takes about 10 minutes to confirm a transaction. And, to ensure security, the network generally needs 6 confirmations before considering the transaction complete. As a general approximation, Bitcoin transactions take about an hour to complete.

This slow confirmation time is a major roadblock when building a decentralized exchange with users expecting fast settlement.

3. Scalability Issues and High Transaction Fees
Bitcoin’s block size and block time design constraints limit its transaction throughput, resulting in high transaction fees. As more people want to use the network, the fees increase. It is highly unlikely that these design parameters will change. As such, small or frequent transactions critical to building applications on Bitcoin are cost-prohibitive.

These attributes make building a DEX at Bitcoin’s base layer difficult.
The solution: sBTC integration
Bitflow saw an opportunity to build a decentralized exchange on Bitcoin. However, Bitcoin’s design made building a DEX difficult.

So, they turned to Bitcoin Layers, specifically the Stacks Bitcoin Layer 2, along with its upcoming sBTC release, to realize their vision.

Stacks and sBTC unlock Bitcoin's full potential for DeFi by making trust-minimized smart contracts possible on Bitcoin. With these new capabilities, Bitflow can build a decentralized exchange on Bitcoin.

While building DeFi on Bitcoin is technically possible without sBTC, it is not ideal. Current solutions, like Wrapped Bitcoin, rely on a trusted federation of custodians to bridge or peg into a tokenized Bitcoin.

sBTC differentiates itself as the first genuinely decentralized, non-custodial Bitcoin asset.

In combination with Stacks, sBTC will introduce a trustless two-way peg between Bitcoin and a tokenized Bitcoin. This allows for the seamless movement of 1:1 Bitcoin-backed assets in and out of smart contracts while ensuring trustless writes to Bitcoin’s base layer.

While most two-way Bitcoin pegs are trusted, sBTC creates an open membership, dynamically changing, decentralized signer set.

sBTC leverages Stacks’ Nakamoto Release for improved transaction security and speed — sBTC inherits 100% of Bitcoin’s security budget and increases transaction time from 10 minutes to roughly 5 seconds.

So, sBTC solves the 3 major downsides of building a DEX on Bitcoin.

  1. Smart Contract Functionality. sBTC solves the Bitcoin write problem: smart contracts can programmatically send sBTC to a BTC address. This allows smart contracts outside of BTC to effectively write to Bitcoin.
  2. Fast Confirmation Times. sBTC will enable fast block confirmation, with transactions mined and confirmed within seconds instead of minutes. This upgrade will make a truly decentralized DEX on Bitcoin finally possible.
  3. Low Transaction Fees. sBTC and Nakamoto will increase the efficiency and throughput of transactions on Stacks and ultimately on Bitcoin.

With sBTC, Bitflow is able to unlock Bitcoin’s full potential with a decentralized exchange on Bitcoin.
Bitflow is busy building
Stacks is planning to launch sBTC following the Nakamoto upgrade, which will take place between April 15-19, 2024. However, Bitflow got the opportunity to experiment with it early.

Bitflow participated in the sBTC Testnet on Stacks — a developer release that allowed select developers to build and test with an early version of sBTC.
On Testnet, Bitflow launched sBTC Swaps. sBTC Swaps unlock a powerful feature to Bitflow users — safe and reliable BTC yield on BTC holdings.

Through sBTC Swaps, Bitflow tested new pool pairs like xBTC/sBTC. This pool enables users to trade and earn a yield on their holdings in a trustless manner, with all rewards claimable in BTC.

Outside of sBTC Testnet, Bitflow is gaining traction.

They recently closed on a $1.3M pre-seed funding round and went live on Stacks mainnet on December 28, 2023. They passed $4M TVL by late January 2024, $10M TVL by early February 2024, and $30M TVL by mid-February.
Initially, the Bitflow team is building a DEX focused on stablecoin trading pairs, similar to Curve in the Ethereum ecosystem.

Bitflow is focusing on three main offerings to start.

  1. Trade Stablecoins: Seamless, low-cost, and efficient trades amongst various stablecoins in the Bitcoin ecosystem. (For example: stSTX, STX, USDA, sUSDT, xUSD, xBTC, aBTC, UWU, USDC, and wBTC).
  2. Bitcoin Swaps: Bitflow’s StableSwap enables productive and frictionless use of Bitcoin-wrapped or pegged assets, like sBTC, xBTC, aBTC, and native Bitcoin assets.
  3. Earn Real Yield: Earn yield derived from trading activity. And with Bitflow’s sBTC integration, users will earn native BTC yield.
Check out the application and explore what a Bitcoin decentralized exchange looks like.
Unlocking Bitcoin DeFi
BitFlow Finance, a pioneer in decentralized Bitcoin exchanges, is excited about the potential of sBTC as a groundbreaking solution to overcome the challenges of building a DEX on Bitcoin.

By building on sBTC, and leveraging the Stacks Bitcoin Layer 2, BitFlow Finance can offer decentralized, efficient, and secure trading, real yield, and single-sided liquidity, all without the need for intermediaries.

BitFlow Finance's recent fundraise and TVL traction underscore the company's commitment to revolutionizing the Bitcoin decentralized exchange landscape while embracing the potential of sBTC for DeFi.