[RFC] Programmable settlement layer for multi-agent dApps
From ethresearch by Dl-Vv
Abstract (TLDR)
Prevalent programmable settlement architectures don’t enable native counterparty discoverability, which is necessary for decentralized multi-agent applications. We propose a new form of programmable settlement with native counterparty discoverability through Turing complete intents creating the necessary environment for decentralized multi-agent applications. Through the concept of partial programs, multiple parties can express intents of arbitrary logic which are dynamically composed and settled without requiring intermediary smart contracts. These partial programs can either define constraints for state transitions or imperative commands and can only be settled if all constraints are satisfied by their imperative counterparts. The architecture is built around three main components. IAML, a Turing complete domain-specific language for writing intent programs supporting declarative and imperative statements. The Engine, a gas-optimized virtual machine with on-chain interpreter executing intent programs and ensuring constraint satisfaction. The Agent Account, a minimal proxy execution context extending an agent’s EOA by giving it the programmability features of smart accounts. This architecture unlocks a new generation of decentralized and non-custodial multi-agent applications on any EVM-compatible blockchain without network level changes.
Background and motivation
A multi-agent system (MAS) is a composition of multiple autonomously interacting units called agents. These agents which can be humans, software programs or AI-based systems competing or collaborating to achieve individual or collective goals. Multi-agent applications leverage the capabilities of multi-agent systems to provide certain services for their users which aren’t feasible through monolithic architectures. Due to its multivariate nature, these applications require a dynamic environment for counterparty discoverability, communication, collaboration and orchestration of resources. A well-defined environment is crucial for agents to efficiently interact, coordinate and coexist.
Blockchain-based programmable settlement architectures are well suited for applications with pre-defined execution logic and known counterparties. But as smart contracts are reactive execution environments, these architectures can’t natively enable counterparty discoverability. Thus, there is currently no adequate environment required to bring multi-agent applications onchain. We introduce a dynamically programmable environment with an intent-centric settlement system enabling counterparty discoverability, communication, collaboration and orchestration for decentralized multi-agent applications.
Intent programs
Prevalent dApps rely on explicit transactions specifying the exact computation path. Intents abstract away the execution details by defining the desired blockchain end state – letting users declare ‘what’ they want without specifying ‘how’ it should be achieved. While available intent protocols are operation-specific, we generalize this concept through intent programs, supporting any kind of logic through its expressive, Turing-complete intent language.
An intent program consists of one or multiple pieces of intent logic called partial programs. The composed partial programs can either be declarative by defining constraints for state transitions or imperative by explicitly defining onchain commands. The complete intent program is executable if the declarative constraints of all partial intent modules are satisfied by their imperative counterparts. While a single intent module can contain both declarative and imperative logic, a purely declarative module requires an imperative counterpart for completion and executability.
Partial programs are expressed, completed and matched by agents which can be humans, programs or autonomous AI systems. While some agents express intents for state transitions, other agents are financially incentivized to settle these intents. The completed intent programs are interpreted and executed dynamically without intermediary smart contracts. It means the logic of intent-centric applications entirely resides on the intent abstraction layer leveraging existing liquidity and infrastructure.
Architecture
The three main components of our architecture powering intent-centric multi-agent applications on EVM are the domain-specific language IAML for writing intent programs executable through the Engine implemented as gas-optimized onchain virtual machine within the execution context of minimal Agent Accounts.
IAML
IAML is a high-level, Turing-complete intent DSL designed for writing intent programs. Intent programs consist of partial programs signed by multiple parties and collaboratively forming the application logic. These complementary programs can define both declarative constraints for state transitions and imperative smart contract function calls. Further, IAML enhances composability by enabling to break down complex intent logic into atomic units simplifying settlement through generalized coincidences of wants (CoWs). Only if all constraints of all partial programs are satisfied, the intent program becomes executable through the Engine.
Engine
The Engine is an onchain virtual machine implemented in Huff interpreting and executing the compiled IAML opcode of intent programs. Only if all constraints are satisfied, the execution doesn’t revert ensuring only allowed and intended state transitions. Through its interpreter, the engine can process logic of arbitrary complexity dynamically, such as loops, conditions or chained multicalls where the output of one transaction serves as input for the subsequent one. Optimized for gas efficiency by being implemented as thin register machine layer on top of the stack machine (EVM), the engine serves as the core runtime for the intent-centric environment. The optimized gas performance can be attributed to the register machine design minimizing the required computational steps and custom calldata encoding scheme reducing the calldata size up to 50% compared to conventional ABI encoding.
Agent Account
The Agent Account is a minimal proxy contract serving as execution context for the Engine, seamlessly adding programmability to an agent’s EOA without the overhead of a smart contract account. This approach enhances gas efficiency while maintaining the simplicity of direct EOA control. By abstracting programmability into the proxy, users retain full custody of their private keys while being able to authorize intent policy logic of arbitrary complexity through a single signature from their EOA.
Intent-centric multi-agent applications
Our architecture powers applications whose logic is composed by intents expressed, composed and settled by multiple agents. While it provides an environment for native counterparty discoverability, it supports the combination of intent programs with any onchain components. Further, these multi-agent applications enable outsourcing of arbitrary execution logic, automations and chained multicalls without relying on contract deployments, approvals or explicit token transfers.
P2P flashloans
The most obvious applications enabled by the programmable intent settlement are the currently existing intent solutions for basic onchain operations like swaps or lending. The benefit of building these intent-based applications on our architecture, lies in the liquidity aggregation of all these operations through a Turing complete language as unifying standard to express any type of user intents.
Beyond solving the intent liquidity fragmentation, this architecture enables new types of intents, e.g. P2P flashloans. In contrast to protocols like Aave, any user can issue flashloans for a specific token by defining an increased future balance as the constraint of his intent. By guaranteeing a balance increase, the user can implicitly earn interest for holding any token. The intent counterpart must define an atomic operation to be performed in order to return a higher balance then borrowed (e.g. through arbitrage or loan liquidation).
![[RFC] Programmable settlement layer for multi-agent dApps image 1](https://img.bgstatic.com/multiLang/image/social/8ed9ca5715240cf6b083a4e63e65d5861739881445353.png)
FL intent
![[RFC] Programmable settlement layer for multi-agent dApps image 2](https://img.bgstatic.com/multiLang/image/social/2195e065bfecb5b0da631f9de88b8ab91739881445519.png)
FL solution
Example of P2P flashloan intent counterparts (intent + solution)
Intent-based automation
Due to the Turing completeness of IAML, intents can define logic of arbitrary complexity and thus enable outsourcing the execution of any workflow. The currently biggest use case for this type of outsourced workflow execution are automations. While current decentralized automation frameworks require the deployment of smart contracts to automate certain onchain operations, we enable automations without contract deployments while still being serverless and non-custodial.
A single signature from an EOA orchestrates an agent to operate with user funds in a non-custodial way based on the defined intent program without requiring approvals or transferring assets. In this scenario the whole program is defined within a single intent and thus the agent just needs to execute it if the conditions are met. This account-specific automation design makes the intent program sharable with other parties fostering reusability and composability.
![[RFC] Programmable settlement layer for multi-agent dApps image 3](https://img.bgstatic.com/multiLang/image/social/4a97d2044aeeff255624ab618cfe727f1739881445721.png)
Automation796×734 47.1 KBExample of simple intent automation logic
DeFi policies for autonomous AI agents
The evolution of automation is giving agents more autonomy. Autonomous agents have the potential to entirely change how users interact online and onchain. Instead of executing actions manually, users can express specific goals towards an agent which then operate autonomously and in collaboration with other agents to achieve it. The goal can be either a crypto-specific outcome where the agent acts as interface to DeFi or any other outcome where the agent acts as interface to common software tools and uses DeFi rails to operate autonomously. However, this evolution introduces a trade-off between autonomy and control. Currently, users either have to manually approve every financial transaction executed by the agent or they have to provide access to their private key for an autonomous execution out of their control. While losing self-custody, it becomes unfeasible to ensure only intended agentic behavior.
This problem can be solved through the concept of partial programs where users can express programmable intent-based policies towards agents. These programmable policies ensure that agents equipped with their own private keys and without holding user funds operate only within a precisely user-defined action space. While the user-signed policy defines the constraints for the agent, it leaves an individual degree of freedom for the agent to provide a solution intent. This way agents can dynamically add partial logic to complete the intent program before executing it. They are allowed to operate autonomously and non-deterministically but only within the user-defined deterministic guardrails making the agent trustless and secure. The same way as partial programs allow users to control autonomous agents, they also allow these agents to control other agents and thus enable a trustless multi-agent collaboration.
Any form of feedback is highly appreciated!
Disclaimer: The content of this article solely reflects the author's opinion and does not represent the platform in any capacity. This article is not intended to serve as a reference for making investment decisions.
You may also like
IntoTheBlock: 2.7 million addresses bought Bitcoin at $97,100
Vitalik: The LIBRA crash highlights the importance of education in the crypto space
Memecoin fraud erodes community trust, Solana on-chain user activity drops nearly 40% in February
WalletConnect Raises $10M in Four Oversubscribed Token Sales
Trending news
MoreCrypto prices
More








