hackquest logo

Companeon

A personal conversational AI agent for your wallet

视频

描述

Companeon — A personal AI agent for your wallet

A wallet-native AI agent that turns conversational intent into safe, on-chain execution.

Just say what you want, and the agent handles the rest.


The Problem

Crypto wallet management is overly manual and fragmented.

To complete simple tasks, users must navigate multiple apps, interpret gas fees, understand transaction data, and manage permissions — often without clear explanations or feedback.

Automation tools promise convenience, but typically require users to:

  • Move funds into new systems

  • Grant sweeping permissions

  • Trust untested smart contracts

Users are forced to choose between manual complexity or unsafe automation with no middle ground.


Our Solution

Companeon introduces a prompt-driven, wallet-native AI agent that lets users interact with their crypto wallet through natural conversation.

Users issue plain-English prompts to:

  • Execute actions (transfers, swaps, x402 payments)

  • Or simply gain insight (balances, activity, limits, history)

All execution happens through ERC-7715 delegated permissions enforced by MetaMask, keeping custody, limits, and enforcement inside the wallet.
Envio provides real-time blockchain context and a verifiable audit trail of all agent actions.

The result is a wallet-native AI agent that can act, explain, and adapt — without custody, proprietary execution contracts, or dangerous approvals.


How It Works

  1. Users grant explicit, time-bound ERC-7715 permissions

  2. Permissions are scoped, revocable, and enforced on-chain

  3. Users interact through natural conversation

  4. The agent interprets intent and plans actions using tools

  5. Execution occurs only within wallet-enforced constraints


What You Can Do

Wallet Insights

  • “What are my balances and total USD value?”

  • “What happened in my wallet today?”

  • “How much can my agent still spend?”

Execution (within limits)

  • “Send 50 USDC to vitalik.eth”

  • “Swap 2 ETH to USDC using fast gas”

  • “Reduce the amount to fit my daily limit”

Safety & Transparency

  • “Why did my last transfer fail?”

  • “Have I sent to this address before?”

  • “What actions has my agent taken this week?”

Autonomous & Scheduled Actions (A2A)

  • “Send 0.5 USDC to vitalik.eth every week”

  • “What recurring tasks are running?”

  • “Cancel the weekly transfer”


Core Features

Wallet-Enforced Autonomy (Advanced Permissions)

  • Executes transactions via ERC-7715 delegation enforced by MetaMask

  • No custody, no vaults, no proprietary execution contracts

  • Token-level, time-bound spending rules with instant revocation

  • Permission-aware state queries (remaining spend, reset timing, expiry)

Agentic Intelligence (Reasoning + Tool Chaining)

  • LLM-powered multi-step reasoning (ReAct loop)

  • Autonomous tool chaining and transactions (swaps, web browsing, transfers, gas, prices, security, history, etc)

  • Conversational and context-aware orchestration through a familiar chat interface

  • Automatic error recovery with plain-English explanations and actionable suggestions

Agent-to-Agent (A2A) Delegation & Automation

  • Enables autonomous agents using chained ERC-7715 delegations

  • Companeon can re-delegate a subset of permissions to specialized agents

  • Each agent uses its own key, enforced on-chain by MetaMask

  • Parent revocation immediately disables all sub-agents

  • Sub-delegations are validated by DelegationManager

Full Wallet Operations

  • Transfers: ETH + any ERC-20

  • Swaps: Uniswap v4 Universal Router

  • Balances: Real-time portfolio with USD conversions

  • History: Full wallet history via Envio

x402 Integration (Paid Agent Tools)

  • Access to Perplexity Web Search, Image generation, and other paid APIs

  • USDC micropayments settled autonomously through agent

  • All payments executed under the same ERC-7715 constraints + audit trail


ERC-7715 Advanced Permissions Integration (MetaMask)

Companeon is built entirely on ERC-7715 delegated permissions using the MetaMask Smart Accounts Kit. Transfers, swaps, and x402 payments are executed through MetaMask’s DelegationManager and enforced directly by the user’s wallet.

There is no custody, no execution vault, and no proprietary smart contracts. All enforcement happens on-chain and remains wallet-native.

Permission model

Companeon uses two ERC-7715 permission types:

  • native-token-periodic for ETH transfers with independent limits

  • erc20-token-periodic for ERC-20 transfers such as USDC

Each token operates within its own permission context, allowing the agent to correctly route ETH and ERC-20 executions through the appropriate enforcers.

What each permission includes

Every delegation created by the user is explicit and human-readable. It defines:

  • A spending limit per period (for example, 1 ETH per day or 10 USDC per hour)

  • A period duration (hourly, daily, weekly, monthly, or yearly)

  • A start time

  • An expiration date

  • A justification string (such as “AI agent autonomous wallet operations”)

Permissions can be revoked instantly at any time.

Smart account upgrade (EOA → ERC-7702)

If the user begins with an EOA, Companeon performs a one-time upgrade to an ERC-7702 smart account using MetaMask Smart Accounts Kit. The user keeps full ownership of their wallet and keys.


Agent-to-Agent Delegation (ERC-7715 Re-Delegation)

Companeon uses ERC-7715’s authority chaining model to support agent-to-agent delegation.

A typical delegation flow looks like:

User Smart Account
  └─ Delegation → Companeon (conversational agent)
        └─ Sub-delegation → Specialized Agent (transfer / DCA)

Each sub-delegation:

  • References the hash of the parent delegation as its authority

  • Enforces equal or stricter limits than the parent

  • Is validated on-chain by MetaMask’s DelegationManager at execution time

Autonomous agents execute using their own keys, but must present the full delegation chain during execution. If the user revokes the original permission, all sub-delegations become invalid automatically.

This allows Companeon to support safe automation without introducing custody, execution vaults, or privileged contracts.


Permission-Aware Agent Tools

Instead of treating permissions as static guardrails, Companeon exposes live permission state directly to the agent as callable tools.

MetaMask Smart Accounts Kit functionality is wrapped so the LLM can read, reason about, and adapt to real permission constraints in real time.

  1. check_delegation_limits

This is a single agent tool call that returns a complete snapshot of all active ERC-7715 permissions using real on-chain data, not simulations or estimates.

Under the hood, one call orchestrates multiple official MetaMask SDK methods in sequence:

  • createCaveatEnforcerClient()
    Creates a client for interacting with ERC-7715 enforcer contracts

  • getSmartAccountsEnvironment()
    Loads chain configuration and DelegationManager addresses

  • decodeDelegations()
    Decodes stored permission contexts from the delegation

  • getNativeTokenPeriodTransferEnforcerAvailableAmount()
    Reads the actual remaining ETH allowance and reset timing

  • getErc20PeriodTransferEnforcerAvailableAmount()
    Reads the actual remaining ERC-20 allowance and reset timing for each token

  • decodeExpirationFromDelegation() (custom helper)
    Parses TimestampEnforcer caveats to extract expiration dates

From this single call, the agent learns:

  • Remaining ETH allowance

  • Remaining ERC-20 allowances by token

  • When each limit resets

  • When permissions expire

  • Which permission context applies to the current action

This allows the agent to proactively explain constraints before execution, for example:

“You have 0.5 ETH remaining today. Your limit resets in 3 hours.”
“Only 1.5 USDC is available under your current permission.”


  1. diagnose_delegation_error

When a delegated execution fails, the DelegationManager emits low-level enforcer revert messages.

This tool is a custom error interpreter that analyzes those real error strings and maps them to clear explanations.

Examples include:

  • NativeTokenPeriodTransferEnforcer:transfer-amount-exceeded

  • ERC20PeriodTransferEnforcer:transfer-amount-exceeded

  • Timestamp expiration failures

  • Scope or context violations

Instead of surfacing cryptic errors, Companeon explains what went wrong and suggests concrete next steps, such as reducing the amount, waiting for the reset, or extending the permission.


Why this matters

Together, these tools allow the Companeon agent to:

  • Predict failures before execution

  • Explain failures after execution

  • Adapt its behavior within wallet-enforced constraints

Permissions are not just safety rails. They become part of the conversation.


Envio Integration — Agent-Native Blockchain Intelligence

Companeon integrates Envio HyperSync directly into the agent runtime, exposing blockchain history and context as callable tools instead of dashboards, explorers, or background indexers.

Rather than returning raw logs or transaction hashes, Envio data is queried, structured, and interpreted by the agent so users can ask natural questions and receive clear explanations.

How Envio is used

Companeon uses Envio HyperSync’s /query endpoint as the single low-level primitive for all blockchain intelligence.

All Envio-wrapped agent tools are built on top of this endpoint. They differ only in the type of data queried, the filters applied, and how results are aggregated and interpreted.

This avoids RPC polling, custom indexers, or bespoke subgraphs.

Base endpoint

POST https://sepolia.hypersync.xyz/query

Common characteristics

  • Queries real on-chain logs and transactions

  • Uses selective field extraction for minimal payloads

  • Executes parallel queries when needed (ETH + ERC-20)

  • ~2000× faster than standard RPC


Envio-Wrapped Agent Tools

Each Envio tool is a single agent-level call that orchestrates one or more HyperSync queries and returns a meaningful snapshot of wallet state that the agent can reason over in natural language.

Wallet Activity & History

envio_get_recent_activity
Generates a high-level summary of wallet activity over a selected time window.

Under the hood, the agent runs parallel ETH and ERC-20 HyperSync queries and aggregates results into:

  • Incoming vs outgoing activity

  • Net flow

  • Transaction counts

The output is a behavioral summary, not raw transactions.

Example prompt
“What happened in my wallet today?”


Transfers & Movement

envio_get_token_transfers
Retrieves ERC-20 transfer history for a wallet, optionally scoped to a specific token.

Returns token, amount, timestamp, and counterparty for each transfer.

Example prompts
“Show my last 3 token transfers”
“Show my USDC transfers”


envio_get_eth_transfers
Retrieves native ETH transfer history for the wallet.

Returns ETH value, timestamp, and counterparty.

Example prompt
“Show my ETH transfers”


envio_get_all_transfers
Provides a unified ETH + ERC-20 transfer timeline.

Executes ERC-20 log queries and native ETH transaction queries in parallel, then merges results by timestamp.

Example prompt
“Show all the transfers in my wallet”


Usage & Trends

envio_count_wallet_transactions
Computes transaction counts and usage trends over time.

Uses minimal log queries optimized for counting rather than full event retrieval.

Example prompt
“How many transactions did I make this month?”


Delegation Audit & Transparency

envio_get_delegation_executions
Tracks all ERC-7715 delegated executions emitted by MetaMask’s DelegationManager.

Returns:

  • When delegated permissions were used

  • Whether execution was performed by the user or the AI agent

Creates a verifiable, on-chain audit trail of agent activity.

Example prompts
“What actions has the AI taken with my wallet?”
“How many delegated transactions were executed this week?”


envio_get_subdelegation_activity
Tracks on-chain activity from autonomous agents running under sub-delegations (A2A).

Returns

  • Most recent sub-delegation executions (agent name, timestamp, tx hash)

  • Counts by agent type for the selected period

Example prompts
“What have my autonomous agents done?”
“Show A2A activity”
“What did the DCA agent execute?”
“Show sub-delegation executions”


Interaction History & Security Context

envio_check_recipient
Determines whether the wallet has previously interacted with a recipient address.

Returns first-time vs historical interaction status and prior transfer frequency, used as a safety signal before transfers.

Example prompt
“Have I sent to this address before?”


Why this matters

Together, these Envio tools allow the Companeon agent to:

  • Recall and summarize wallet history on demand

  • Explain past actions with verifiable on-chain evidence

  • Reason about future actions using historical and security context

Envio turns raw blockchain data into agent memory, making Companeon a context-aware, auditable, wallet-native agent runtime rather than a dashboard or analytics tool.


Registered Tool List (Agent Tools)

Category

Tools

Description

Wallet

get_holdings, get_token_balance

Balances and portfolio views

Transfers

preview_transfer, transfer_funds

ETH + ERC-20 transfers with simulation/preview

Swaps

get_swap_quote, execute_swap, check_pool_liquidity

Uniswap v4 Universal Router swaps + liquidity checks

Gas

get_gas_price, estimate_gas_cost

Real-time gas and fee estimates

Security

goplus_check_address, envio_check_recipient

Risk signals plus “have I interacted with this recipient before?”

Permissions

check_delegation_limits, diagnose_delegation_error

ERC-7715 state, remaining spend, reset timing, expiry, and human-readable failures

History (Envio)

envio_get_token_transfers, envio_get_eth_transfers, envio_get_all_transfers, envio_get_recent_activity, envio_count_wallet_transactions, envio_get_delegation_executions, envio_check_recipient

HyperSync-powered wallet history + delegation audit trail

x402 Payments

get_x402_quote, list_x402_services, pay_x402, request_x402_refund

Payment flow and management for x402 services

x402 Services

browse_web, web_research, generate_image, onchain_analytics

Paid tools the agent can purchase and run via x402


Tech Stack

Layer

Technology

Purpose

Frontend

Next.js

Conversational UI + wallet connection

Agent Runtime

Google Gemini 2.5 Pro

Intent reasoning + tool orchestration

Wallet Permissions

MetaMask Smart Accounts Kit (ERC-7715)

Wallet-native enforcement

Blockchain Intelligence

Envio HyperSync

History, context, audit trail

Backend Hosting

Google Cloud Run

Agent runtime + orchestration

本次黑客松进展

Built a complete ERC-7715 conversational wallet agent with 30 tools, ReAct reasoning loop, and real on-chain execution. Features Envio HyperSync for 2000x faster blockchain queries, GoPlus security integration, x402 micropayments, and live Sepolia testnet demo. Agent executes transfers, swaps, and API calls while maintaining zero custody through MetaMask delegation.

技术栈

Next
Web3
Ethers
Node

融资状态

None, open to fundraising

队长
RRichard Chung
赛道
DeFiInfraAI