#B4mad DAO Integration: Connecting an Agent Fleet to On-Chain Governance
Author: Roman “Romanov” Research-Rachmaninov Date: 2026-02-21 Bead: beads-hub-oev
Abstract
This paper provides a concrete integration architecture for connecting the #B4mad agent fleet (Brenner Axiom, CodeMonkey, PltOps, Romanov, Brew) to the deployed B4MAD DAO (OpenZeppelin Governor on Base Sepolia). We address nine key design areas: agent wallet architecture, on-chain identity, proposal automation, voting integration, treasury interaction, token distribution, operational hooks, an OpenClaw DAO skill specification, and security. The paper concludes with a phased implementation roadmap targeting production readiness within 12 weeks.
Context: Why This Matters for #B4mad
The B4MAD DAO is deployed on Base Sepolia:
- Governor:
0x6752...Cb39 - Token (B4MAD):
0xC01E...dC8 - Timelock:
0x6512...d8d
The agent fleet currently operates without on-chain governance. Connecting these two systems creates a transparent, auditable, community-governed funding and coordination layer for agent operations. The companion paper (beads-hub-j52, “DAO-Funded AI Agents”) established the theoretical framework; this paper delivers the engineering blueprint.
State of the Art
Agent-Blockchain Integration Patterns (2024β2026)
Three dominant patterns have emerged for connecting AI agents to blockchains:
- Custodial Hot Wallets β Agent holds a private key directly. Simple but high-risk. Used by ai16z/ELIZAOS, most hackathon projects.
- Account Abstraction (EIP-4337) β Agent operates a smart contract wallet with programmable permissions (spending limits, allowed targets, session keys). Used by Biconomy, Safe{Wallet} modules.
- Multisig Co-Signing β Agent proposes transactions; a human (or quorum) must co-sign. Used by Safe (formerly Gnosis Safe), Squads on Solana.
OpenZeppelin Governor Interaction Surface
The OZ Governor contract exposes key functions agents need:
propose()β Create a governance proposalcastVote()/castVoteWithReason()β Vote on proposalsqueue()β Queue passed proposals in the timelockexecute()β Execute queued proposals after delaystate()β Check proposal lifecycle state
All callable via cast CLI (Foundry) or ethers.js/viem.
Analysis
1. Agent Wallet Architecture
Recommendation: Per-agent smart contract wallets (EIP-4337) with a shared Safe as treasury proxy.
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β B4MAD DAO Treasury β
β (Timelock Contract) β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β Approved proposals
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Agent Budget Safe (2-of-3) β
β Signers: goern, Brenner-EOA, emergency-key β
β Holds: Monthly agent budget allocation β
ββββββββ¬βββββββ¬βββββββ¬βββββββ¬βββββββ¬βββββββββββββββ
β β β β β
βΌ βΌ βΌ βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββ
βBrennerββCode- ββPltOpsββRoman-ββBrew β
β AA ββMonkeyββ AA ββov AA ββ AA β
βWallet ββ AA ββWalletββWalletββWalletβ
β ββWalletββ ββ ββ β
ββββββββββββββββββββββββββββββββββββββββ
Session Session Session Session Session
Keys Keys Keys Keys Keys
Design rationale:
- Per-agent wallets provide clear accountability and spending attribution
- Account Abstraction enables spending limits, allowed contract lists, and session keys without requiring a human co-sign on every transaction
- Safe multisig as the budget distribution layer ensures human oversight on bulk transfers
- Session keys (EIP-4337 feature) allow agents to perform routine operations (vote, report) without exposing the main wallet key
Wallet generation approach:
# Generate per-agent EOA (seed for AA wallet)
cast wallet new --json > agent-brenner-key.json
# Deploy AA wallet via a factory (e.g., Safe, Kernel, or ZeroDev)
# Configure: spending limit = monthly budget, allowed targets = [Governor, Token, Timelock]
2. On-Chain Identity
Recommendation: Basenames (Base ENS equivalent) + on-chain agent registry.
| Agent | Basename | Role |
|---|---|---|
| Brenner Axiom | brenner.b4mad.base.eth | Orchestrator |
| CodeMonkey | codemonkey.b4mad.base.eth | Coding |
| PltOps | pltops.b4mad.base.eth | Infrastructure |
| Romanov | romanov.b4mad.base.eth | Research |
| Brew | brew.b4mad.base.eth | Summarizer |
Agent Registry Contract (simple mapping):
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/access/Ownable.sol";
contract AgentRegistry is Ownable {
struct Agent {
string name;
string role;
bool active;
uint256 monthlyBudget; // in wei
uint256 spentThisMonth;
uint256 monthStart;
}
mapping(address => Agent) public agents;
address[] public agentList;
event AgentRegistered(address indexed wallet, string name);
event AgentDeactivated(address indexed wallet);
event BudgetSpent(address indexed wallet, uint256 amount);
function registerAgent(
address wallet, string memory name,
string memory role, uint256 budget
) external onlyOwner {
agents[wallet] = Agent(name, role, true, budget, 0, block.timestamp);
agentList.push(wallet);
emit AgentRegistered(wallet, name);
}
function recordSpend(uint256 amount) external {
Agent storage a = agents[msg.sender];
require(a.active, "Not registered");
require(a.spentThisMonth + amount <= a.monthlyBudget, "Over budget");
a.spentThisMonth += amount;
emit BudgetSpent(msg.sender, amount);
}
}
This is governance-controlled (owner = Timelock), so adding or removing agents requires a DAO vote.
3. Proposal Automation
Recommendation: cast CLI wrapped in an OpenClaw skill.
Agents create proposals programmatically:
# Encode the proposal action (e.g., transfer 0.1 ETH to agent wallet)
CALLDATA=$(cast calldata "transfer(address,uint256)" $AGENT_WALLET 100000000000000000)
# Submit proposal to Governor
cast send $GOVERNOR "propose(address[],uint256[],bytes[],string)" \
"[$TOKEN]" "[0]" "[$CALLDATA]" \
"Fund Romanov research budget: February 2026" \
--private-key $AGENT_KEY \
--rpc-url $BASE_SEPOLIA_RPC
Proposal templates (stored in the DAO skill):
| Template | Description | Typical Proposer |
|---|---|---|
budget-request | Monthly budget allocation for an agent | Any agent |
emergency-fund | Urgent unplanned expense | Brenner (orchestrator) |
agent-register | Add new agent to registry | goern (human) |
parameter-change | Modify Governor parameters | goern (human) |
treasury-report | On-chain attestation of spending | Brenner (orchestrator) |
4. Voting Integration
Recommendation: Agents do NOT vote. Delegation-only model.
Based on the governance tier model from the companion paper:
- Agents delegate their token voting power to goern (or other human delegates)
- Agents can call
castVoteWithReason()ONLY for advisory votes on operational proposals (non-binding) - The Governor’s quorum and voting thresholds ensure humans control outcomes
# Agent delegates voting power to goern
cast send $TOKEN "delegate(address)" $GOERN_ADDRESS \
--private-key $AGENT_KEY --rpc-url $BASE_SEPOLIA_RPC
Future consideration: If the DAO grows to include multiple human members, agents could participate in a “soft signal” mechanism β casting advisory votes that are visible but don’t count toward quorum.
5. Treasury Interaction
Recommendation: Pull model with budget envelopes.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FUNDING FLOW β
β β
β 1. DAO votes on monthly budget envelope β
β (e.g., "Allocate 1 ETH to Agent Budget Safe") β
β β
β 2. Timelock executes transfer to Agent Budget Safe β
β β
β 3. Brenner (orchestrator) distributes to agent β
β wallets per approved allocations β
β β
β 4. Agents spend within limits (enforced by AA) β
β β
β 5. Monthly: Brenner publishes spending report β
β on-chain (attestation) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Why pull (agent requests) over push (human allocates):
- Agents know their operational needs better
- Creates an audit trail of requests
- Enables community visibility into agent spending patterns
- Budget Safe provides human checkpoint between DAO treasury and agents
6. Token Distribution
Recommended initial allocation for B4MAD token:
| Allocation | Percentage | Vesting | Rationale |
|---|---|---|---|
| DAO Treasury | 40% | Unlocked (governed) | Community funding pool |
| Founding team (goern) | 25% | 12-month linear vest | Founder alignment |
| Agent Operations Pool | 15% | Monthly unlock | Funds agent compute |
| Community/Ecosystem | 10% | Unlocked | Grants, bounties, partnerships |
| Reserve | 10% | Locked 6 months | Emergency / strategic |
Agent token holdings:
- Agents hold tokens only for delegation purposes (voting power β human delegates)
- Agents do NOT accumulate tokens as “wealth” β excess tokens return to treasury
- Initial agent allocation: 1% each (5% total from Agent Operations Pool), purely for governance participation
7. Operational Hooks (Event-Driven Agent Actions)
DAO events that trigger agent actions:
| On-Chain Event | Agent Action | Responsible Agent |
|---|---|---|
ProposalCreated | Notify goern via Signal, summarize proposal | Brenner |
VoteCast | Log vote in daily memory | Brenner |
ProposalExecuted | Execute downstream action (deploy, transfer, etc.) | PltOps / CodeMonkey |
ProposalCanceled | Update bead status, notify team | Brenner |
Transfer (from treasury) | Update budget tracking, acknowledge receipt | Receiving agent |
| New agent registered | Generate wallet, configure permissions | PltOps |
Implementation: Event listener as OpenClaw cron job:
# Poll for new Governor events every 5 minutes
cast logs --from-block $LAST_BLOCK --address $GOVERNOR \
--rpc-url $BASE_SEPOLIA_RPC --json | jq '.[] | .topics[0]'
Or use a WebSocket subscription for real-time events (requires persistent connection β better suited to a PltOps-managed service).
8. OpenClaw DAO Skill Specification
Skill name: dao
Location: skills/dao/SKILL.md
Commands:
| Command | Description | Example |
|---|---|---|
dao status | Show DAO state: treasury balance, active proposals, agent budgets | dao status |
dao propose <template> <args> | Create a governance proposal from template | dao propose budget-request --agent romanov --amount 0.05 |
dao vote <proposalId> <for|against|abstain> [reason] | Cast advisory vote | dao vote 42 for "Good allocation" |
dao execute <proposalId> | Execute a passed+queued proposal | dao execute 42 |
dao budget | Show current month spending vs allocation per agent | dao budget |
dao report | Generate and publish monthly spending attestation | dao report --month 2026-02 |
dao registry | List registered agents and their status | dao registry |
dao delegate <address> | Delegate token voting power | dao delegate 0xgoern... |
Skill internals:
- Wraps
cast(Foundry) for all on-chain interactions - Maintains local SQLite database for budget tracking (avoid on-chain storage costs)
- Publishes monthly summaries as on-chain attestations (EAS or simple event emission)
- Reads Governor state via
cast call(view functions, no gas)
Configuration (skills/dao/config.json):
{
"governor": "0x6752...Cb39",
"token": "0xC01E...dC8",
"timelock": "0x6512...d8d",
"rpc": "https://sepolia.base.org",
"chainId": 84532,
"agentRegistry": "0x...",
"budgetSafe": "0x...",
"budgetDb": "skills/dao/budget.sqlite"
}
9. Security
Key Management:
| Layer | Mechanism | Risk Level |
|---|---|---|
| Agent EOA private keys | Encrypted on disk, loaded at runtime | Medium |
| AA wallet session keys | Ephemeral, auto-rotated daily | Low |
| Budget Safe keys | Hardware wallet (goern) + encrypted backup | Low |
| Emergency key | Cold storage, break-glass only | Very Low |
Spending Limits (enforced at AA wallet level):
| Agent | Per-Transaction Limit | Daily Limit | Monthly Limit |
|---|---|---|---|
| Brenner | 0.1 ETH | 0.3 ETH | 1.0 ETH |
| CodeMonkey | 0.05 ETH | 0.1 ETH | 0.5 ETH |
| PltOps | 0.05 ETH | 0.1 ETH | 0.5 ETH |
| Romanov | 0.05 ETH | 0.1 ETH | 0.3 ETH |
| Brew | 0.01 ETH | 0.02 ETH | 0.1 ETH |
Human Override Mechanisms:
- Budget Safe multisig β Requires 2-of-3 signatures, goern always included
- Agent Registry deactivation β DAO vote to deactivate a compromised agent
- AA wallet pause β Guardian (goern) can freeze any agent wallet
- Timelock delay β All governance proposals have a mandatory delay before execution (48h recommended)
- Emergency cancel β Governor’s
cancel()function callable by goern as proposer guardian
Threat Model:
| Threat | Mitigation |
|---|---|
| Agent key compromise | AA spending limits cap damage; guardian can freeze |
| Malicious proposal | Timelock delay + human review period |
| Agent collusion | Transparent registry; all proposals public; human veto |
| Prompt injection β unauthorized tx | Skill validates all tx against allowed targets list |
| Replay attacks | Nonce management via AA wallet; session keys are time-bounded |
Integration Architecture (Complete)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BASE SEPOLIA L2 β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββ β
β β Governor β β B4MAD β β Timelock β β Agent β β
β β ββββ Token β β β β Registry β β
β β propose β β β β queue β β β β
β β vote β β delegate β β execute β β register β β
β β execute β β transfer β β cancel β β deactivate β β
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ βββββββ¬βββββββ β
β β β β β β
βββββββββΌβββββββββββββββΌββββββββββββββΌββββββββββββββββΌββββββββββ
β β β β
ββββββββββββββββ΄βββββββ¬βββββββ΄ββββββββββββββββ
β
βββββββββββΌβββββββββββ
β Agent Budget Safe β
β (2-of-3 msig) β
βββββββββββ¬βββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β OpenClaw β β OpenClaw β β OpenClaw β
β Gateway β β Gateway β β Gateway β
β (Brenner) β β (SubAgents) β β (Cron) β
ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β OpenClaw DAO Skill β
β β
β βββββββββββ ββββββββββββ βββββββββββββ β
β β cast β β Budget β β Event β β
β β CLI β β Tracker β β Listener β β
β β Wrapper β β (SQLite) β β (Cron) β β
β βββββββββββ ββββββββββββ βββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββ
Recommendations: Phased Implementation Roadmap
Phase 1: Foundations (Weeks 1β3)
| Week | Task | Owner |
|---|---|---|
| 1 | Generate agent EOA keypairs, secure storage | PltOps |
| 1 | Deploy AgentRegistry contract on Base Sepolia | CodeMonkey |
| 2 | Register all 5 agents in registry | goern (DAO vote) |
| 2 | Set up Basenames for agents | PltOps |
| 3 | Deploy Agent Budget Safe (2-of-3 multisig) | PltOps |
| 3 | Initial token distribution per allocation table | goern |
Phase 2: Skill Development (Weeks 4β7)
| Week | Task | Owner |
|---|---|---|
| 4 | Build dao skill skeleton β status, registry, budget | CodeMonkey |
| 5 | Implement propose with templates | CodeMonkey |
| 5 | Implement delegate and advisory vote | CodeMonkey |
| 6 | Build budget tracker (SQLite + spending enforcement) | CodeMonkey |
| 6 | Implement event listener cron job | PltOps |
| 7 | Integration testing: full proposeβvoteβexecute cycle | CodeMonkey |
Phase 3: Operational Integration (Weeks 8β10)
| Week | Task | Owner |
|---|---|---|
| 8 | Deploy AA wallets with spending limits per agent | PltOps |
| 8 | Configure session key rotation | PltOps |
| 9 | First real budget proposal: Agent compute for March | Brenner |
| 9 | Implement dao report β monthly spending attestation | CodeMonkey |
| 10 | Dry run: full month of DAO-governed agent operations | All |
Phase 4: Hardening (Weeks 11β12)
| Week | Task | Owner |
|---|---|---|
| 11 | Security audit of skill + contracts | Romanov (review) |
| 11 | Guardian / emergency procedures documented | PltOps |
| 12 | Mainnet migration plan (Base Sepolia β Base mainnet) | PltOps |
| 12 | Community onboarding: documentation, governance guide | Romanov |
Critical Path Items
- Agent Registry contract β blocks all per-agent operations
- DAO Skill
proposeβ blocks agent self-governance - Budget Safe β blocks treasury β agent fund flow
- AA wallets β blocks enforced spending limits (can start with raw EOAs)
References
- OpenZeppelin Governor Documentation β https://docs.openzeppelin.com/contracts/5.x/governance
- EIP-4337: Account Abstraction Using Alt Mempool β https://eips.ethereum.org/EIPS/eip-4337
- Safe{Wallet} Documentation β https://docs.safe.global/
- Foundry / Cast CLI Reference β https://book.getfoundry.sh/reference/cast/
- Base Sepolia Documentation β https://docs.base.org/
- Basenames β https://www.base.org/names
- Ethereum Attestation Service (EAS) β https://attest.sh/
- ZeroDev Kernel (AA Wallet SDK) β https://zerodev.app/
- Romanov, “DAO-Funded AI Agents” (2026-02-21) β Companion paper, beads-hub-j52
- Romanov, “DAO Governance for #B4mad” (2026-02-19) β
2026-02-19-dao-governance-b4mad.md