skills/brief-onchain/skills-lab/erc8004_fast_auth

erc8004_fast_auth

SKILL.md

ERC8004 Fast Auth

Usage

  • Category: Ecosystem
  • Mode: guide
  • Version: 0.1.0

Input Example

{
  "operation": "grant_operator",
  "chain": "bsc",
  "identityRegistry": "0x...",
  "agentId": 1,
  "operator": "0x...",
  "scope": "session",
  "ttlMinutes": 30
}

Fast Authorization Flow

  1. Ensure identity exists (if not, register first):
    npx fourmeme 8004-register <name> [imageUrl] [description]
    npx fourmeme 8004-balance <ownerAddress>
    
  2. Choose scope:
    • single agent: approve(operator, agentId)
    • session batch: setApprovalForAll(operator, true)
  3. Apply authorization on the ERC-721 identity registry contract.
  4. Verify authorization state before any delegated action:
    • getApproved(agentId)
    • isApprovedForAll(owner, operator)
  5. Execute delegated action window.
  6. Revoke immediately at window end:
    • approve(address(0), agentId) or
    • setApprovalForAll(operator, false)

Optional Wallet Rebind (ERC8004)

  • If rotating the payment wallet, use setAgentWallet(agentId, newWallet, deadline, signature) and verify with getAgentWallet(agentId).
  • Keep this step separate from operator grants to reduce blast radius.

Guardrails

  • Prefer the smallest scope and shortest TTL possible.
  • Never keep setApprovalForAll active longer than necessary.
  • Require human confirmation for grant and revoke steps.
  • Log granted operator, scope, start time, and revoke tx hash.

Source Anchors

Weekly Installs
1
First Seen
7 days ago
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1