Cryptocurrency is no stranger to theft — hackers stole over $4 billion through cryptocurrency crimes in the first half of 2019 alone. To prevent these hacks, it’s essential that traders move to decentralized blockchain exchanges, which provide a level of security that larger centralized exchanges can’t.

However, existing decentralized exchanges haven been unable to successfully handle Bitcoin, as they lack full smart contract support. Fortunately, new state channel technology has emerged to solve this problem, making Bitcoin trading safer and more efficient than ever before.

The Challenge

Cross-chain is a problem for decentralized exchanges (DEXes), and Bitcoin is especially difficult to integrate into DEXes since it lacks full smart contract support.

One solution is “token wrapping” or creating a representation of Bitcoin on another blockchain, such as “wrapped Bitcoin” on Ethereum.

When you trade wrapped Bitcoin, your real Bitcoin is left with a custodian outside the wrapped Bitcoin smart contract. If a custodian is compromised, the Bitcoin that backs the wrapped token could be stolen, whether the custodian is a centralized party or not. Alternatively, an attacker could mint unlimited amounts of the wrapped token to destroy its value.

Atomic swaps are another proposed solution. These are noncustodial but cannot scale to large, fast-moving markets with order books.

For an atomic swap to be safe, both trading parties must monitor chains closely throughout the entire transaction, meaning that a user needs to know in advance when exactly an order will be filled. This defeats the point of orders placed above or below the current price level, which constitute most of the volume on a large exchange.

Atomic swaps are more like an over-the-counter deal, which is more suited for infrequent block trades, not day-to-day user activity. Their speed disadvantage means market efficiency is compromised and true market price is hard to achieve. The resulting setup can be very discouraging for price-sensitive traders.

A Solution

An initial version of a noncustodial protocol based on state channels will allow users to trade real (not wrapped) Bitcoin at speeds that compete with centralized exchanges, offering genuine markets with order books.

To do this, an exchange can employ a fast, off-chain matching engine that manages state channels across different blockchains. Users make trades, and the matching engine updates their balances for each blockchain, which are periodically written to the chain itself. This avoids speed bottlenecks that result from blockchain architecture. User balances can only be updated when they have provided cryptographic signatures for individual trades, so funds are always under the user’s control.

This is a noncustodial system that bypasses the speed and compatibility limits of individual blockchains while making small sacrifices in decentralization. To counteract these, it’s imperative to employ a provably fair system.

Bitcoin does not support full smart contracts, but it does offer more simple hashed time-locked contracts (HTLCs) and other scripting primitives. These form the basis of the Lightning Network, a state channel solution for Bitcoin allowing faster asset transfers.

This solution represents a new Bitcoin trading protocol that offers security with no significant performance cost. Once a Bitcoin trading state channel is open, the experience is like trading on a centralized exchange.