AI agents can safely request cryptocurrency payments without ever holding your keys. Spending policies are enforced by zero-knowledge smart contracts on-chain.
Get StartedNode.js v20+ Docker OllamaYou talk naturally. MidPilot plans, validates, and executes. Every transaction is enforced by ZK proofs — no trust required.
Type a request in plain English: "Send 50 NIGHT to Starbucks."
The agent breaks it into tasks, estimates budgets, and asks for approval.
Local pre-check + on-chain ZK contract verify limits, merchants, and time.
Approved transactions execute real on-chain transfers via MCP wallet.
Ollama + Qwen2.5 runs entirely on your machine. Zero API calls, zero data leakage, zero recurring cost.
Spending policies live on-chain as Compact smart contracts. The AI proposes, the contract disposes.
Execute actual on-chain transactions through the MCP wallet. No simulation, no test tokens only.
Your private keys never leave your wallet. The AI only sees what you choose to disclose via ZK proofs.
| Layer | Technology |
|---|---|
| Runtime | Node.js v26 + TypeScript |
| AI Engine | Ollama + Qwen2.5 (local, zero API cost) |
| Blockchain | Midnight Network (Compact smart contracts) |
| Wallet | nel349/midnight-wallet-cli via MCP server |
| Database | SQLite via sql.js (pure JS, no native build) |
| Dashboard | Vanilla JS + WebSocket (real-time updates) |
| Testing | Vitest (20 unit tests) |
| Localnet | Docker (node, indexer, proof-server) |
npm install
midnight localnet up
ollama serve ollama pull qwen2.5:3b
# Interactive wizard npx tsx src/cli/index.ts init # Demo-friendly defaults npx tsx src/cli/index.ts init --demo # Standard defaults npx tsx src/cli/index.ts init --defaults
npx tsx src/cli/index.ts chat
| Command | Description |
|---|---|
| init | Initialize policies (interactive wizard) |
| init --demo | Use demo-friendly policies |
| init --defaults | Use standard defaults |
| init --reset | Reset policies and re-run wizard |
| chat | Start AI chat session |
| chat --no-dashboard | Chat without web dashboard |
| status | Show wallet, contract, and policy status |
| dashboard | Start web dashboard only |
| policy list | List active policies |
| policy freeze | Emergency freeze all spending |
| policy unfreeze | Unfreeze spending |
You: Send 50 NIGHT to mn_addr_undeployed1jure...56u
MidPilot: Transfer completed.
TX Hash: 00d64003d9d206ff21b52dbb12d22835e12556d...
Amount: 50 NIGHT
Balance: 19,950 NIGHT remaining
You: Send 1500 NIGHT to merchant_amazon
MidPilot: Payment rejected.
Reason: Daily limit exceeded (limit: 1000 NIGHT, requested: 1500 NIGHT)
Please try again tomorrow or reduce the amount.
You: Freeze all spending
MidPilot: Emergency freeze activated. All transactions are now blocked.
Run "policy unfreeze" to resume.
You: Build me a Discord bot
MidPilot: Mission Detected
Discord Bot
Required Resources:
- Hosting (3 NIGHT)
- API Access (2 NIGHT)
- Deployment (1 NIGHT)
Estimated Budget: 6 NIGHT
Would you like to allocate 6 NIGHT to this mission?
No key exposure. The AI communicates via MCP protocol — it never touches your private keys.
On-chain enforcement. ZK proofs guarantee policy compliance — the contract is the final arbiter.
Selective disclosure. disclose() reveals only what's needed — nothing more.
Local execution. Ollama, Docker, SQLite — everything runs on your machine. No cloud.
| Policy | What It Does |
|---|---|
| daily_limit | Cap spending per day (e.g., max 1000 NIGHT/day) |
| merchant_whitelist | Only approved recipients can receive funds |
| time_restriction | Restrict transactions to allowed days and hours |
| emergency_freeze | Kill switch — instantly block all transactions |
Policies are stored in .midpilot/policies.json and persist between sessions. Freeze/unfreeze takes effect immediately.