The ic-eliza-eth-wallet-plugin
is a demo plugin for the Eliza AI agent framework that enables a conversational AI agent to interact with an Ethereum wallet deployed on the Internet Computer (ICP).
There are two main drivers for this project:
- Increase the security of AI-driven transactions
- Provide a way to monitor and control AI agents once deployed
Typically, an AI agent would require direct access to private keys, which is inherently unsafe. This project demonstrates a more secure pattern where an AI agent running in a Web2 environment can request transactions from a Web3 Ethereum wallet while adhering to some pre-configured security rules. The wallet enforces constraints on what the AI agent can do, reducing the risk of unauthorized access to private keys.
To monitor and control the AI agent, a separate UI is provided to manage the wallet canister. This allows users to view the wallet's balance, address, and identity, as well as set security rules for the AI agent.
Components:
- ic-eliza-eth-wallet-plugin (this repository) → The Eliza plugin enabling an AI agent to interact with the wallet.
- ic-eliza-eth-wallet → The Ethereum wallet deployed on ICP, enforcing security rules.
ICP (Internet Computer) is a public blockchain where smart contracts run in a tamper-proof and decentralised environment. ICP supports threshold signatures, which allow multiple parties to jointly sign a transaction without revealing their private keys. This feature is used to secure the wallet canister, ensuring that no single party can access the wallet's private keys. Threshold signatures allow ICP to sign transactions on more than 20 different blockchains, including Ethereum.
This plugin enables an AI agent to execute four actions:
getAddress
→ Returns the Ethereum address managed by the ICP wallet.getBalance
→ Fetches the wallet’s ETH balance.getIdentity
→ Returns the Internet Computer identity the agent is using to interact with the wallet canister.sendEth(to, amount)
→ Requests a transfer of ETH, subject to wallet-imposed security rules.
The wallet canister enforces two security rules:
max_transaction_amount
: Limits the maximum amount of ETH that can be transferred in a single transaction.wait_time_minutes
: Enforces a cooldown period between transactions.
These constraints allow users to selectively grant an AI agent limited financial autonomy without exposing full control.
You: What is my ICP identity?
Agent: The Internet Computer Identity of this agent is o5x5x-rfcz6-hpwgu-p4bos-awelk-lcyjt-wajdg-2ye3l-n4c3t-n5vkk-yqe
You: send 0.0000001 eth to 0xabc...123
Agent: Successfully sent 0.0001 SepoliaETH to 0xabc...123
You: send 0.0000001 eth to 0xabc...123
Agent: Failed to send eth: Transaction too soon. Wait at least 5 minutes.
- Follow the basic steps to setup an Eliza agent project, see below.
- Deploy ic-eliza-eth-wallet to ICP locally (or on mainnet), see instructions here.
Before running the agent, add the following environment variables to your .env
file:
INTERNET_COMPUTER_PRIVATE_KEY=948e...
IC_ETH_WALLET_CANISTER=bkyz2-...-cai
The INTERNET_COMPUTER_PRIVATE_KEY
is the private key of the Internet Computer identity that the agent will use to interact with the wallet canister. It consists of any 32-byte hex string.
The IC_ETH_WALLET_CANISTER
is the ICP canister ID of the wallet canister. When deploying the wallet canister, you will receive this ID.
pnpm i
bash ./scripts/start.sh
Open src/character.ts
to modify the default character. Uncomment and edit.
To load custom characters instead:
- Use
pnpm start --characters="path/to/your/character.json"
- Multiple character files can be loaded simultaneously
# in character.ts
clients: [Clients.TWITTER, Clients.DISCORD],
# in character.json
clients: ["twitter", "discord"]
cp .env.example .env
* Fill out the .env file with your own values.
DISCORD_APPLICATION_ID="discord-application-id"
DISCORD_API_TOKEN="discord-api-token"
...
OPENROUTER_API_KEY="sk-xx-xx-xxx"
...
TWITTER_USERNAME="username"
TWITTER_PASSWORD="password"
TWITTER_EMAIL="your@email.com"
pnpm i && pnpm start
Note: this requires node to be at least version 22 when you install packages and run the agent.
services:
eliza:
environment:
- OPENROUTER_API_KEY=blahdeeblahblahblah
docker compose up
Make sure docker is running.
# The --load flag ensures the built image is available locally
docker buildx build --platform linux/amd64 -t eliza-starter:v1 --load .
services:
eliza:
environment:
- OPENROUTER_API_KEY=blahdeeblahblahblah
docker compose -f docker-compose-image.yaml up