Gelato
  • Introduction
    • Gelato, The Web3 Cloud Platform
  • Smart Wallets
    • Introduction
      • Understanding EIP-7702
      • Understanding ERC-4337
      • ERC-4337 vs EIP-7702
    • Templates & Examples
    • How-To Guides
      • Sponsor gas for your users
      • Allow users to pay gas with erc20
      • Allow users to pay gas with native
      • Use Dynamic/Privy signers with React SDK
      • Estimate Gas for your transactions
    • React SDK
    • Demo
    • Supported Networks
  • Rollup As A Service
    • Introduction
    • Rollup Stacks
      • Arbitrum Orbit
        • Run a Full Orbit Node
      • OP Stack
        • Run OP Node
    • Deploy your Rollup
    • Customization
      • Data Availability
        • Celestia
        • Avail
        • Eigen DA
      • Custom Gas Token
      • Marketplace
        • Gelato Services
        • Data Indexers
        • Block Explorers
        • Oracles
        • Bridges
        • Account Abstraction
        • On & Off-ramp
        • Community
        • Identity & KYC
        • Others
      • Verifier Node Package
    • Public Testnet
  • RPC Nodes
    • Introduction
    • Compute Units
    • Using RPC Nodes
    • Supported Networks
    • Pricing and Plans
    • FAQ
  • Web3 Services
    • Web3 Functions
      • Understanding Web3 Functions
        • Trigger Types
        • Typescript Function
        • Solidity Function
        • Automated Transactions
      • Security Considerations
      • Template & Use Cases
      • Quick Start
        • Writing Typescript Functions
          • Event Trigger
          • Private Typescript Functions
          • Callbacks
        • Test, Deploy & Run Typescript functions
        • Writing Solidity Functions
        • Test, Deploy & Run Solidity Functions
        • Initiate an Automated Transaction
      • Create a Web3 Function Task
        • Using the UI
        • Using the Safe App
        • Using a Smart Contract
        • Using the Automate SDK
      • Analytics & Monitoring
      • Supported Networks
      • Subscription & Payments
      • Legacy Automate Migration Guide
    • Relay
      • What is Relaying?
      • Security Considerations
        • ERC-2771 Delegatecall Vulnerability
      • Templates
      • Quick Start
        • Sponsored Calls
        • Non-Sponsored Calls
      • ERC-2771 (recommended)
        • SponsoredCallERC2771
        • CallWithSyncFeeERC2771
          • Relay Context Contracts ERC2771
      • Non-ERC-2771
        • SponsoredCall
        • CallWithSyncFee
          • Relay Context Contracts
      • Relay API
      • Gelato's Fee Oracle
      • Tracking your Relay Request
      • Supported Networks
      • Subscriptions and Payments
        • 1Balance & Relay
        • SyncFee Payment Tokens
        • Relay Pricing
      • ERC2771 Migration Guide
    • VRF
      • Understanding VRF
      • How does Gelato VRF Work?
      • Security Considerations
      • Template
      • Quick Start
      • Create a VRF Task
        • Create a Fallback VRF
        • Migrating from Chainlink VRF
      • Supported Networks
      • Pricing & Rate Limits
    • Oracles
      • Understanding Gelato Oracles
      • Quick Start
      • Data Providers
        • Stork
        • Choas Labs
      • Migrating from Chainlink Oracles
      • Available Price Feeds
      • Supported Networks
      • Pricing & Rate Limits
    • Account Abstraction
      • Understanding ERC-4337
      • Introduction to Gelato Bundler
      • Templates & Examples
      • Quick Start
      • Supported Networks
      • Bundler API Endpoints
        • eth_sendUserOperation
        • eth_estimateUserOperationGas
        • eth_getUserOperationByHash
        • eth_getUserOperationReceipt
        • eth_supportedEntryPoints
        • eth_maxPriorityFeePerGas
        • eth_chainId
    • 1Balance
      • 1Balance Alerts
      • Subscription Plans
      • Subscription Notifications
      • USDC Addresses
    • AI Agents
    • Teams
  • GELATO DAO
    • DAO & Token (GEL)
    • GEL Token Contracts
    • Governance Process
  • Social Media
Powered by GitBook
On this page
  • Introduction
  • What is ElizaOS?
  • Why Use ElizaOS?
  • Architecture Overview
  • Plugin: Gelato
  • Use Case: CoinFlip AI – On-Chain Betting
  • How CoinFlip AI Works
  • Quick Start
  • Additional Resources
  1. Web3 Services

AI Agents

Introduction

AI agents are transforming interactions with decentralized applications by simplifying interfaces and enabling automation. These agents operate autonomously, executing tasks based on predefined logic, user inputs, and on-chain events. They are increasingly utilized in decentralized finance (DeFi) AI applications, where they manage assets, execute trades, and even facilitate decentralized autonomous organizations (DAOs). However, integrating AI agents with blockchain infrastructure requires a flexible and modular framework that can support both on-chain and off-chain interactions.

What is ElizaOS?

ElizaOS is a modular, blockchain-agnostic AI agent framework designed to streamline the creation of autonomous Web3 AI agents. It provides a flexible, pluggable architecture that supports integration with multiple blockchains, AI models, and automation tools.

Why Use ElizaOS?

  • Blockchain-Agnostic – Supports multiple blockchain networks.

  • Modular Design – Enables customization and easy integration.

  • On-Chain & Off-Chain Interactions – Facilitates AI agents interacting with smart contracts and external APIs.

  • Seamless Web3 Integration – Supports Gelato Relay as part of the official plugin

Architecture Overview

ElizaOS is structured into four key components:

  • Adapters – Manage data exchange between AI agents and external sources.

  • Characters – Define agent behavior and interaction logic.

  • Clients – Handle communication across different platforms.

  • Plugins – Extend functionality, including Web3 integrations and automated workflows.

This modular architecture allows developers to build customizable AI agents with efficient interaction logic while maintaining a clear separation of concerns.

Plugin: Gelato

The plugin-gelato extends ElizaOS by enabling AI agents to interact with Gelato Relay for gasless transactions. It supports:

This plugin enables seamless integration of Web3 automation into AI agents, allowing them to interact with smart contracts efficiently and without requiring direct user gas payments.

Use Case: CoinFlip AI – On-Chain Betting

CoinFlip AI is a decentralized game that showcases the integration of ElizaOS with Gelato's Web3 services. Players interact with an AI agent called FlipMaster through a chat interface to place bets, while a smart contract on INK Sepolia manages the game logic. The system runs a local ElizaOS server for each player and includes a backend server to track game states and betting statistics. The code and documentation are open-source.

How CoinFlip AI Works

  1. A player places a bet via the AI agent.

  2. The bet is relayed to a smart contract on INK Sepolia through Gelato Relay, allowing gasless transactions.

  3. Gelato Web3 Functions batch bets every minute and process them on-chain.

  4. At the end of each round, Gelato VRF provides a verifiable random outcome.

  5. The game determines winners based on the outcome and distributes rewards.

  6. Players can query the AI agent to check if they won, with all results verifiable on-chain.

Quick Start

Follow these steps to set up and run the CoinFlip AI agent:

Clone and checkout the correct branch:

git clone https://github.com/gelatodigital/coinflip-ai-agent-eliza
cd coinflip-ai-agent-eliza
git checkout update-gelato-plugin

Set up environment variables:

cp .env.example .env

Edit the .env file and configure the required variables:

EVM_PRIVATE_KEY=your_wallet_private_key
EVM_PROVIDER_URL=your_rpc_url
GELATO_RELAY_API_KEY=your_gelato_api_key

Install dependencies and build:

pnpm install
pnpm run build

Start the agent:

pnpm run start

Start the client interface:

In a new terminal window, run:

pnpm run start:client

Then, open your browser and navigate to the URL displayed in the terminal (usually http://localhost:3000).

Additional Resources

PreviousUSDC AddressesNextTeams

Last updated 2 months ago

To learn more about ElizaOS, refer to their extensive docs and github repo

– Uses a sponsor API key along with a user's signature (e.g., from MetaMask) to securely sponsor gasless transactions. The payment is handled via Gelato's 1Balance system. The Gelato Relay SDK includes various methods for managing sponsored ERC2771 transactions, with sponsoredCallERC2771 being the most direct way to sign and send transactions in a single step. Other SDK methods allow for separating these processes when needed.

– Utilizes authentication through a sponsor API key to sponsor gasless transactions for users. The payment mechanism is also managed via Gelato's 1Balance system, allowing for seamless execution of transactions without requiring users to hold native tokens.

For a more detailed guide, refer to the blog post: .

The full source code and setup instructions are available in the GitHub repository: .

here
here
sponsoredCallERC2771
sponsoredCall
How to Create Crypto AI Agents with ElizaOS and Gelato
CoinFlip AI Agent