Note: this blog post is adapted from my talk at SevenX Ventures Research Day. To watch the full video presentation, click here.
In the evolving landscape of blockchain and smart contracts, the concept of intents is gaining traction. Intents are not just about enhancing user experience or execution; they represent a fundamental shift in how we approach the design and implementation of protocols. This post will explore the mental models and practical steps for developers to build intent-centric protocols.
Understanding Intents
At its core, an intent is the declaration of a user's desired goal, without needing the user’s input on how to achieve that said goal. Intents are about the what, leaving the how to be dynamically executed by the underlying infrastructure powered by intelligent solvers.
It's akin to telling Siri what you want done, without needing to know the behind-the-scenes operations that make it happen. Another common comparison to the web2 world is telling your Uber driver the address of your desired location, without having to instruct them on the specific route to take.
Or in the world of artificial intelligence, it can be compared to AI agents.
From a developer’s standpoint, intents are more than a message signed by a user expressing an outcome. They also need to implement their application in the context of the request from the user. There are several frameworks for understanding intents, such as one from Anoma to define intents as "credible commitments to preferences and constraints over the space of possible state transitions."
The challenge for developers lies in translating this theoretical framework into practical applications for building intent-centric protocols.
Mental Models for Intents
One effective way to conceptualize intents is from the solver's perspective. In any intent-centric protocol, solvers are the entities that execute the intent, therefore the interfaces for an intent-centric protocol are necessarily identical to how it interacts with solvers.
Think of a solver as an Uber driver. The process involves:
1. Intent Expression: The user gives the solver a task.
2. Credible Commitments: The solver ensures payment is secured before starting the task.
3. Solving and Fulfillment: The solver figures out how to accomplish the task and executes it.
4. Settlement: The solver proves task completion and receives payment.
This perspective emphasizes verification and settlement, making intents inherently verification-based.
On-Chain and Off-Chain Logic
Building an intent-centric protocol involves both on-chain and off-chain logic:
On-Chain Logic: This is verification-centric. Users deposit funds into a contract (a "box"), which has a predicate function that determines whether the funds can be released. The function must return true or false, ensuring a clear outcome.
Off-Chain Logic: This is computation-centric. Solvers generate proofs to satisfy the predicate function, using external data and resources. This division allows solvers to operate with greater flexibility and intelligence, free from on-chain constraints.
At Khalani, we model intents as proof obligations. In other words, they are "service satisfaction requirements" that solvers must prove to the user to claim user payments.
In a single-chain workflow, the user signs a message with spending approval. The solver evaluates this message and proposes an on-chain transaction with a payload sent to the settlement contract. The contract then evaluates the predicate function that the user makes commitments towards, and if the conditions are met, the settlement is executed.
In cross-chain scenarios, we can't achieve atomic escrow of the user's funds and settlement evaluation within the same transaction. Therefore, we rely on an asynchronous settlement process facilitated by a cross-chain settlement oracle. Solvers must fulfill the user's requirements on the destination chain and depend on the settlement oracle to generate a proof for settling on the source chain to claim the user's funds.
Enforcing Preferences and Constraints
Preferences and constraints are crucial in intents. For example, a user might specify they want "at least 100 USDC but as much as possible in USDC". Multiple solvers can propose solutions for the intent, but we aim to find the best one for the user. To achieve this, a "counterparty selection" mechanism, such as RFQs (Request for Quotes), may be necessary. This component acts as a "sequencing solver" in the context of the user's intent.
The Magic of Off-Chain Solvers
Intents themselves are cryptic commitments, but the real magic happens with solvers. Solvers operate off-chain, accessing a wide array of resources:
Space and Time: Solvers can access all on-chain contracts, liquidity pools, and protocols, even across different chains.
Collaboration: Solvers can work together to have access to other solvers, pooling resources and intelligence to enhance solutions. A collaborative network of solvers is how Khalani aims to simplify solvers into on-chain software modules, each excelling at a specific task to tackle complex challenges by working together.
Dynamic Response: Solvers can react to on-chain and off-chain events, optimizing outcomes in real time.
Designing with Smart Solvers
Intent-centric protocols enable developers to build systems with the assumption that smart off-chain solvers will provide solutions. Treating intents as a protocol primitive can enhance user experience and foster innovative designs that remain underexplored in our industry.
For example, developers could allow liquidity providers to define market-making strategies as on-chain intents for more efficient capital utilization, with solvers handling the routing and optimization of on-chain liquidity positions. While building generalized solvers towards such flexible intent systems is typically a complex challenge, Khalani simplifies solver development by offering customized and composable solving capabilities tailored to each specific intent type.
Intents are Awesome
Intents represent a paradigm shift in how we build decentralized protocols. By focusing on verification and settlement, and leveraging the capabilities of smart solvers, developers can create more flexible, efficient, and user-friendly systems. As we continue to explore the potential of intent-centric protocols, the possibilities for innovation are vast.
In the world of blockchain, intents are paving the way for a more intelligent and adaptive future. By understanding and harnessing their potential, we can build systems that truly meet the needs of users and developers alike.
Ask yourself: how would you design your protocol if you could have the smartest solver possible and never have to worry about routing, solving, etc?
Khalani is the platform to make solver building 100x easier, with built-in collaborative solving. Follow our journey as it unfolds.
To watch the full video presentation at SevenX Research Day, click here.