"Intelligent Automation" Era: Can Intent Trading and AI Agents Spark Innovation?
Author: LT, EthosLau
Introduction
Many experts and industry leaders, including Ethereum founder Vitalik Buterin and the Paradigm team, believe that intent-centric transactions will become one of the important directions for the future development of blockchain applications. In our article, we explore the concept of intent transactions and their potential, analyzing how this model can simplify user experience, enhance transaction security, and bring more innovative opportunities to decentralized applications. We also discuss the role of AI agents, exploring how they can combine with intent transactions to further promote the automation and intelligence of smart contracts, providing users with a more intelligent and personalized blockchain interaction experience.
What are Intent Transactions
When you want to hail a ride, you open a ride-hailing app, and after selecting your starting point, a price range appears at the bottom of the screen for you to set; when you use a food delivery app to order food, after searching for similar items, the interface provides filtering options for price, time, distance, etc. In this scenario, "what do I want to buy," combined with time and price constraints, constitutes a transaction intent. Nowadays, many apps add options to allow customers to fill in their "intent" to facilitate usage. Of course, intent does not only include the preset transaction price; price is the most commonly used parameter in intent.
In the context of blockchain, intent-based transactions refer to users executing blockchain operations in a goal-oriented manner. In this process, users only express their ultimate goals (time, transaction price, and other conditions) without caring about the specific steps involved. In this process, users sign a contract that allows them to "outsource" the transaction creation to a third party. The intermediate steps are handled by a third-party problem solver (which could be a person or a program). As long as the output falls within the range specified in the user's intent, the solver can freely achieve the result (usually by searching and matching with other intents in the community or exchanges to meet the needs of multiple users). Users typically need to pay a certain amount of money to the solver to help complete the transaction.
Two Core Features of Intent Transactions:
First, intent-based blockchain transactions adopt a "declarative programming approach," which does not specify the sequence of steps to be executed but directly states the expected outcome of the transaction.
Second, once users define their transaction intent, the process of constructing the actual transaction is handed over to a third-party solver, who is responsible for generating the traditional blockchain transactions needed to achieve the expected outcome.
A necessary condition for intent transactions to be established is that a series of digital currencies represented by Bitcoin has a unique inherent unity, meaning all bitcoins are essentially the same, similar to the identity of elementary particles like electrons. This characteristic allows Bitcoin to exhibit consistency and interchangeability in transactions and usage. Therefore, the intent transaction method is suitable for handling virtual currencies with "identical" properties, allowing users to not worry about the quality of goods purchased at a lower price being inferior to those purchased at a higher price.
Potential Benefits and Applications of Intent Transactions
The most obvious benefit of intent-based transactions is that they simplify the transaction process.
By doing so, transaction details (which may include purchasing tokens/other in-app purchases) can be reduced to enhance the user experience in dApps. It not only helps with normal transactions but also supports recurring transactions so that users can avoid the inconvenience of manually purchasing/transferring regularly. It can also support time-related or condition-based transactions, which may include automatic balance top-ups. For example, when the balance is insufficient, a simple statement like "When my wallet balance is less than 100, transfer/purchase xx tokens" can automatically trigger a transfer. It can also eliminate the hassle of regularly purchasing tokens with simple commands.
In terms of enhancing user experience, this promotes the utilization of blockchain technology, as it allows newcomers to cryptocurrency to avoid dealing with all the cumbersome steps.
Since intent-based transactions focus only on the output, orders do not need to be executed immediately. Due to the system's time flexibility, it can execute orders at the most favorable market times, thereby reducing slippage during price fluctuations. The solver attempts to find the best path, which sometimes means aggregating orders for larger transactions to further reduce slippage. Users can also specify the maximum slippage fee they are willing to pay in their intent, ensuring that each transaction is ideal for them. Note: Slippage in trading is defined as the difference between the execution price of a trade and the expected price. This often occurs during periods of high market volatility or low liquidity when the market cannot match orders at the preferred price. Slippage can be positive or negative. Positive slippage refers to orders executed at a better price than expected, while negative slippage refers to orders executed at a worse price than expected.
Intent-based transactions can set conditions and goals to achieve on-chain operations, with many potential applications. For example, setting limit orders to purchase tokens at target prices, setting slippage (acceptable price range), regularly purchasing tokens at specified times, automatically transferring funds when the balance is insufficient, and timely buying or selling tokens based on significant events reported by oracles. Alternatively, using an oracle approach, when a certain event (economic event, political event) occurs, an operation can be executed immediately, such as automatically selling when the stock market drops to a certain level or automatically buying Bitcoin when a candidate, Terry, successfully becomes president.
Current traditional trading models face opacity and centralization risks—users have limited understanding of the actual execution process when submitting transactions. The transaction results are largely influenced by factors such as network congestion at specific execution times, the behavior of miners or validators, and the overall state of the blockchain. This opacity makes users susceptible to front-running, back-running, and other "Maximal Extractable Value" (MEV) techniques. Additionally, the high degree of trading freedom granted to miners, validators, and relayers allows them to easily extract value through reordering, censoring, and other techniques. The lack of execution visibility exacerbates users' vulnerability to MEV attacks.
MEV attacks are a phenomenon in the cryptocurrency and blockchain space that exploits information asymmetry and trading privileges to gain excess profits. These attacks affect user experience, undermine market fairness, threaten system stability, and waste resources. Common forms include front-running, sandwich attacks, liquidation arbitrage, back-running, and miner self-dealing.
For example, in a sandwich attack, a malicious trader manipulates asset prices in a decentralized finance (DeFi) protocol or service by simultaneously placing orders before and after a user's transaction. This attack not only affects the execution price of the transaction but may also impact the commissions earned by liquidity providers.
To prevent sandwich attacks, some platforms like 1inch have introduced new order types called "flashbot transactions," which are not broadcast to the transaction pool but are only visible after being mined, thus protecting transactions from being seen and exploited by malicious traders. Additionally, users can keep their transactions private by using custom RPC endpoints to avoid being seen and exploited by sandwich bots.
Random time trading, as a strategy, is based on the idea of making transaction timing unpredictable, increasing the difficulty of market manipulation. By executing trades at random times, the risk of being predicted and exploited by malicious traders can be reduced. However, it is worth noting that while random time trading can serve as a preventive measure, whether sandwich attacks are worth pursuing by attackers depends on whether the costs of executing these trades exceed the financial gains obtained from other traders. Therefore, combining random time trading with other protective measures can more effectively prevent market manipulation and sandwich attacks.
Case Study of Intent Transactions: UniswapX
Introduction to Uniswap
Uniswap was invented by Hayden Adams, who was previously a mechanical engineer. After losing his job in 2017, Hayden Adams was inspired by Ethereum co-founder Vitalik Buterin's concept of automated market makers (AMM) and began self-learning the smart contract programming language Solidity, embarking on the development of Uniswap. In November 2018, the first version, V1, of Uniswap was launched on the Ethereum mainnet, providing decentralized token exchange services based on AMM. Subsequently, Uniswap rapidly evolved, launching V2 and V3 versions, continuously optimizing the trading experience and liquidity provision mechanism.
Introduction to UniswapX
UniswapX is an innovative decentralized trading protocol that employs a permissionless, open-source (GPL) auction mechanism, allowing users to trade across different AMMs and other liquidity sources. The core of this protocol is intent transactions, where users only need to express their trading intent without worrying about the specific execution process. Users simply need to clarify their intent, and a signature can complete all operations.
In UniswapX, there are three different reactors: Limit Order Reactor, Dutch Order Reactor, and Exclusive Dutch Order Reactor, which are responsible for handling different types of orders that participants may place. Among them, Exclusive Dutch Order is a new type of order that is similar to a Dutch auction but limits the number of participants.
When users place Dutch orders or exclusive Dutch orders through UniswapX, they will enter into a contract with Permit2, allowing the transfer of their tokens. Once signed, these orders will be published and available for anyone to take and complete. The exchanger only needs to indicate how much they are willing to trade and receive within a specified time, and the "fillers" can complete the order.
The foundation of intent transactions is to allow participants to focus on the goals they want to achieve rather than the specific trading process. The premise of intent-based trading is that participants do not have to handle the transaction but instead list the goals they want to achieve. This way, "fillers" can use various methods to complete the transaction, allowing UniswapX to benefit from multiple liquidity pools, including decentralized exchanges (DEXs), centralized exchanges (CEXs), cross-chain liquidity networks, native bridges, stablecoin pools, etc., to ensure optimal pricing.
Additionally, "fillers" are motivated to complete transactions as quickly as possible to benefit from higher prices and higher fees for each transaction. The reactor will verify the contract to ensure that the output of the tokens meets expectations.
Overall, UniswapX provides users with a more efficient, transparent, and user-friendly trading environment through its innovative auction mechanism and intent transaction concept, while addressing some of the issues faced by traditional AMMs, such as trading costs, MEV attacks, and slippage.
What is an AI-Agent
An AI-Agent is a computer program capable of making decisions and executing tasks autonomously based on the environment, inputs, and predefined goals. The core components of an AI-Agent include a large language model (LLM) as its "brain," enabling it to process information, learn from interactions, make decisions, and execute actions; observation and perception mechanisms that allow it to sense the environment; reasoning processes that involve analyzing observations and memory contents while considering possible actions; action execution as an explicit response to thinking and observation; and memory and retrieval, which store past experiences for learning purposes.
AI-Agents can be reactive, proactive, learning, or collaborative, and they typically operate independently to perform complex tasks. LLMs are trained on vast datasets that include books, articles, websites, and various user inputs.
Some common examples of AI-Agents include ChatGPT, Tesla's autonomous driving engine, and Netflix's recommendation engine. Traditional LLMs are generally used only for generating text dialogues, while the AI-Agent concept focuses on the ability to use and control other tools. ChatGPT is a virtual assistant that uses natural language processing (NLP) to learn how to understand text. During training, the LLM learns to predict the next word in a sentence, helping it understand context, grammar, and meaning. In contrast, Tesla's autonomous driving engine computes in milliseconds to determine the car's speed and angle. It is trained using images and videos to determine distances between objects and what those objects might be. On the road, the agent uses all cameras to recognize different objects and generates a virtual map of its surroundings to accurately determine how to drive. Netflix's AI-Agent recommends movies based on the shows users have previously watched. It collects extensive data on how users interact with different types of movies, such as viewing time, search queries, and rating content. It also analyzes information about the movies' genres, actors, directors, and release years. By combining these two types of data, the recommendation engine suggests movies to users based on the viewing history of similar users.
On a mature AI-Agent platform, users only need to issue instructions to the Agent, just as the LLM, acting as the brain, intelligently calls upon various tools like limbs to present content or fulfill user requests.
The application scenarios for AI-Agents are very broad, covering multiple fields such as e-commerce, education, real estate, travel, finance, healthcare, transportation, government services, and media entertainment. They can provide personalized recommendations, intelligent customer service, market trend analysis, property valuation, travel marketing optimization, customer service and support, educational data analysis, medical image analysis, intelligent recommendation systems, and more. The functions of AI-Agents include perceiving environmental changes, responsive actions, reasoning and explanation, problem-solving, reasoning and learning, action and result analysis, etc. They can automate repetitive tasks, provide personalized experiences, achieve seamless and cost-effective scalability, improve usability, save costs, and provide data-driven insights.
AI-Agents offer various benefits, fundamentally transforming the way businesses and services operate. Their efficiency and consistency in handling repetitive tasks ensure accurate execution of processes without being affected by human worker fatigue. Through personalization and dynamic adjustments, AI-Agents tailor experiences to individual user preferences, adapting in real-time to ensure relevance and engagement. Their scalability and availability enable them to manage a large number of tasks around the clock, providing seamless service without downtime. Additionally, AI-Agents excel at complex pattern recognition, identifying subtle trends in data to drive more informed decision-making. This significantly reduces costs by optimizing processes and decreasing the need for large amounts of human labor. Furthermore, AI-Agents act as catalysts for innovation, creating new business models and services that enhance competitive advantage. They also enhance security through risk and fraud detection, monitoring suspicious activities and protecting against threats. Finally, their ability to optimize resources contributes to more sustainable and efficient operations, making them indispensable assets across industries. As a new technology built on LLMs, AI-Agents can make decisions and execute actions based on specific scenarios, "transforming large language models from stateless APIs into stateful tools."
The Relationship Between AI-Agents and Intent Transactions
In intent-based transactions, AI-Agents will serve as intelligent personal assistants designed to help users complete various tasks by understanding natural language inputs. LLMs can be integrated into the intent-based architecture, allowing users to express their needs without considering how to achieve those needs. In the trading domain, intent-based transactions allow users to declare the expected outcomes of transactions, while the process of constructing the actual transaction is handled by third-party solvers. The integration of AI-Agents can enhance the efficiency and intelligence of this process. For example, AI-Agents can leverage their perception, planning, memory, and tool usage capabilities to interact with solvers, automatically execute trading strategies, and optimize the price and timing of trade execution.
Once AI can interpret user intent, it can quickly communicate with the solver and generate results. If the solver is integrated into the interface, the speed of transactions may increase. The solver processes through multiple sources, such as different centralized exchanges and on-chain/off-chain liquidity sources, allowing it to find the optimal trading rate as it can compare all prices faster than anyone else.
In addition to speed, the solver can connect to various liquidity pools. This will also reduce gas fees for cross-chain transactions, as the solver will automatically find the best way to execute the intent.
Future Prospects
Companies like Circle have been exploring how to combine these two concepts. They created a prototype called TXT2TXN that allows users to exchange and transfer funds on some EVM chains. Users need to log in and connect to their wallets, then input their intent. After writing down the intent, the LLM will recognize whether the input/intent is a transfer or an exchange; if it cannot recognize the intent, it will display "no matches." It will then populate a structure to create a CowSwap order for exchange or create a transaction payload for transfer. Users will receive and sign a contract to complete the transaction. During the transaction process, the interface will display a confirmation link to verify the transaction or exchange, allowing users to track it.
We believe there are areas for improvement. For example, having AI ask questions to ensure the AI-Agent correctly understands the intent would be very beneficial. Misunderstanding the intent could lead to issues, as this process involves the transfer of funds, which may raise legal concerns in the future. We hope to see AI-Agents capable of executing new functions, such as purchasing NFTs or tokens through dApps. This would greatly increase their practicality, as users could perform more tasks without programmers constantly updating the interface. Circle is considering adding a new feature to integrate a personal address book into the AI-Agent to enhance user experience, making inputting intent clearer and more convenient.
By allowing the solver to help realize your intent, we must also consider the issues of counterparty discovery. Since the solver collects many users' intent information, aside from general information and data leakage risks, they may also strategically buy and sell to manipulate the market for MEV, which could lead to market fragmentation and liquidity issues. If the solver chooses to exploit this data without restrictions, it may result in a loss of trust in the decentralized financial ecosystem among people in the community.
References:
https://cointelegraph.com/learn/intent-based-architectures-and-applications-in-blockchain
https://www.halborn.com/blog/post/intent-centric-blockchain-are-intents-the-next-big-thing-in-web3
https://docs.uniswap.org/contracts/uniswapx/overview
https://blog.li.fi/uniswapx-a-deep-dive-4b4ea7673dc1
https://www.circle.com/blog/txt2txn-using-ai-llms-for-internet-based-applications
https://anoma.net/blog/an-introduction-to-intents-and-intent-centric-architectures
https://www.paradigm.xyz/2023/06/intents