Tldr; DeFi composability breaks in a multi-chain world, and crypto is yet to find a perfect fix to the cross-chain interoperability problem. However, using intents to emulate atomic execution via third parties could be a solution.
Key takeaways:
As crypto moves towards a world of multiple chains and Layer 2 scaling solutions, DeFi is becoming less composable since every chain has its own state.
Arbitrary Messaging Bridges do not solve the cross-chain interoperability problem because they do not allow atomicity like single chain DeFi does.
Using relayers to commit intents could make execution more atomic for the end user, but there are trade-offs.
Editor’s note: This piece was written as an expanded version of a tweet storm authored by UMA co-founder Hart Lambur. In it, Lambur applies his experience in the traditional finance space to make the case that using third parties to fulfill intents could make multi-chain DeFi more composable. Read the original piece here.
The crypto ecosystem is evolving fast. As DeFi expands and sophisticated MEV bots dominate Ethereum’s dark forest, many folks in the space have begun to embrace a new mental model: intents.
In Ethereum’s early years, users would execute transactions. Whether you were sending $ETH to your friend on mainnet, taking out a $DAI loan, or trading DeFi tokens on Uniswap, you were always making a transaction.
But as the ecosystem has grown, the way we think about execution has started to change. This is largely thanks to the evolution of DeFi. If you’re borrowing $DAI or trading $ETH for $AAVE, you’re not necessarily making just one transaction. You might take that $DAI and swap it for a new token on Layer 2, or there could be an opportunity to get yield on $AAVE that makes selling your $ETH worthwhile. Thanks to DeFi’s composability, users can stack their activities across “money legos” by generating multiple transactions atomically in one action. Now eight years into Ethereum’s story, the ecosystem has become much more complex.
For multi-step DeFi transactions, users can let the blockchain know what they want to happen, and slippage limits will protect them from overpaying on their order. Though the process is more complex than a simple transfer, the generation can still be thought of as a transaction.
In recent months, a growing number of researchers have begun exploring how intents alter Ethereum’s landscape. Intents slightly differ from transactions. When you submit an intent, you’re not ordering the blockchain to do something. You’re letting it know what you want to achieve once the transaction executes. Put another way, you ask for something to happen rather than telling it what to do. Justin Drake (Ethereum Foundation), Katie Chiou (Archetype VC), and Benjamin Funk (Archetype VC) have explored this concept in depth in recent months.
To date, intents have mostly been discussed with respect to MEV. But they could also solve one of crypto’s biggest challenges: the cross-chain interoperability problem.
DeFi and the cross-chain interoperability problem
For as long as DeFi has existed, its killer feature has been composability. We first saw evidence of this in the DeFi summer era, when hungry yield farmers would put together complex strategies to maximize returns on their holdings. These strategies involved multiple steps, but they always settled on mainnet.
DeFi composability is what allowed the proverbial 14-year-old kid to take out a $100 million flash loan on Aave, use the funds in a bunch of newer protocols, then pay back the loan and pocket the returns. Similar to the yield farmers, whizz kids like this would typically stay exclusively on mainnet.
That’s because in DeFi’s early years, there was Ethereum mainnet, and that was it. Now, Ethereum is making a shift towards Layer 2 rollups, and other networks have nurtured their own DeFi ecosystems.
In today’s multi-chain environment, DeFi composability starts to break. The yield farmers can’t easily take their yield and deploy it on Layer 2, and there’s no way for the 14-year-old to take out the $100 million loan and then use it on Cosmos or Solana.
When you’re interacting with a single chain, you get atomic execution. But as every chain has a different state, they can’t communicate with each other and preserve composability. If we are going to live in a multi-chain world, DeFi stands to become increasingly fragmented and less composable.
As it stands, the cross-chain interoperability problem is a threat to DeFi composability.
Relayers, rollups, AMBs, and sequencers
As the multi-chain ecosystem has expanded, different solutions have emerged to offer users a way to freely move their assets across multiple networks. Bridges have started to play a crucial role in the ecosystem as new networks have grown, but none of the current options are perfect. Vitalik Buterin and others have been vocal in pointing out bridge security risks in the past.
Across Protocol, a Layer 2 bridge powered by UMA’s optimistic oracle, offers interoperability across EVM-compatible networks. Across beats competing bridges on speed, cost, and security because it uses relayers to bear the bridgers’ risk. Still, you can’t use Across to get onto non-EVM networks, and even bridging from mainnet to Layer 2 involves navigating several steps.
Other projects use Arbitrary Messaging Bridges to communicate between chains. With AMBs, Alice sends a message indicating that she wants to move her tokens. The message gets validated by other parties securing the network, and then Alice can collect her funds on the other side. With LayerZero, for example, an oracle relays the message data and a relayer sends a transaction proof. The message arrives at the destination if the two match, and Alice collects the funds.
While AMBs improve connectivity between blockchains, they do not allow for atomicity. In Alice’s case, the only solution would be to block the state on the origin chain until the destination responds, but that’s clearly not going to work.
As Layer 2 rollups have started to gain pace, shared sequencers have shown promise for aggregating transactions across multiple networks. Shared sequencers can see the history for two chains. So if Bob wants to move his $ETH from Arbitrum to Optimism, he can do so with relative ease.
But as James Prestwich explains in this research piece, shared sequencers do not solve the cross-chain interoperability problem. Shared sequencers do not produce a relationship between multiple transactions.
This means that while they can interact with contracts and force transactions like moving $ETH or making a withdrawal, they cannot guarantee more complex activities that rely on smart contract interactions, such as swapping tokens, minting NFTs, or taking out loans. Another way of saying this is that they offer atomic inclusion, but not execution.
In short, while shared sequencing increases interoperability, it does not offer us multi-chain composable DeFi.
Using intents to emulate atomicity
Though atomicity starts to break in a cross-chain environment, we can use intents to emulate it so the process feels atomic to the end user.
Let’s say Alice wants to swap 100,000 $USDC on Ethereum for $ATOM at the best possible price. As the best price for $ATOM is on Cosmos, she has to move the funds across networks. This process has significant friction, and atomicity breaks as she moves off mainnet.
Alice’s goal here is to get as much $ATOM as possible with as little friction as possible. What if she could do this by specifying her intent?
Instead of telling the blockchain “I’ll give you 100,000 $USDC for the maximum amount of $ATOM I can get,” she says “I have 100,000 $USDC and I’m prepared to give you it for this much $ATOM.”
Alice can signal her intent to Bob, who executes the transactions on her behalf. Bob takes on the risk and does most of the heavy lifting — from Alice’s perspective, she just places a request for the amount of $ATOM she wants and then waits for the intent to be fulfilled.
In this example, Bob is a third-party actor that executes intents on Alice’s behalf. He can be thought of as a relayer or market maker. Using relayers in this way is exactly how we can emulate atomicity with intents.
Request-for-Quotes and hidden costs
While third-party relayers have not yet been explored to fulfill cross-chain intents, a similar format already exists in single-chain DeFi.
Users often use Request-for-Quotes (“RFQs”) to execute AMM swaps, and it’s a popularly held view that RFQs can benefit swappers. Ambient Finance founder Doug Colkitt penned a tweet storm outlining why this viewpoint is a fallacy, using an example of CEX:DEX arbitrage.
In summary, RFQ providers only have to improve on the AMM’s asset price as of the last block. If the price increases on the CEX, the RFQ provider will not fill the order. The transaction gets routed to the AMM, MEV bots then get into the top of the block and arb the price difference up to the CEX price. If the price decreases on the CEX, the RFQ providers will rush to sell. Any user who routes directly to the AMM will get into the block after MEV bots, who arb the price down to the CEX price. In this example, the user benefits from using the AMM over the RFQ provider.
When MEV bots dominate AMM pools, regular users take on a cost for using RFQ providers. This is worth noting with respect to using relayers to fulfill intents; one possible solution is to ask relayers to bid for the right to execute orders.
A centralization trade-off
There are other trade-offs to consider. An environment that allows relayers to profit from executing intents on behalf of smaller users increases centralization risk, as relayers would need significant capital to take on risk and fulfill every intent they receive.
Perhaps the best example of single-chain DeFi composability is the flash loan. The 14-year-old kid we met earlier can borrow unlimited capital and make a killing in one transaction. But if cross-chain DeFi starts using relayers, that 14-year-old kid won’t likely be able to fulfill intents unless they happen to be sitting on a big pile of $ETH.
We go back to a world of finance where only big capital can play the game.
As with CEX:DEX arbitrage today, an intents-based atomic execution system could become dominated by big players, increasing centralization in the ecosystem.
What’s the future of cross-chain composability?
While the multi-chain ecosystem is expanding and scalability is coming on Layer 2, it’s clear that the cross-chain interoperability problem remains unsolved. Embracing intents to enable cross-chain DeFi composability could be the answer.
Across and UMA could have a fitting role in this story. Across relayers effectively fulfill intents on behalf of bridge users, which could be extended into a framework that enables multi-chain DeFi. UMA’s optimistic oracle can also validate intent fulfillments, just as it validates Across’ relayer repayments today.
Throughout 2021 and beyond, crypto evangelists spoke of how the future would be multi-chain. It’s obvious that this thesis is already playing out, but we’re also seeing that the cross-chain interoperability problem is yet to be solved. In a multi-chain world, DeFi becomes less composable. Despite the drawbacks, using intents could bring us closer to a truly composable multi-chain DeFi ecosystem.
References
How intents can solve multi-chain DeFi composability (@hal2001/Hart Lambur at UMA)
The Definitive Guide to Sequencing (@_prestwich/James Prestwich)
The Little Transaction that Could: Sequencers, MEV, Intents, and more (@katiewav/Katie Chiou and @0xFunk/Benjamin Funk at Archetype VC)
How AMM swappers bear a hidden cost when using RFQ providers (@0xdoug/Doug Colkitt at Ambient Finance)
Why MEV Will Always Be Controversial — Ep. 482 (@drakefjustin/Justin Drake on Unchained)
Why the future will be multi-chain, but not cross-chain (@VitalikButerin/Vitalik Buterin)
Words by @dreamsofdefi