🤸AA & Dynamic Delegation

Account Abstraction is a widely discussed topic that has attracted considerable attention due to its potential impact. Given its undeniable significance, the expectations for AA are high. AA reimagines the traditional account model by employing smart contract accounts as the primary user accounts, surpassing the capabilities of EOAs managed by MetaMask and cold wallets. Without delving into the technical definition and architecture just yet, AA is empowering various use cases that were previously out of reach. In some cases, it enables use cases previously theoretically possible but impractical, i.e., gasless transactions. In other cases, it simplifies other use cases considered challenging, i.e., social recovery and multi-signature schemes.

One aspect of AA, delegation, is crucial to the Balloondogs team's provision of an optimal and secure intent fulfillment experience.

Why is Delegation important?

The fundamental concept of an Intent-based system is to delegate execution to a more advanced systemic entity, ideally decentralized, to execute transactions without requiring direct approval for each step. This delegation hands over the authority to act on the user's behalf and eliminates the need for multiple approvals for the proposed execution. Instead, the user interacts just once by submitting an Intent, which a third party, a staked decentralized Solver, fulfills.

Dynamic Delegation

ERC-4337 account abstraction allows users to grant the network just-in-time, use-case-specific privileges to act on their behalf without requiring upfront approvals or trust assumptions. The Dynamic Delegation concept involves reusing the intent, as the on-chain delegation definition permits the Intent-based system to act on the user's behalf. It leverages the flexibility offered by the validation mechanism inherent in AA.

Dynamic Delegation doesn't mean giving away unchecked power. You still define the parameters within which the system can act via your Intent.

With Dynamic Delegation, there are no extra steps before delegation, no unnecessary privileges granted, and most importantly, no trust assumptions.

Post-Execution Validation: Ensuring Intent Fulfillment

While delegation sets a path for users to achieve their desired outcomes, ensuring that the delegated entity adheres to the expressed Intent is essential. This is where post-execution validation comes into play. In the BalloonDogs ecosystem, the decentralized algorithm validates the execution results against the user's Intent constraints, ensuring that the delegated actions align with the user's objectives. This post-execution validation mechanism reinforces the principles of decentralization and user sovereignty.

A Conditional Example Underscoring Dynamic Approvals

Imagine you define the following Intent: "Swap 10 Token-A for at least 5 Token-B, but only if the price of Token-B drops below X within the next hour."

Conventionally done today: You'd likely have to monitor the market and sign a transaction when the condition was met.

With ERC-4337 Dynamic Delegation:

Note no upfront approvals are executed unless the conditions are ripe for fulfillment. The just-in-time, dynamic, fine-grained approvals are in orange.

  • The user signs and submits their intent, which includes the desired state change (swapping 10 Token-A for at least 5 Token-B under threshold conditions).

  • The intent is encoded as an ERC-4337 userOp, which includes the user's account contract and the necessary data payload for the expressed Intent.

  • The decentralized algorithm, acting as the bundler, receives the userOp.

  • Given the Intent delegation, market conditions are continuously monitored using real-time data from oracles.

  • If the price of Token-B drops below the specified threshold X within the given time frame, approval for the precise transfer amount is generated, coupled with the actual transfer operation.

  • The bundler sends the userOp bundle to the ERC-4337 Entrypoint contract, which authenticates and executes the user operations, including the swap operation.

  • The userOp execution results before settlement are validated to ensure the intent was fulfilled to meet user objectives (swap) and expressed constraints (price threshold).

With a solid understanding of how Account Abstraction and Dynamic Delegation can be leveraged to create a robust and user-centric Intents system, we will next focus on the art of building an effective decentralized Intents product.

Last updated