History of Intents: The Past

Vavaenesh
Connext
Published in
6 min readMay 8, 2024

In the evolving landscape of blockchain technology, the concept of ‘intents’ is becoming increasingly central, especially as we push toward seamless interoperability between different blockchain networks. Understanding this concept begins with a look into its technological predecessors, which created the foundational principles for today’s sophisticated systems.

This article, the first in a three-part series, delves into the early technologies like Hashed Timelock Contracts (HTLCs), Atomic Swaps, and the Interledger Protocol (ILP), tracing their evolution and their pivotal roles in pioneering the path towards sophisticated intent-based systems we see today.

TL;DR:

  • HTLCs (Hashed Timelock Contracts) introduced secure, conditional blockchain transactions requiring cryptographic proofs and timed executions.
  • Building on HTLC technology, Atomic Swaps enhanced cross-domain cryptocurrency exchanges without intermediaries but faced challenges like coordination dependency and security risks.
  • As a response to the limitations of Atomic Swaps, the Interledger Protocol (ILP) proposed packetized payments for safer and continuous trading. However, despite its innovative approach to interoperability, ILP struggled with adoption.
  • From HTLCs to ILP, these early technologies laid the groundwork for today’s sophisticated, intent-based systems, paving the way for automated cross-domain transactions.

Hashed Timelock Contracts (HTLCs)

[1] What is a Point Time Lock Contract (PTLC)? by cygan

Concept and Mechanism

In short, a Hashed Timelock Contract (HTLC) is a type of smart contract that allows funds to be removed from the contract using a preimage of a hash after the Timelock reaches zero. HTLCs are primarily used to execute secure and trustless transactions between two parties.

The essence of an HTLC lies in its two main components: the hashlock and the timelock. The hashlock secures the transaction with a cryptographic hash that requires a specific preimage (original data used to create the hash) to be revealed for the transaction to proceed. The timelock ensures that if this condition isn’t met within a set timeframe, the funds revert to the sender, providing a safety mechanism against deadlock or abandonment.

Advantages and Limitations

Originally devised for Bitcoin, HTLCs were instrumental in many early blockchain applications. The primary advantage of using HTLCs was their ability to enable trustless transactions. Participants did not need to trust each other or a third party; instead, they relied on the immutable conditions of the contract. This not only enhanced security but also broadened the scope for automated, decentralized exchanges.

However, HTLCs were not without limitations. The requirement to reveal a cryptographic hash led to security concerns if the hash was prematurely exposed.

Atomic Swaps

In 2013, Tier Nolan devised the atomic swap, building directly on the principles of HTLCs. Atomic Swaps were designed to allow the exchange of one cryptocurrency for another across different blockchains without relying on centralized exchanges. These swaps used HTLCs to link transactions across different blockchains, ensuring that either both transactions succeeded or neither did, hence the term “atomic.”

The evolution of Atomic Swaps from a novel concept to a functional tool has significantly influenced the development of decentralized trading. Initially conceptualized for simple one-to-one exchanges, the technology grew to support more complex, automated swap processes between a wider range of cryptocurrencies and tokens.

Technical Deep Dive

An Atomic Swap consists of two HTLC contracts on different chains with the same hash and staggered expiry.

Let’s consider a scenario in which Alice and Bob decide to swap cryptocurrencies, such as Bitcoin and Litecoin, across different blockchains.

[2] Atomic Swaps: A Simple, Fair Exchange Protocol by Pierre NOIZAT

Here’s how the Atomic Swap transaction would unfold:

Step 1: Submitting Collateral

Once the two parties agree on the terms of the swap (i.e., how much of Token A will be exchanged for Token B), they can begin setting up the Atomic Swap.

  • First, Alice will deposit BTC onto an HTLC on the Bitcoin Blockchain.
  • In turn, Bob will then deposit LTC into an HTLC on Litecoin.

Step 2: Swapping Funds

Once both parties are sufficiently confident that the collateral has been submitted (i.e., after enough blocks have elapsed on each chain), they can begin the process of swapping.

  • Alice unlocks Bob’s LTC using the preimage of the hash used to construct the HLTC.
  • Doing this on-chain reveals the preimage to Bob, who can then use it to unlock Alice’s BTC on Bitcoin.

If Alice fails to reveal the preimage before the HTLC expires, the transaction simply expires and Alice/Bob can reclaim their funds from the HTLC.

The above process mirrors intent systems today. By creating and depositing into the HTLC on Bitcoin, Alice expresses her intent to swap BTC. However, in this system, Alice must find and coordinate with a counterparty upfront prior to depositing funds into the HTLC.

Limitations

Based on the example above, the subtle difference in needing upfront coordination to set up an atomic swap means that atomic swaps suffer from a 1:1 relationship dependency between counterparties. This presents a couple of significant challenges for Atomic Swap systems:

Liveness: If Bob goes offline after Alice deposits funds into her HTLC, Alice could be left stranded until her HTLC expires (which typically takes up to a week in the case of Bitcoin).

Free Option: Bob can opt out of the deal at no cost, giving him a Free Option to decide whether to go through with the swap with Alice. For instance, if the price of BTC moves unfavorably for Bob during the transaction, he can simply disappear, leaving Alice to waste time/gas. The Free Option issue is particularly crucial when swapping different assets asynchronously.

These challenges are explored in Dan Robinson’s paper: HTLCs Considered Harmful.

Interledger Protocol (ILP)

Conceptualization

Interledger Protocol (ILP) proposed packetized payments as an alternative model to address the Free Option concerns associated with Atomic Swap protocols. Instead of conducting a single swap between chains, ILP suggested dividing swaps into time-based streams of payments.

How ILP Worked

ILP operated using a simple yet powerful principle: connectors route packets of money across independent payment networks much like routers forward packets of data across the Internet.

[3] Trades between Alice and Bob on a continuous basis

In this scenario, Alice and Bob engage in continuous trading of BTC and LTC against each other over time at a specified rate (e.g., $100 per second). The rate determines the overall risk both parties undertake in the swap and can be adjusted according to time preference. If one party ceases swapping midway through the process (e.g., due to unfavorable price movement), only a portion of the swap is completed, allowing both parties to exit the arrangement.

Interledger solved the Free Option problem for Atomic Swap, but liveness requirements were increased as both parties needed to stay online while the swap took place.

Interledger Protocol Today

Unfortunately, ILP never received the adoption it deserved. This was partly because it relied on a complex HTLC construction to manage streaming payments.

While ILP may not be directly relevant for modern interoperability (as sending individual transactions like the example above incurs high overhead), this approach offers valuable insights. One significant lesson is that breaking down large cross-domain transactions into time-based flows could facilitate more efficient load balancing and offsetting of global funds movement across chains.

Conclusion

The journey from HTLCs to Atomic Swaps and the Interledger Protocol illustrates the trajectory of ever-increasing sophistication and utility in blockchain technologies. Each step in this evolution has brought us closer to a seamless and decentralized system of financial transactions across various blockchains and other financial systems. These technologies have laid the groundwork for the next generation of blockchain functionality, where intents — detailed, pre-defined conditions for transactions — are managed across multiple domains, paving the way for even more integrated and automated systems.

As we look forward to the developments in blockchain interoperability, it’s clear that the foundational work done by these early technologies will continue to influence future innovations. Stay tuned for the next article in our series, where we will explore the present state of intents and how they are being used today to create a more connected and efficient blockchain ecosystem.

About Connext

Connext is a network for fast, trustless communication between chains and rollups. It is the only interoperability system of its kind that does so cheaply and quickly without introducing any new trust assumptions. Connext is aimed at developers looking to build bridges and other natively crosschain applications.

Website / X / Discord / Blog / YouTube / Documentation / Github / Audit

--

--