Programmable Accounts

Brain's account model is built on ERC-4337 smart accounts, contract-based accounts that embed policy-aware validation and agent permissions directly on-chain.

From EOAs to Smart Accounts

Traditional externally owned accounts (EOAs) provide binary access to funds. Smart accounts (ERC-4337) replace this model with arbitrary validation logic, enabling programmable authentication, policy enforcement, and agent delegation without changing the underlying consensus protocol.

The Brain Smart Account

Each user is assigned a master Brain account that serves as the root of authority. This account:

  • Holds capital and defines global constraints

  • Authorizes agents and manages their permissions and budgets

  • Validates all UserOperations via the ERC-4337 validateUserOp hook

  • Executes approved calls against external contracts

interface IBrainAccount {
    // Called by the ERC-4337 EntryPoint during UserOperation validation.
    // Verifies signature, agent authorization, policy proofs,
    // spend limits, allowlists, expiry, and replay protection.
    function validateUserOp(bytes calldata userOp) external returns (bool);

    // Execute a call after successful validation.
    function execute(address target, uint256 value, bytes calldata data) external;

    // Grant or update agent permissions.
    function authorizeAgent(address agent, bytes32 permissions) external;

    // Store a hash of the active policy definition on-chain.
    function setPolicy(bytes32 policyHash) external;
}

Validation Flow

1

Bundler submits UserOperation to EntryPoint

The ERC-4337 bundler aggregates operations and submits them to the standard EntryPoint contract.

2

EntryPoint calls validateUserOp

The Brain smart account decodes the call and runs all validation checks.

3

Validation checks run

  • User signature or agent authorization

  • Agent permission scope

  • Policy proofs and constraints

  • Spend limits, contract and token allowlists, expiry, and replay protection

4

Approve or revert

If all checks pass, the operation is approved and executed. Any failed check causes a revert.

circle-info

Brain runs primarily on Base for low-cost execution and integrates with infrastructure providers such as Alchemy for RPC and bundler support. Ethereum serves as the settlement and identity anchor.

Key Properties

Property
Description

Non-custodial

Brain's backend never holds funds or private keys

Composable

Compatible with any standard ERC-4337 EntryPoint and bundler

Policy-aware

validateUserOp extended with policy proof verification

Agent-scoped

Each agent receives granular permissions, not full account access

Last updated