ERC-7521 Draft: Adding User Intent to Account Abstraction Wallets

Deep Tide TechFlow
2023-09-21 14:51:04
Collection
General user intent has opened up a whole new world.

Original Author: Stephen Monn

Original Title: 《Introducing ERC-7521: Generalized Intents for Smart Contract Wallets

Compilation: Deep Tide TechFlow

In the ever-evolving landscape of blockchain and decentralized applications, increasing attention is being drawn to the concept of user-defined intents rather than pure transactions. This allows users to navigate the increasingly complex processes of DeFi without worry, unlocking a range of additional use cases that are only now being conceived.

As individual applications have already been using their own different and incompatible intent structures, it makes sense to create a universal intent standard that can be shared and understood by all users, applications, wallet software, solvers, seekers, and more.

To aid composability and lower the barrier to entry, we propose ERC-7521, a standard that supports generalized intents for smart contract wallets.

What are User Intents?

Since this field is very new, the definition of intents is currently somewhat vague. From a broad conceptual standpoint, the term is generally used to refer to the expression of a user's expected on-chain outcome or final state. For the purposes of this specification, intent is defined as a set of actions and expectations set by the user. These actions and expectations can be combined with the actions and expectations of other intents in an effort to meet the common and maximum interests of all parties involved.

A series of on-chain operations that satisfy all relevant parties is referred to as a solution. Dedicated solvers (similar to the bundlers in ERC-4337) will compete to find solutions that provide the highest satisfaction for users. For example, this can be achieved by finding the best/most efficient on-chain path, leveraging off-chain liquidity sources, combining different users' intents to capitalize on common needs, and even including their own intents.

Adding User Intents to Account Abstraction

The key to enabling generalized intents is the use of contract-based abstract accounts. Similar to ERC-4337, intents are signed as messages and then verified on-chain through separate transactions. These signed messages are then propagated in their own memory pool.

The goal of this specification is not to detail the technicalities of how intents are precisely handled, constructed, or managed off-chain, but rather to create a framework for smart contract wallets to integrate and automatically support the wide range of possibilities defined by the signed intents themselves. Therefore, as new intent use cases emerge, this framework must also allow for seamless and permissionless upgrades and code extension processes.

Single Entry and Infinite Intent Standards

To facilitate this seamless and permitted upgrade and extension process, the EntryPoint contract in ERC-4337 has been mimicked but also divided into two distinct parts. The first part is called the entry point, which serves as the main entry point for submitting intent solutions, responsible for verifying intent signatures and running advanced intent processing logic.

The specifics of the intent processing logic are defined in a separate contract known as the intent standard, which is specified by the signed intent itself. The entry point calls these contracts to process an intent. It is the intent standard that defines how to handle additional intent data and execution, as well as the fundamental off-chain rules related to inherent denial-of-service attack vectors associated with intents, such as how to relay messages to solvers and protective mechanisms against inherent DoS attack vectors.

These intent standards should be self-contained and established independently of this specification. We anticipate that as the intent landscape matures, optimized niches and emerging use cases will lead to the creation of new intent standards with additional functionalities. The adoption and support of these standards will be driven by social consensus among wallet developers and intent solvers, as well as the needs of end users.

To ensure that our proposed ERC has significant functionality in its early stages, we have developed an asset-based intent standard to support the current majority of blockchain use cases. We will refine this standard (and this ERC) in a public environment to meet the needs of the ecosystem.

Vague but Powerful Intent Structure

User intents consist of primary data that can be broken down into two parts:

  • The necessary verification data used by the Entry Point contract to validate messages with the sender before executing them.

  • Additional data specific to the Intent Standard as specified by the intent.

Intent standard data can be anything but is always broken down into separate parts known as intent segments.

The Entry Point contract does not explicitly understand what the data is but does recognize the segmentation. The Entry Point contract calls the Intent Standard contract to process one segment at a time and enforces that the segments of the intent are always processed in the specified order. However, the Entry Point allows for other intents to be processed between the execution of segments.

These intent segments typically consist of operations that the user wishes to process or checks for certain conditions being met. Additionally, a segment can pass data to the next segment during processing. This data is referred to as intent context data, which is very useful for tracking changes that occur between segment validations and avoiding the recomputation of useful data. Similarly, how to leverage this data is determined by the Intent Standard specification.

Combining Intents for Maximum Satisfaction

During intent processing, intents can express dissatisfaction with any type of condition, whether it be an unexpectedly low balance or any condition that the intent standard may be evaluating as false. When this occurs, the entire transaction will roll back, including any unrelated intents that may have been processed beforehand.

Only when a set of intents is submitted and processed in an order that satisfies all parties are these intents considered spent, and the resulting state is allowed to persist on-chain. It is these combinations of intents that constitute a solution and are passed to the Entry Point contract for processing.

However, simply submitting a list of intents is not enough, as the segments of different intents can be arranged in various orders. Therefore, a solution also specifies how to order the different intent segments during processing (how to interleave different intent segments).

Part of the solving process typically involves the solver formulating an intent to help satisfy a set of other intents, thereby maximizing user satisfaction while generating some profit.

Conclusion: Enhancing Intent-Driven Blockchain Interactions

The focus of the specification is to define a basic framework for smart contract wallets so that they can connect and unlock powerful intent expressions for users, even as the landscape continues to evolve. Defining intents as a collection of smaller intent segments provides users with a better experience, reducing the number of signatures they need to provide. Intent segmentation and shared context data also help unlock powerful functionalities without using a large amount of gas. Intents can trust that all their segments will be processed in order without manual checks.

Universal user intents open up a whole new world that is just beginning to be developed. From simple gasless token swaps to more complex conditional intents to automate fund transfers from cold wallets to hot wallets or daily coin purchases via a single signed message, the possibilities of intents are immense! Our specification for the asset-based intent standard is the first of many iterations that will enable the community to leverage this new framework.

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
ChainCatcher Building the Web3 world with innovators