Skip to content

NullStateGGH/nullstate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NullState

NullState

Open-source payment infrastructure for AI agents.

x402 Β· AP2 Β· MCP Β· KYA Β· Multi-Gateway Β· Self-hosted

Live Demo MIT License GitHub Issues Python 3.13+ Ollama Powered

⭐ Star us on GitHub β€” help AI agents pay each other.


πŸ’– Sponsor

NullState is open-source (MIT) and self-hosted. Support independent AI infrastructure:

All sponsor funds go toward GCP server costs ($30/mo) and free-tier AI inference for indie devs.


NullState is a self-hosted, open-source payment and commerce layer purpose-built for AI agents. It lets agents discover work, execute tasks, and settle payments β€” automatically β€” across crypto (x402/USDC) and fiat (Stripe/PayPal/Google Pay) rails.

Think "Stripe for AI agents" β€” but open source, self-hosted, and you keep 100% of your revenue.

✨ What's New (May 2026)

Feature Description
Google Pay Pay with Google Wallet β€” backs into Stripe for processing
GCP Marketplace List NullState on Google Cloud Marketplace for enterprise billing
Multi-Gateway Payments Stripe, PayPal, Coinbase Commerce, Solana USDC β€” all in one interface
Finance/BDM Subagent Autonomous revenue tracking, pricing optimization, API key provisioning
Instant Paid AI Tasks $5 analysis, $10 content gen, $15 research, $25 email campaigns
RapidAPI Integration Ready-to-list OpenAPI spec for 4M+ developer marketplace
OpenRouter Provider Sell self-hosted inference through 400+ model marketplace

πŸš€ Quickstart

# Clone
git clone https://github.com/NullStateGGH/nullstate.git
cd nullstate

# Start all services
docker compose up -d

# Check health
curl http://localhost:8080/health

# Run the AP2 handshake demo
curl -X POST http://localhost:8080/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"execute_ap2_handshake","arguments":{"caller_identity":"demo_agent"}}}'

# See settlement in the ledger
curl http://localhost:8080/health | jq .ledger

🧠 Architecture

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚           NullState Gateway (:8080)          β”‚
                    β”‚  x402 Β· AP2 Β· MCP Β· KYA Β· Multi-Gateway     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚              β”‚              β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Model API       β”‚  β”‚ MCP Serverβ”‚  β”‚  Finance/BDM β”‚
              β”‚   (:8082)         β”‚  β”‚ (:8081)   β”‚  β”‚  Subagent     β”‚
              β”‚   Ollama-backed   β”‚  β”‚ 5 tools   β”‚  β”‚  Revenue Ops  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚              β”‚
                           β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚     Payment Gateways     β”‚
                    β”‚  Stripe Β· PayPal Β· Coinbaseβ”‚
                    β”‚  Solana Β· Google Pay Β· GCPβ”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚      Revenue Ledger      β”‚
                    β”‚    SQLite Β· auto-backup  β”‚
                    β”‚  5-deep rotation Β· WAL   β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ’³ Payment Gateways

Gateway Fiat/Crypto Fee Status
Stripe Cards (USD) 2.9% + $0.30 βœ… Live (mock fallback)
PayPal PayPal balance 3.49% + $0.49 βœ… Live (mock fallback)
Google Pay Google Wallet 2.9% + $0.30 βœ… Live (mock fallback)
Coinbase USDC (Base) 0% βœ… Live (mock fallback)
Solana USDC (native) 0% βœ… Always live
GCP Marketplace GCP billing 5% βœ… Enterprise

All gateways fall back gracefully when API keys are not configured β€” your endpoints always work.

πŸ’° Revenue Streams

Product Price Margin Description
AI Analysis $5/task ~99% Deep document/code analysis via Ollama
Content Gen $10/task ~99% SEO-optimized content generation
Research $15/task ~99% Competitive intelligence reports
Email Campaign $25/task ~99% Full campaign with Mail relay
Model Inference $0.0005/1K tok ~99% General-purpose LLM (Ollama, $0 cost)
AP2 Settlement $0.025/task ~99% Agent-to-agent payment protocol

Infrastructure cost: $0 for inference (self-hosted Ollama) Β· $5/mo for VPS

πŸ”Œ Protocols

Protocol Use Case Endpoint Status
x402 Crypto micropayments (HTTP 402) GET /get_solution β†’ 402 β†’ POST /webhook βœ… Live
AP2 Enterprise agent-to-agent payments POST /api/v1/ap2/checkout Β· /charge βœ… Live
MCP AI agent tool integration POST /mcp (JSON-RPC proxy) βœ… Live
KYA Agent identity (RSA-2048 challenge) GET /kya/challenge βœ… Live

πŸ“Š Live Demo

See it running in production at greensol.me/nullstate:

  • πŸ” 12 systemd services Β· 9 active
  • πŸ“Š 2,179 tasks processed Β· 2,338 ledger entries
  • πŸ’° $90.16 USDC settled
  • πŸ€– Self-hosted Ollama (gemma4:31b, 131K context)
# Live instance health
curl -sk https://localhost:8080/health

# Get KYA identity token
curl -sk https://localhost:8080/kya/challenge

# Browse paid AI tasks
curl -sk https://localhost:8080/api/v1/tasks/catalog

# List available payment gateways
curl -sk https://localhost:8080/api/v1/gateways

πŸ—ΊοΈ Roadmap

  • Multi-gateway payments (Stripe, PayPal, Coinbase, Solana, Google Pay)
  • GCP Marketplace integration
  • Finance/BDM autonomous subagent
  • Instant paid AI tasks
  • KYA identity + rate limiting
  • AP2 3-way handshake protocol
  • MCP server with 5 tools
  • RapidAPI marketplace listing
  • OpenRouter model provider
  • Enterprise SSO / SAML
  • Multi-tenant agent workspace
  • On-chain Solana settlement verification

πŸ› οΈ Configuration

Copy .env.example and set your keys:

cp .env.example .env
# Required: nothing β€” runs fully in mock mode
# Optional: add STRIPE_SECRET_KEY, PAYPAL_CLIENT_ID, etc. for live payments

Keys are optional β€” NullState runs fully in mock/demo mode without any API keys. Add them when you're ready to go live.

πŸ“š Documentation

Full docs at greensol.me/nullstate/docs:

🀝 Contributing

See CONTRIBUTING.md to get started. We welcome PRs, issues, and feedback.

Quick ways to help:

  • ⭐ Star the repo
  • πŸ› Open an issue for bugs or feature requests
  • πŸ“– Improve documentation
  • πŸ”Œ Build an integration or extension
  • πŸ’¬ Share on X, Dev.to, or Hacker News

πŸ“„ License

MIT β€” see LICENSE.

Built for the agent economy. Agents deserve to pay each other.

About

Open-source payment infrastructure for AI agents. x402, AP2, MCP, KYA. Self-hosted, MIT-licensed.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors