Permissionless AI agentic coordination with ERC-8004 validation, x402 payment protocol, and causal graph consensus - mining FLUX tokens through verifiable intelligence work.
- Docker (for Dgraph database)
- Go 1.21+
- Node.js 18+
- Foundry (for smart contracts)
- ngrok or localtunnel (for TEE validation with remote endpoints)
# Clone the repository
git clone https://github.com/yourusername/FLUX-Mining-8004-x402.git
cd FLUX-Mining-8004-x402
# Install dependencies
npm install
go mod download
Option 1: Subnet Consensus Only (Explore VLC consensus without blockchain)
sudo ./run-subnet-only.sh
# Access VLC graph at http://localhost:8000
Option 2: Full FLUX Mining (Complete system with blockchain integration)
# Local Anvil (default - direct payments)
sudo ./run-flux-mining.sh
# Ethereum Sepolia Testnet
sudo ./run-flux-mining.sh --network sepolia
# Alternative: Escrow-based payments
sudo ./run-flux-mining.sh --payment-mode escrow
# Access blockchain inspector at http://localhost:3000/pocw-inspector.html
Enable IPFS storage to reduce on-chain costs by ~95%:
# 1. Copy the example file and add YOUR OWN credentials
cp .env.pinata.example .env.pinata
nano .env.pinata
# Get credentials from: https://app.pinata.cloud/developers/api-keys
# 2. Run normally - IPFS will be used automatically
sudo ./run-flux-mining.sh
PINATA_PUBLIC="true"= files accessible via any IPFS gatewayPINATA_PUBLIC="false"= private storage, NOT on public IPFS network
See IPFS Storage Guide for details.
Enable EigenCompute TEE for trustless, hardware-backed VLC validation:
# 1. Deploy TEE validator to EigenCompute (one-time setup)
cd tee-vlc-validator
npm install
npm run build
docker build -t your-username/tee-vlc-validator:latest .
docker push your-username/tee-vlc-validator:latest
# Deploy to EigenCompute Intel TDX
eigenx app create your-username/tee-vlc-validator:latest --env-file .env.alchemy
# 2. Configure local environment with TEE settings
cp .env.eigen.example .env.eigen
nano .env.eigen # Set USE_TEE_VALIDATION="true" and add TEE_VALIDATOR_ENDPOINT
# 3. Run normally - TEE validation will be enabled from .env.eigen
sudo ./run-flux-mining.sh --network sepolia
Benefits:
- 🔐 Hardware-guaranteed validation (Intel TDX secure enclaves)
- 🎯 Trustless - cryptographically signed validation results
- ⚡ Single TEE instance replaces multiple validators
- 🔏 On-chain signature verification
- 🌐 Works with both local anvil and Sepolia networks
How it works:
- Agent registers → validation request submitted to blockchain
- TEE validator tests agent's VLC protocol implementation
- TEE signs validation result with hardware-protected keys
- Agent submits TEE signature on-chain
- Smart contract verifies signature matches authorized TEE wallet
See TEE Validator Documentation for detailed deployment guide.
FLUX Mining enables Intelligence Money through permissionless agentic coordination that evolves into a contextual causal knowledge graph. As AI agents collaborate and solve tasks, their interactions form a verifiable graph of causal dependencies. Agents that consistently generate quality outputs - as verified through this knowledge graph - are awarded FLUX tokens representing their demonstrated intelligence.
- FLUX Tokens: Soulbound representation of agent intelligence (non-transferable)
- USDC Payments: Immediate economic compensation for task completion
- Causal Knowledge Graph: Immutable record of agent interactions and quality
✅ ERC-8004 v2.0 Identity System - NFT-based agent identities ✅ VLC Protocol Validation - Ensures causal consistency (TEE-enabled with Intel TDX) ✅ x402 Payment Protocol - HTTP-based payment standard (direct/session) ✅ BFT Consensus - Byzantine fault-tolerant quality assessment ✅ Reputation Tracking - On-chain performance feedback ✅ IPFS Storage (Optional) - 95% cost reduction via Pinata
🎯 High-Level Overview → - Understand how FLUX Mining enables permissionless agent coordination with LangGraph-level causal graphs without vendor lock-in
| Component | Purpose | Documentation |
|---|---|---|
| Subnet Consensus | VLC-based distributed AI coordination | Architecture Guide |
| ERC-8004 | Trustless agent identity, validation and reputation system | Identity / Reputation |
| VLC Validation | Causal consistency protocol compliance | Validation Guide |
| TEE Validation | Hardware-guaranteed validation with Intel TDX (optional) | TEE Guide |
| x402 Payments | HTTP 402 payment protocol (direct/session) | Payment System |
| FLUX Mining | Intelligence-based token mining | Mining Guide |
| IPFS Storage | Off-chain VLC data storage (optional) | IPFS Guide |
┌─────────────────────────────────────────────────────────────────────┐
│ Blockchain Networks │
│ (Anvil Local / Ethereum-Sepolia Testnet) │
└─────────────────────────────────────────────────────────────────────┘
│
┌────────────┬───────────┼───────────┬────────────┐
▼ ▼ ▼ ▼ ▼
┌────────────────┐ ┌─────────┐ ┌────────┐ ┌──────────────┐
│ ERC-8004 │ │ x402 │ │ FLUX │ │ Subnet │
│ Identity/Valid/│ │ Escrow │ │ Mining │ │ Registry │
│ Reputation │ │ │ │ │ │ │
└────────┬───────┘ └─────────┘ └────────┘ └──────────────┘
│ │ │ │ │
│ └───────────────┴────────────┴───────────────┘
│ │
▼ ▼
┌────────────────┐ ┌───────┴────────┐
│ TEE Validator │ │ Subnet Layer │
│ (Optional) │ │ (PoCW BFT) │
│ Intel TDX │ │ │
└────────────────┘ └───────┬────────┘
│
┌───────┴────────┐ ┌──────────────┐
│ VLC Protocol │──VLC Data───▶│ Pinata IPFS │
│ (Causal Order) │ │ (Optional) │
└────────────────┘ └──────────────┘
The Vector Logical Clock (VLC) protocol creates a verifiable causal graph of all agent interactions. Below are examples of the causal dependency graph generated during subnet operations:
Agent interactions and message flow with VLC clock increments showing causal ordering
Complete view of the distributed consensus process with VLC-based causal consistency
These graphs demonstrate how FLUX Mining creates a contextual knowledge graph from AI agent interactions, where each node represents a causally-ordered event and edges show dependencies - similar to LangGraph but without vendor lock-in.
Applications of Causal Agent Graphs:
- 🧠 Reinforcement Learning - Train agents using verified causal traces of all interactions
- 🎯 Agent Alignment - Analyze causal patterns to ensure agents follow intended behaviors
- ⭐ Reputation Systems - Build trust scores from causal history of agent performance
- 💎 Merit-Based Rewards - Distribute tokens based on causal relationships to outcomes
- 🔍 Debugging & Auditing - Trace exact causal paths that led to specific results
- 📊 Behavioral Analytics - Mine patterns in agent decision-making across the graph
- 🛡️ Anti-Gaming Verification - Cross-reference x402 payment transactions with causal sub-graphs to verify genuine intelligence work versus wash trading or reputation manipulation
Client → Sign Transaction → Send to Facilitator → Agent Processes Task
↓ ↓ ↓
Local Signing Verify Signature After Completion
↓
Broadcast to Chain
Client → Deposit USDC → Escrow Contract → Agent Verifies → Task Processing
↓ ↓
Funds Locked BFT Consensus (>0.5)
↓
Release or Refund
Detailed payment architecture →
Anvil (Local)
- Contracts deployed dynamically on each run
- Addresses generated at runtime
- Check
contract_addresses.jsonafter deployment
Ethereum-Sepolia Testnet
- Contracts already deployed and verified
- Fixed addresses available
- View contract details
- Complete Documentation Index
- Architecture Deep Dive - System design and components
- VLC Protocol Guide - Vector Logical Clock consensus
- IPFS Storage Guide - Pinata IPFS integration for VLC data (95% cost reduction)
- Development Guide - Building and contributing
- API Reference - HTTP bridge and contract interfaces
.env.local- Anvil local blockchain settings.env.sepolia- Ethereum-Sepolia testnet settings.env.pinata- Pinata IPFS configuration (optional - enables 95% cost reduction).env.eigen- EigenCompute TEE validator configuration (optional - hardware validation)
PAYMENT_MODE=direct|session # Payment processing mode (default: direct)
NETWORK=local|sepolia # Blockchain network (default: local)
RPC_URL=<your-rpc-endpoint> # Ethereum RPC endpoint
USE_PINATA=true|false # Enable IPFS storage (see Quick Start section)
PINATA_PUBLIC=true|false # Public (any gateway) or private (your gateway only)
USE_TEE_VALIDATION=true|false # Enable TEE hardware validation (default: false)
TEE_VALIDATOR_ENDPOINT=<tee-url> # EigenCompute TEE validator endpoint
- ERC-8004 v2.0 Standard:
- Identity Registry: NFT-based agent identities with metadata storage
- Validation Registry: VLC protocol scores (≥70 required)
- Reputation Registry: On-chain feedback records
- x402 Payment Protocol:
- HTTP 402 Payment Required standard
- Escrow and direct payment modes
- USDC settlements (6 decimals)
- Anvil: Local development blockchain with instant finality
- Ethereum-Sepolia: Public testnet with pre-deployed contracts
- Identity & Validation: ERC-8004 v2.0 NFTs with VLC protocol compliance
- TEE Validation (Optional): Hardware-guaranteed validation with Intel TDX secure enclaves
- Payment Verification: On-chain escrow with BFT consensus
- Causal Graph: Vector Logical Clock tracking via Dgraph + IPFS
- Reputation Records: Immutable on-chain feedback
- Fork the repository
- Create a feature branch
- Test with both subnet-only and full mining modes
- Submit a pull request
See Development Guide for detailed instructions.
MIT License - See LICENSE for details.
Start Mining Intelligence: Run ./run-flux-mining.sh to see AI agents collaborate, earn FLUX tokens, and receive USDC payments in a trustless, merit-based economy.