In a recent Coindesk opinion piece, Kyle Samani (co-founder and Managing Partner at Multicoin Capital) explores how many blockchains might use cross-blockchain messaging or atomic swaps to interwork. As he argues, blockchain interoperability is virtually non-existent today.
“If you want to move value across chains, you must do so by moving tokens into a centralized exchange, trade on the exchange’s in-house ledger and then withdraw the new asset on a new chain. This process is slow, expensive and involves substantial counterparty risk. Fundamentally, there are two types of chain interoperability:
- “cross-blockchain messaging (relaying messages about the state of one chain to another); this can include synthetic tokens (or one-to-one pegs, two-way pegs, or sidechains)
- “cross-blockchain atomic swaps where there is an exchange of tokens between users across chains, without trusting a third-party.”
Cross-block chain messaging
Cross-blockchain messaging involves fundamental trust. How does one design a system to trustlessly relay messages between blockchains?
This is especially difficult given what Samani refers to as orphan chain risk. “If a service relays the state of blocchain A to blockchain B, but it turns out that the relayer was on a fork of blockchain A that is ultimately orphaned (either benignly or maliciously), then the relayed message to Chain B is invalid.
“If one is relaying messages to issue synthetic tokens across chains, this would result in cross-chain double spends, which is unacceptable. Accommodating the perpetual ‘what if the relayer is on an orphaned fork’ risk is by far the greatest challenge in message-relaying systems.
“Cosmos and Polkadot address the orphaned-chain problem through two mechanisms. First, using the inter-blockchain communication (IBC) protocol, they store Merkle-ized block headers for each cross-chain transaction. Building on a history of Merkle-ized block headers, Cosmos/Polkadot maintain global invariant balances of the total supply of each token. Together these mechanisms prevent cross-chain double spends.
“It would be nice if systems such as Oraclize could relay messages between chains. But these kinds of systems don’t account for the orphaned chain problem.”
Even with a finality guarantee, as Samani says, there are other challenges. “We’re currently witnessing a Cambrian explosion of blockchain innovation. This is likely to continue for the next few years at a minimum. Given the number of new chains that are emerging, each chain will be required to store and validate Merkle-ized block headers of every other chain with which it communicates. Each blockchain could become bloated with blockheaders of every other chain. Using a bridge chain reduces the bloat per chain from a function of n! to to a function of n.
“While I’d like to see a future in which blockchains communicate directly with one another without an intermediary chain, this seems highly unlikely. This problem is compounded by the fact that systems such as bitcoin may never move off of proof-of-work (PoW) consensus and towards PoS consensus with guaranteed finality.”
What are cross-blockchain atomic swaps?
Samani explains: “The first cross-chain atomic swap recently occurred between Litecoin and Decred. These are both chains that don’t support Turing-complete programming languages.
“Cross-chain atomic swaps will be technically easier to implement between general-purpose smart contract platforms. It will take another one or two years for these libraries to mature and become widely adopted, but they will. There aren’t many technical questions remaining.
“The other major challenge with cross-chain atomic swaps is price discovery and order matching. That’s where decentralized exchanges (DEX) such as 0x and OmiseGo come into play. OmiseGo is fully decentralized, meaning that the order book lives on chain. In 0x, orders are hosted by relayers (centralized entities), who then submit matched orders to the chain for settlement.
“If the market ultimately demands DEXs to be fully decentralized – including on-chain order books – then systems like OmiseGo will be necessary for cross-chain atomic swaps to function. However, given the intrinsic limitations of on-chain order books (settlement time, miner front-running, miner griefing, etc), I believe that the 0x model will prevail for the foreseeable future.
“Although 0x only works within the ethereum ecosystem today, the 0x roadmap includes cross-chain* support (it will likely leverage much of the tech built in the Litecoin-Decred proof of concept for Scrypt based chains). 0x relayers will host order books for price discovery, and will relay messages between chains to trigger the release of funds from the escrow on each chain. This should offer many of the best elements of decentralization (no counterparty risk) and centralization (speed, order matching), with minimal trust guarantees (only that the relayer actually relays the messages to both chains).”
“With the Cosmos launch approaching in the next month or two, we’re about to witness a huge hype cycle about the opportunity for an internet of blockchains. Systems like Cosmos solve fundamental cross-chain communication problems, but aren’t necessarily the answer to all cross-chain communication challenges.
“It’s paramount to recognize that not everything these systems can do actually needs doing by a chain of chains. As the crypto ecosystem evolves, expect more diversity in trust models, relayers and solutions broadly.”
What does this mean
Samani argues that “If we look out into the future, it’s possible to envision a time in which the orphaned chain problem is solved by the sending chain itself. How? By leveraging finality in proof-of-stake (PoS) based systems. This is the explicit purpose of Casper FFG, which is in alpha now. However, it’s unclear how fast finality can be given tradeoffs in parametrizing such a PoS system.”
Yet he also comments that cross-blockchain atomic swaps “are only possible if both chains offer a native escrow function. This requires bitcoin-esque script functions at a minimum. Some chains, such as IOTA and sia, for example, don’t support on-chain trustless escrows at all, and as such cannot implement trustless cross-chain atomic swaps. (In effect,) one of the greatest limitations of cross-chain atomic swaps is settlement time. By definition, these transactions can only settle as fast as the block time of the slower of the two chains. Block Collider’s system allows for settlements that are theoretically even faster than the block times of either chain. Enabling cross-chain swaps to settle more quickly than the block times of either chain is a pretty wild idea. Given how slow bitcoin blocks are, Block Collider could carve out an interesting niche.”
The important words here are ‘escrow function’. This is also where the Interledger Protocol can operate, with its exploitation of a sophisticated escrow model.
There is little doubt that ‘inter-blockchain’ connections are an imperative for progress. In the helter-skelter pursuit of the single ‘Satoshi blockchain model’, there has been too little consideration of how to connect different blockchains. As Mr Samani’s description conveys, this is changing. Enterprises should delight, though practical delivery will be some way off.