LogoLogo
HomeTelegram
  • Welcome to Opus
  • Introduction
    • ▸ What is Opus?
      • Overview of the product
      • Vision: Automation layer for the decentralized web
      • Key verticals
      • EIP-7702
  • ▸ How Opus Works
    • Browser-based architecture (no install)
    • EIP-7702 session-based automation
    • AI agent decision-making process
    • Smart contract interaction layer
  • ⚙️ Architecture
    • ▸ System Overview
      • High-level architecture diagram
    • ▸ EIP-7702 Integration
      • Comparison vs EIP-4337 / traditional EOAs
    • ▸ Smart Contract Design
      • Core contracts:
      • Contract architecture diagrams
      • Gas considerations
  • ⚡ Use Cases
    • ▸ DeFi Automation
    • ▸ NFT Trading
    • ▸ DAO Governance
  • 🛠️ Getting Started
    • ▸ dApp Walkthrough
      • Getting Started with Opus dApp
      • Logs and automation history
  • 🧪 Developers
    • ▸ API Access
      • Endpoints for task creation, monitoring, retrieval
      • Auth via wallet signatures
    • ▸ Custom Strategies
      • DSL (Domain Specific Language) or JSON schema explanation
      • Writing your own task logic
    • ▸ Contract ABIs & Events
      • ABI snippets with examples
      • Event logs used by the platform
  • 🔐 Security & Audits
    • ▸ EIP-7702 Session Key Risks
      • Threat model
      • Session revocation mechanism
      • Time-bound delegation logic
Powered by GitBook
On this page
Export as PDF
  1. ⚙️ Architecture

▸ EIP-7702 Integration

What is EIP-7702 EIP-7702 enables temporary delegation for EOAs using signed session keys. It allows users to grant limited execution power to another key (usually browser-generated) without giving away full control.

Session payload format:

{
  "delegateKey": "0x123...",
  "validUntil": 1718000000,
  "scope": {
    "contracts": ["0xExecutor"],
    "methods": ["0x095ea7b3"]
  }
}

Session keys are used to:

  • Sign tasks

  • Execute condition checks

  • Trigger on-chain strategies without wallet prompts

mapping(address => Session) public sessions;

struct Session {
    uint256 validUntil;
    mapping(bytes4 => bool) allowedMethods;
}

function isSessionValid(address sessionKey, bytes4 method) public view returns (bool) {
    return sessions[sessionKey].validUntil > block.timestamp &&
           sessions[sessionKey].allowedMethods[method];
}

Security Model: Temporary Auth & Revocation

  • Sessions are revocable: users can invalidate any key

  • Time-bound to avoid risk of misuse

  • Restricted to specific methods/contracts

Revocation function:

function revokeSession(address key) external onlyOwner {
    delete sessions[key];
}

PreviousHigh-level architecture diagramNextComparison vs EIP-4337 / traditional EOAs

Last updated 12 days ago