Architecture Overview: Agent-Based Smart Account Interaction

Agents system is designed to create and manage smart accounts on Ethereum or any EVM-compatible blockchain. The system leverages multiple tools and services, including EOA accounts, ERC-4337, an internal Agents-API, and Giza platform integration. These components work together to abstract complex blockchain interactions, providing a seamless and secure experience for users.

Key Components:

Smart Account (ERC-4337)

The architecture utilizes the ERC-4337 standard to create smart accounts for users by leveraging Account Abstraction. Unlike traditional EOAs, smart accounts are smart contract-based, providing enhanced features such as automation, security, and account abstraction. When a user connects to the application through their EOA, a smart account is automatically created on their behalf by the Giza platform. This smart account abstracts away the complexities of interacting directly with smart contracts, offering the user a more intuitive and secure experience. With the ERC-4337 standard, these accounts can include features such as multi-signature wallets, social recovery mechanisms, and more importantly Session keys, which are our backbone to automatization.

Connect

Connect plays a crucial role in facilitating the creation and management of smart accounts and providing a secure backend to perform smart contract interactions. It handles the heavy lifting required to bridge the user's EOA with the smart account, making the entire process seamless and secure. The platform also powers the backend wallet infrastructure, ensuring that all transactions and interactions are handled smoothly.

Session Keys

Session keys play a critical role in the system by enabling secure, session-based interactions between the user's smart account and the blockchain. When a user interacts with the application, temporary session keys are generated and signed, allowing the user to perform specific actions without needing to manually authorize each transaction. These keys are securely stored and used to sign permissions, updating the smart account with the necessary access rights. This mechanism not only improves security by limiting the scope and duration of the keys but also enhances user convenience by reducing the need for constant re-authentication.

Backend Wallet

The backend wallet, is the secure infrastructure that supports the smart accounts created within the system. These wallet s leverage the session keys created in the smart account to operate on their behalf with the blockchain. By handling these sensitive tasks, the backend wallet ensures that the smart accounts operate efficiently and securely, without requiring the user to manage complex security details themselves. This setup enables the execution of transactions and contract interactions with minimal friction, enhancing the user experience while maintaining high security standards.

Giza Platform

The Giza platform is integrated into the architecture to manage the system's capabilities, particularly in executing secure contract interactions. Giza is the running environment where the agents is deployed. The platform leverages all the components mentioned before and orchestrates its usage to provide a secure running environment. This integration allows the system to offload certain tasks to Giza, leveraging its specialized tools and infrastructure to ensure that operations are executed securely and efficiently.

The Agents-API is the internal backbone that facilitates secure interactions between the agent and the blockchain. This API manages the communication and execution of smart contract operations, ensuring that all transactions are handled securely and efficiently. The API is designed to work seamlessly with the agent runner, allowing for the secure execution of commands triggered by the frontend, jobs, or events. This API adds a security layer to ensure that interactions are handled properly.

Workflows

The workflows in this architecture describe how users interact with the system, starting from when they first connect to when various operations are carried out on the blockchain. These processes include creating and managing smart accounts, securely handling session keys, and triggering specific actions that the system needs to perform. Each step is designed to make blockchain interactions straightforward and secure, ensuring that users can easily carry out tasks without needing to worry about the underlying technical details.

Here is the iconography used for the diagrams:

Smart Account Creation

The diagram illustrates the process of Smart Account Creation in a blockchain system.

  1. User Connection: The user begins by connecting to the system using their Metamask wallet through a web interface.

  2. Giza Platform: Once connected, the system utilizes the Giza platform to facilitate the creation of a Smart Account.

  3. Smart Account Creation: The platform then interacts with the Ethereum blockchain (or any EVM-compatible chain) to create a Smart Account for the user.

If the EOA wallet has already connected, it will use a previously created smart account.

Session Keys Creation

The diagram illustrates the process of Session Keys Creation, focusing on the secure management of session keys and backend wallets for users interacting with agents.

  1. User Authorization: The process starts with a user connecting via their Metamask wallet. The user signs a permission request, which corresponds to the creation of session keys.

  2. Permission Storage: These session key permissions are then securely stored within the user's Smart Account on the blockchain.

  3. Backend Wallet Creation: For every External Owned Account (EOA) wallet interacting with an agent, a unique backend wallet is created. A backend wallet is a wallet allowed to perform operations on behalf of the user using the session keys. This ensures that each agent has its own backend wallet for enhanced security, meaning if a user participates in multiple agents, separate backend wallets are generated for each.

  4. Data Storage: The backend wallet, along with the session key data, is then created and securely stored via the Agents-API. This data is kept in a dedicated database for future reference.

This approach maintains a high level of security by isolating the backend wallets per agent and ensuring that session key permissions are appropriately managed and stored.

Agent Triggering

The diagram illustrates how an agent its triggered, which involves several components working together to execute blockchain operations.

The diagram illustrates the process of Agent Triggering, showcasing how various triggers initiate agent activities that interact with blockchain operations.

  1. Triggering Sources: The process begins with a trigger, which can originate from different sources like the frontend interface, a scheduled job, or an event within the system. These triggers signal the need for an agent to perform an operation.

  2. Agent Execution: This is the runtime environment where the agent logic is executed. The agent leverages Cairo as a provable programming language in order to add verifiability to the logic. When an agent its triggered it starts the process of managing the cairo execution. The agent interacts with an external data source if necessary.

  3. Agent-API Interaction: Once the agent processes the task, it communicates with the Agents-API. The API receives an operation to execute from the agent, indicating that the operation is ready for execution on the blockchain.

  4. Blockchain Operations: The Agents-API uses the operation to execute it on the user's behalf. This involves interacting with the blockchain through the backend wallet.

  5. Proof Generation and Verification: The agent generates proof of the operation, which is then verified in Starknet . This step ensures that the operation was completed correctly and securely.

Last updated