Skip to content

mnemedb/clawdelegate

Repository files navigation

Clawdelegate — ClawdOS Agent Permission Bus

Agents that hold their own keys — but only the keys you carve for them. Built on ClawdOS for the MetaMask Smart Accounts Kit × 1Shot API × Venice AI Dev Cook Off.

Every ClawdOS daemon gets its own MetaMask Smart Account (Hybrid DeleGator, counterfactual on Sepolia). The user never hands over a private key — they delegate a scoped budget (ERC-7710 delegation + on-chain caveat enforcers), the agent works within it, and can redelegate a slice of that authority to a sub-agent (A2A). Cognition is Venice AI. Revoking a parent budget cascades through every child slice.

What's demonstrated

Hackathon requirement Where
MetaMask Smart Accounts Kit in the main flow every identity (user + all agents) is a toMetaMaskSmartAccount Hybrid DeleGator
ERC-7710 delegation w/ granular permission nativeTokenTransferAmount scope: "spend at most X ETH" — enforced on-chain at redemption
A2A coordination via redelegation agent → sub-agent createDelegation({ parentDelegation }); authority == parent hash verified
Venice AI as the agent brain budgeted agents run tasks through Venice (OpenAI-compatible API); no budget → HTTP 402, no brain
Revocation UX one click revokes a delegation and cascades through child slices
1Shot relayer (redemption leg) wired via ONESHOT_API_KEY / BUNDLER_URL env — see Redemption below

Run

npm install
cp .env.example .env   # add VENICE_API_KEY for a real brain (works offline without)
npm run dev            # web :5184 + api :8791
npm run demo           # headless Day-1 proof: 3 smart accounts, delegation, redelegation

The core idea (90 seconds)

  1. USER boots with a MetaMask Smart Account.
  2. Spawn agent → the daemon gets its own smart account identity.
  3. Grant budget → user signs an ERC-7710 delegation: scope: nativeTokenTransferAmount ≤ 0.01 ETH. Off-chain signature, zero gas; the cap is enforced on-chain by the caveat enforcer at redemption.
  4. Redelegate (A2A) → the agent carves a smaller slice (≤ 0.002 ETH) for a sub-agent. The redelegation's authority is the parent delegation hash — a verifiable permission chain.
  5. Run via Venice → the agent only gets inference if it holds an active budget (402 otherwise).
  6. Revoke → killing the root cascades through all child slices instantly.

Redemption (spending the budget on-chain)

Delegation creation/redelegation is fully off-chain (free). Actually spending requires the redeem leg: redeemDelegations submitted by the delegate. Two wired paths, both keyed by env:

  • 1Shot API permissionless relayer (ONESHOT_API_KEY) — gas-abstracted, EIP-7702 upgrade path
  • ERC-4337 bundler (BUNDLER_URL, e.g. Pimlico) for UserOp submission

Without keys/funds the app stays in "off-chain signing only" mode and says so in the status bar.

Stack

Vite + React + TS · Express · @metamask/delegation-toolkit 0.13 · viem · Venice AI · Sepolia

Part of the ClawdOS ecosystem (clawdos.space) — the agent OS on Base.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors