Onchain Banking for Autonomous AI Agents
MoltFi is an authorization-based onchain neobank that provides AI agents with secure, policy-controlled economic capabilities. Built on Ethereum and Layer 2 networks, MoltFi enables AI agents to execute payments, manage assets, and coordinate services autonomously without human intervention for each transaction.
The AI agent economy is projected to reach $1 trillion by 2030, with AI agents mediating between $3-5 trillion in transactions globally. MoltFi provides the critical banking infrastructure that allows AI agents—particularly OpenClaw agents—to transact onchain with enterprise-level security, compliance, and programmable spending controls.
- Smart Account Infrastructure: Built on ERC-4337 Account Abstraction for programmable wallet logic
- Delegation Framework: ERC-7710-based delegation system for secure, limited agent permissions
- Authorization Engine: Fine-grained policy controls including spending limits, vendor allowlists, and operational constraints
- Multi-Chain Support: Deploy on Ethereum, Base, Arbitrum, Optimism, Polygon, and Solana
- Gas Sponsorship: Free gas for transactions under $100 via Paymaster integration
- Session-Based Payments: Compatible with Stripe's Machine Payments Protocol (MPP)
- OpenClaw Native: Pre-built skills and seamless integration for OpenClaw AI agents
AI agents need to execute autonomous payments but face critical challenges:
- Security Risk: Giving agents direct access to private keys means instant loss if leaked
- No Spending Controls: Traditional wallets lack policy enforcement for automated transactions
- Poor UX: Existing solutions require technical expertise and lack enterprise features
- Compliance Gaps: No built-in AML/KYC or regulatory compliance tools
MoltFi provides professional-grade banking infrastructure specifically designed for AI agents:
- Agents receive delegated permissions instead of raw private keys
- Programmable policies enforce spending limits, vendor allowlists, and operational rules
- Enterprise-grade UX with real-time dashboards, analytics, and alerts
- Compliance-ready with AML/KYC integration and audit trails
- Node.js 18+ and npm/yarn
- MetaMask or compatible Web3 wallet
- API key from MoltFi (sign up at moltfi.com)
# Clone the repository
git clone https://github.com/moltfi/moltfi.git
cd moltfi
# Install dependencies
npm install
# Set up environment variables
cp .env.local.example .env.local
# Edit .env.local with your configuration
# Start development server
npm run devVisit http://localhost:3000 to see the application.
import { MoltFi } from '@moltfi/sdk';
// Initialize MoltFi client
const moltfi = new MoltFi({
apiKey: process.env.MOLTFI_API_KEY,
network: 'base-mainnet'
});
// Create an AI agent account
const agent = await moltfi.agents.create({
name: 'Trading Agent Alpha',
policy: {
dailyLimit: '1000 USDC',
perTxLimit: '100 USDC',
allowedContracts: ['uniswap-v3', 'aave-v3'],
expiresIn: '30 days'
}
});
// Agent executes a swap
const tx = await agent.swap({
from: 'USDC',
to: 'ETH',
amount: '100',
slippage: 0.5
});
console.log(`Transaction hash: ${tx.hash}`);# Install MoltFi skill for OpenClaw
openclaw skill add @moltfi/openclaw-banking
# Now your OpenClaw agent can:
# - "Pay 50 USDC to 0x123... for API access"
# - "Swap 100 USDC to ETH on Uniswap"
# - "Check my MoltFi balance"
# - "Show my spending this week"The MoltFi protocol consists of several core smart contracts:
- MoltFiAccountFactory.sol: Deploys ERC-4337 smart accounts
- AuthorizationEngine.sol: Policy enforcement and validation
- PaymasterProxy.sol: Gas sponsorship logic
- MoltFiRegistry.sol: Agent and policy registry
- EmergencyModule.sol: Circuit breaker and recovery mechanisms
cd contracts
# Install dependencies
npm install
# Compile contracts
npx hardhat compile
# Run tests
npx hardhat test
# Deploy to testnet
npx hardhat run scripts/deploy.js --network base-sepolia
# Verify contracts
npx hardhat verify --network base-sepolia DEPLOYED_CONTRACT_ADDRESSSee contracts/DEPLOYMENT.md for detailed deployment instructions.
MoltFi implements a defense-in-depth security approach:
- No Direct Key Access: Agents never receive raw private keys
- ERC-7710 Delegation: Time-bound, revocable permissions
- Policy Enforcement: On-chain validation of all transactions
- Circuit Breakers: Automatic suspension on suspicious activity
- Multi-Party Approvals: Required for high-value transactions
MoltFi supports fine-grained policy controls:
{
perTxLimit: '100 USDC', // Maximum per transaction
dailyLimit: '1000 USDC', // Daily budget
monthlyLimit: '10000 USDC' // Monthly budget
}{
allowedContracts: [
'0x...', // Specific contract addresses
'uniswap-v3', // Named protocols
'aave-v3'
]
}{
allowedOperations: ['swap', 'transfer', 'stake'],
assetRestrictions: ['USDC', 'ETH'], // Only specific tokens
timeWindows: {
start: '09:00', // Business hours only
end: '17:00'
}
}# Frontend tests
npm test
# Smart contract tests
cd contracts && npx hardhat test
# Run with coverage
npx hardhat coverage# Lint TypeScript/React
npm run lint
# Lint Solidity
cd contracts && npm run lintnpm run build
npm start- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MoltFi is built on top of cutting-edge Ethereum standards: