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 development of blockchain applications in the future. In our article, we explored the concept and potential of intent-centric transactions, analyzed how this model can simplify user experience, enhance transaction security, and bring more innovation opportunities to decentralized applications. We also discussed the role of AI agents and explored how they can be combined with intent-centric transactions to further promote the automation and intelligence of smart contracts and provide users with a smarter and more personalized blockchain interaction experience.
What is Intent Transaction
When you want to take a taxi, you open a travel app. After selecting the starting point, a price range will appear at the bottom of the interface for you to set. When you use a takeaway app to order food, after searching for similar products, the interface has filter conditions such as price, time, and distance for you to choose. In this scenario, "what do I want to buy", plus time and price restrictions, constitute a transaction intention. Nowadays, many apps have added options to various degrees to allow customers to fill in their "intentions" for the convenience of customers. Of course, the intention does not only include the preset transaction price. Price is the most frequently used parameter in the intention.
In the context of blockchain, intent-based transactions refer to users performing blockchain operations in a goal-oriented manner. In this process, users only express their ultimate goals (transaction conditions such as time, transaction price, etc.) without caring about the specific steps involved. In this process, users sign a contract that allows users to "outsource" transaction creation to a third party. The intermediate steps are handled by a third-party problem solver (which may be a person/program). As long as the output is within the range specified in the user's intent, the solver (or "solver") is free to achieve the result (usually searching and matching other corresponding intents in the community and exchange to meet the needs of multiple users). Users usually need to pay a certain amount of money to the solver to help complete the transaction.
There are two core characteristics of intention transactions:
First, intent-based blockchain transactions adopt a "declarative programming approach", which does not specify the sequence of steps to be executed, but directly declares the expected results of the transaction.
Second, once users have defined their transaction intent, the process of constructing the actual transaction is handed over to a third-party solver, which is responsible for generating the traditional blockchain transactions required to achieve the desired outcome.
A necessary condition for the establishment of intentional transactions: A series of digital currencies represented by Bitcoin are unique in that they have an inherent unity, that is, all Bitcoins are essentially the same, which is similar to the identity of elementary particles such as electrons. This characteristic makes Bitcoin consistent and fungible when it is traded and used. Therefore, the intentional transaction method is suitable for dealing with virtual currencies with the "same" attribute, and users do not need to worry that the quality of goods purchased at a lower price will be lower than those purchased at a higher price.
Potential benefits and applications of intention trading
The most obvious benefit of intent-based trading is that it simplifies the transaction process.
By doing this, the user experience in dApps can be enhanced by reducing transaction details (which may include the purchase of tokens/other in-app purchases). It not only helps with normal transactions, but also supports repeated transactions so that users can avoid any inconvenience of manual purchases/transfers on a regular basis. It can also support time-related or condition-based transactions, which may include automatic recharge of balances. For example, when the balance is insufficient, just one sentence "When my wallet balance is less than 100, transfer/purchase xx coins" can automatically transfer. It can also eliminate the hassle of buying tokens regularly with a simple command.
This promotes the use of blockchain technology in terms of helping user experience as it allows newcomers to cryptocurrencies to not have to deal with all the cumbersome steps.
Since intent-based trading focuses only on outputs, orders do not need to be traded immediately. Due to the system's time flexibility, it can execute orders when the market is most favorable, reducing slippage when prices change. The solver tries to find the best path, and sometimes this means it can aggregate orders from larger trades to further reduce slippage. Users can also state in their intent the maximum slippage fee they are willing to pay so that each trade is ideal for them. Note: Slippage is defined in trading as the difference between the price at which a trade is executed and the expected price. This usually 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 is when an order is executed at a better price than expected, while negative slippage is when an order is executed at a worse price than expected.
Intent-based transactions can set conditions and goals to achieve on-chain operations, and have many potential applications. For example, set limit orders to buy tokens at a target price, set slippage (accepted spread range), buy tokens at regular intervals, automatically transfer when the balance is insufficient, and buy or sell tokens in time according to major events reported by the oracle. Or, using the oracle method, when an event (economic event, political event) occurs, an action is immediately performed, such as automatically selling when the stock market falls to a certain level, and automatically buying Bitcoin when a candidate Terry successfully becomes president.
The current traditional transaction model is opaque and centralizes risks - when users submit transactions, they have limited knowledge of their actual execution process. Transaction results are largely affected by factors such as network congestion at a specific execution time, the behavior of miners or validators, and the overall blockchain state. This opacity makes users vulnerable to front-running, reverse transactions, and other "Maximal Extractable Value" (MEV) techniques. In addition, the high degree of transaction freedom granted to miners, validators, and relayers enables them to easily extract value through reordering, censorship, and other techniques. The lack of execution visibility increases users' vulnerability to MEV attacks.
MEV attack is a phenomenon in the field of cryptocurrency and blockchain that uses information asymmetry and trading privileges to obtain excess profits. This attack affects user experience, undermines market fairness, threatens system stability and wastes resources. Common forms include front-running transactions, sandwich attacks, liquidation arbitrage, back-running transactions, and miners' selfish behavior.
Take the sandwich attack as an example. It usually involves a malicious trader manipulating the price of an asset in a decentralized finance (DeFi) protocol or service by placing orders simultaneously before and after a user's transaction. This type of attack not only affects the price at which the transaction is executed, but may also affect the commissions earned by liquidity providers.
In order to prevent sandwich attacks, some platforms such as 1inch have introduced a new order type called "flashbot transactions". Such transactions will not be broadcast to the transaction pool, but will be visible after being mined, thus protecting the transactions from being seen and exploited by malicious traders. In addition, users can keep their transactions private by using custom RPC endpoints to avoid being seen and exploited by sandwich robots.
As a strategy, the core idea of random time trading is to make trading times unpredictable and increase the difficulty of manipulating the market. By randomly executing trades at different times, the risk of trading patterns being predicted and exploited by malicious traders can be reduced. However, it is worth noting that although random time trading can be used as a preventive measure, whether a sandwich attack is worthwhile for the attacker depends on whether the cost of executing these trades exceeds the financial gain the attacker gets from other traders. Therefore, random time trading combined with other protective measures can be more effective in preventing market manipulation and sandwich attacks.
Intent Transaction Example: UniswapX
Introduction to Uniswap
Uniswap was invented by Hayden Adams, a former mechanical engineer. After losing his job in 2017, Hayden Adams was inspired by Ethereum co-founder Vitalik Buterin's concept of automated market makers (AMMs), and began to teach himself the smart contract programming language Solidity and started developing Uniswap. In November 2018, the first version of Uniswap, V1, was launched on the Ethereum mainnet, providing a decentralized token exchange service based on AMM. Subsequently, Uniswap developed rapidly, launching versions V2 and V3, and continuously optimizing the trading experience and liquidity provision mechanism.
Introduction to UniswapX
UniswapX is an innovative decentralized trading protocol that uses a permissionless, open source (GPL) auction mechanism to allow users to trade between different AMMs and other liquidity sources. The core of this protocol is intention trading, that is, users only need to express their trading intentions without worrying about the specific execution process of the transaction. Users only need to clarify their intentions for what they want to do, and one 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 processing different types of orders that participants may place. Among them, Exclusive Dutch Order is a new type of order, similar to the Dutch auction, but limits the number of participants.
When a user places a Dutch order or exclusive Dutch order through UniswapX, they sign a contract with Permit2 to allow the transfer of their tokens. Once signed, these orders are published and available for anyone to take and complete. Swappers simply indicate how much they are willing to trade and receive within a specified time, and "fillers" can complete the order.
The basis of intention trading is to let participants focus on what they want to achieve, rather than the specific trading process. The premise of intention-based trading is that participants do not have to deal with transactions, but instead list the goals they want to achieve. In this way, "fillers" can use a variety of methods to complete transactions, 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 the best price.
Additionally, fillers have an incentive to complete transactions as quickly as possible in order to benefit from higher prices and higher fees per transaction. Fillers complete transactions as quickly as possible in order to benefit from higher prices and higher fees per transaction. Reactors validate contracts to ensure that the output of tokens is as expected.
In general, UniswapX provides users with a more efficient, transparent and user-friendly trading environment through its innovative auction mechanism and intention trading concept, while solving some problems faced by traditional AMMs such as transaction costs, MEV attacks and slippage.
What is AI-Agent
AI-Agent, or artificial intelligence agent, is a computer program that can autonomously make decisions and perform tasks based on the environment, inputs, and predefined goals. The core components of AI-Agent include a large language model (LLM) as its "brain", which enables it to process information, learn from interactions, make decisions, and perform actions; observation and perception mechanisms, which enable it to perceive the environment; reasoning thinking processes, which involve analyzing observations and memory content and considering possible actions; action execution, which is an explicit response to thinking and observation; and memory and retrieval, which stores past experiences for learning.
AI-Agents can be reactive, proactive, learning, or collaborative, and they usually work independently to perform complex tasks. LLMs are trained using massive datasets including books, articles, websites, and different inputs from users.
Some common AI-Agent examples include ChatGPT, Tesla's Autopilot Engine, and Netflix's recommendation engine. Traditional LLMs are generally used only to generate text conversations, 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, LLM learns to predict the next word in a sentence, which helps it understand context, grammar, and meaning. In contrast, Tesla's Autopilot Engine performs calculations in milliseconds to determine the speed and angle of the car. It is trained through images and videos to determine the distance between objects and what objects may be. On the road, the agent uses all cameras to identify different objects and generates a virtual map of its surroundings to accurately determine how to drive. Netflix's AI-Agent recommends movies to users based on the shows they have watched before. It collects a lot of data about how users interact with different types of movies, such as viewing time, search queries, rating content, etc. It also analyzes information such as the type of movie, actors, directors, and release year. By combining these two types of data, the recommendation engine recommends movies to users based on the viewing history of similar users.
On a mature AI-Agent platform, users only need to give instructions to the Agent, and the LLM, like the brain, will intelligently call on various other tools like limbs to present content to users or meet their requirements.
AI-Agents have a wide range of application scenarios, covering e-commerce, education, real estate, tourism, finance, healthcare, transportation, government services, media and entertainment, and other fields. They can provide personalized recommendations, intelligent customer service, market trend analysis, real estate valuation, tourism marketing optimization, customer service and support, education data analysis, medical imaging analysis, intelligent recommendation systems, and other services. AI-Agents’ functions include sensing environmental changes, responsive actions, reasoning and interpretation, 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 availability, save costs, and provide data-driven insights.
AI-Agent offers a variety of benefits that revolutionize the way businesses and services operate. Their efficiency and consistency in handling repetitive tasks ensures that processes are carried out accurately without the fatigue that affects human workers. Through personalization and dynamic adjustment, AI-Agent tailors the experience to individual user preferences, adapting in real time to ensure relevance and engagement. Their scalability and availability enable them to manage large volumes of tasks around the clock, providing seamless service without downtime. In addition, AI-Agent is good at complex pattern recognition and can identify subtle trends in data to drive smarter decisions. This significantly reduces costs by optimizing processes and reducing the need for extensive manpower. In addition, AI-Agent is also a catalyst for innovation, able to create new business models and services and enhance competitive advantage. They also enhance security with risk and fraud detection, monitor suspicious activity and protect against threats. Finally, their ability to optimize resources contributes to more sustainable and efficient operations, making them an indispensable asset across industries. As a new technology based on LLM, AI-Agent can make decisions and execute them based on specific scenarios, "transforming large language models from stateless APIs into stateful tools."
The relationship between AI-Agent and transaction intent
In intent-based trading, AI-Agent will be an intelligent personal assistant designed to help users complete various tasks by understanding natural language input. LLM (Large Language Model) can be integrated into the intent-based architecture, enabling users to express their needs without having to think about how to achieve them. In the field of trading, intent-based trading allows users to declare the expected results of the transaction, while the process of building the actual transaction is the responsibility of a third-party solver. The integration of AI-Agent can improve the efficiency and intelligence of this process. For example, AI-Agent can use its perception, planning, memory, tool use and other capabilities to interact with the solver to automatically execute trading strategies and optimize the price and time of transaction execution.
After AI is able to interpret the user's intent, it can quickly communicate with the solver and generate results. If the solver is integrated into the interface, transactions may be faster. The solver processes through multiple sources, such as different centralized exchanges, on-chain/off-chain liquidity sources, so it is able to find the best transaction rate because it can compare all prices faster than anyone.
In addition to being fast, solvers can also connect to various liquidity pools. This will also reduce the gas fees for cross-chain transactions because the solver will automatically find the best way to execute the intent.
Future prospects
Companies like Circle have been working on how to bring these two concepts together. They created a prototype called TXT2TXN that allows users to exchange and transfer funds on a number of EVM chains. Users need to log in and connect to their wallet, then enter their intent. After writing down the intent, LLM will identify whether the input/intent is a transfer or swap; if it cannot recognize the intent, it will display "No Match". It will then populate a schema to create a CowSwap order for an exchange, or a transaction payload for a transfer. The user will receive and sign a contract to complete the transaction. While the transaction is processing, the interface will display a confirmation link, verifying the transaction or swap, so that the user can track it.
We think there are some areas for improvement. For example, it can be very beneficial to have the AI ask questions to ensure that the AI-Agent understands the intent correctly. If intentions are misunderstood, this can cause problems as the process involves the transfer of funds, which could lead to legal issues in the future. We would like to see AI-Agents able to perform new functions, such as purchasing NFTs or tokens through dApps. This will greatly increase its usefulness as users can perform more tasks without programmers constantly updating the interface. A new feature that Circle is considering adding is integrating personal address books into AI-Agent to improve user experience, which will make entering intentions clearer and more convenient.
By letting solvers help realize your intentions, we must also consider the problems discovered by counterparties. Because solvers collect a lot of user intention information, in addition to the general risk of information and data leakage, they will also strategically buy and sell to manipulate the market to obtain MEV, which may cause market fragmentation and liquidity problems. If solvers choose to use this data without restriction, it may cause people in the community to lose trust in the decentralized financial ecosystem.
Reference articles:
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.coindesk.com/tech/2023/11/15/intents-are-blockchains-big-new-buzzword-what-are-they-and-what-are-the-risks/
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