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 downloadOption 1: Subnet Consensus Only (Explore VLC consensus without blockchain)
sudo ./run-subnet-only.sh
# Access VLC graph at http://localhost:8000Option 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.htmlEnable 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.shPINATA_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 sepoliaBenefits:
- π 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.