Skip to main content

AICoin - Decentralized AI computing network where nodes mine AIC tokens by contributing GPU/CPU compute power to run AI inference

Project description

AICoin - Decentralized AI Computing Network

Train the future, mine the intelligence.

AICoin is a decentralized AI computing network where nodes earn AIC tokens by contributing GPU/CPU compute power to run AI inference tasks. Built with Python and Solidity, it combines blockchain mining economics with distributed AI model serving.

Key Features

  • Proof-of-Compute Mining: Nodes mine AIC by running AI model inference (not hash puzzles). Rewards scale with actual compute contribution — GPU hours, token throughput, and task completion rate.
  • Bitcoin-Style Tokenomics: Fixed 21,000,000 AIC max supply. Initial block reward is 50 AIC, halving every 210,000 blocks (~1 year). 50% pre-allocated to genesis wallet, 50% released through mining.
  • Built-in Crypto Wallet: BIP39 mnemonic generation, HD key derivation (BIP44 m/44'/60'/0'/0/0), secp256k1 ECDSA signing, and encrypted local storage. Compatible with Ethereum addresses.
  • On-Chain Governance: Token-weighted voting (1 AIC = 1 vote). Proposals for model selection, parameter changes, emergency actions, and protocol upgrades. 51% approval threshold with 10% quorum.
  • Dual-Mode Blockchain: Simulation mode (in-memory, for development) and Web3 mode (connect to EVM-compatible chains for production). All simulation logic strictly mirrors Solidity contracts.
  • Distributed Inference: Pipeline-parallel model serving across nodes. Supports Qwen2.5, Llama-3, and other transformer models with automatic sharding and load balancing.
  • API Gateway: RESTful API for AI inference with tiered pricing (Basic / Standard / Premium). Revenue shared 80/20 between compute nodes and treasury.
  • CPU & GPU Support: CPU-only nodes can also mine with a fair power coefficient. No GPU required to participate.

Architecture

┌──────────────────────────────────────────────────────────┐
│                      AICoin Node                         │
├──────────┬──────────┬───────────┬──────────┬─────────────┤
│  Wallet  │ Mining   │ Blockchain│Governance│ API Gateway │
│ (BIP39)  │ Engine   │ Manager   │ Manager  │ (REST)      │
├──────────┴──────────┴───────────┴──────────┴─────────────┤
│              Distributed Inference Engine                 │
│         (Pipeline Parallelism + Model Sharding)           │
├──────────────────────────────────────────────────────────┤
│              P2P Network (TCP + Gossip)                   │
│              Raft Consensus + Routing                     │
└──────────────────────────────────────────────────────────┘

Token Economics

Parameter Value
Token Symbol AIC
Max Supply 21,000,000 AIC
Decimals 18 (ERC20 compatible)
Genesis Allocation 10,500,000 AIC (50%)
Mining Reserve 10,500,000 AIC (50%)
Initial Block Reward 50 AIC
Halving Interval 210,000 blocks (~1 year)
Mining Reward Split 80% node / 20% treasury

Supply Schedule

Year 1:  50 AIC/block  → ~10,500,000 AIC mined
Year 2:  25 AIC/block  → ~5,250,000 AIC mined
Year 3:  12.5 AIC/block → ~2,625,000 AIC mined
...continues halving until max supply reached

Quick Start

Installation

# Basic installation
pip install aicoin

# With Web3 support (for production chains)
pip install aicoin[web3]

# With AI inference support (requires GPU)
pip install aicoin[inference]

# Everything
pip install aicoin[all]

Mining with the Platform (Recommended)

AICoin provides a platform at aic.aicq.online where you can register as a compute node, serve AI models through WebSocket tunnels, and earn AICoin rewards. No public IP required — the platform provides tunneling!

# 1. Login to your platform account
aicoin login --email your@email.com

# 2. Register a compute node
aicoin node register --name my-gpu-node --type gpu --model qwen2.5-0.5b

# 3. Start local AI model inference server
aicoin serve --model qwen2.5-0.5b --port 8000

# 4. Connect via WebSocket tunnel (in another terminal)
aicoin tunnel connect --node NODE_ID --model qwen2.5-0.5b --port 8000

# 5. That's it! The platform will forward API requests through the tunnel.
#    You earn AICoin from both API call fees and compute mining rewards.

Demo Mode (No GPU Required)

# Try the full mining flow locally with simulated data
aicoin --demo

CLI Commands

Command Description
aicoin login --email EMAIL Login to platform account
aicoin node register --name NAME --model MODEL Register a compute node
aicoin serve --model MODEL --port PORT Start local AI inference server
aicoin tunnel connect --node ID --model MODEL Establish WebSocket tunnel
aicoin report --node ID Report compute metrics
aicoin --demo Demo mining (simulation)
aicoin --wallet Wallet management
aicoin --status View node status

Create a Wallet

from core.wallet import AICoinWallet

wallet = AICoinWallet("my_wallet.dat")
result = wallet.create_new("my_secure_password_123")

print(f"Mnemonic: {result['mnemonic']}")
print(f"Address:  {result['address']}")
# ⚠️ Write down your mnemonic! It can recover your wallet.

Start a Node (Programmatic)

from core.node import AICoinNode
from core.config import AICoinConfig

config = AICoinConfig.from_file("config.json")
node = AICoinNode(config)
node.start()

# Run AI inference
result = node.run_inference("Explain quantum computing", max_tokens=256)
print(result["response"])

# Stop
node.stop()

Blockchain Operations (Simulation Mode)

from core.blockchain import BlockchainManager

# Initialize with genesis wallet pre-allocation
bm = BlockchainManager({"mode": "simulation"})

# Check genesis wallet
info = bm.get_genesis_wallet_info()
print(f"Genesis balance: {info['balance_aic']:,.0f} AIC")

# Transfer from genesis wallet
bm.genesis_transfer("0xRecipient...", 1000 * 10**18)

# Mining reward
bm.mint_mining_reward("0xMiner1", 50 * 10**18)

# Burn tokens
bm.burn_tokens("0xMiner1", 10 * 10**18)

# Governance
proposal_id = bm.create_proposal(
    proposer="0xMiner1",
    proposal_type="ParameterChange",
    title="Reduce API pricing",
    description="Lower the API access cost to attract more users"
)
bm.vote("0xMiner1", proposal_id, support=True)

Web3 Mode (Production)

bm = BlockchainManager({
    "mode": "web3",
    "rpc_url": "https://mainnet.infura.io/v3/YOUR_KEY",
    "token_address": "0x...",
    "mining_address": "0x...",
    "governance_address": "0x...",
    "chain_id": 1,
    "genesis_private_key": "0x...",  # For genesis transfers
})

Smart Contracts

The contracts/ directory contains Solidity source code for deployment on EVM-compatible chains:

Contract Description
AICoinToken.sol ERC20 token with mining minting, burning, voting weight, and role-based access control
Mining.sol Compute proof submission, reward calculation, halving logic
Governance.sol Proposal creation, token-weighted voting, execution
APIAccess.sol Tiered API access with AIC payment and daily quotas
AICoinDAO.sol DAO integration with proposal execution callbacks

Deploy with Hardhat:

cd deploy/hardhat
npm install
npx hardhat run scripts/deploy.js --network mainnet

Compute Scoring

Mining rewards are proportional to each node's compute score (0–10,000), calculated from four dimensions:

Dimension Weight Metric
Compute Utilization 30% GPU VRAM usage or CPU inference time
Throughput 30% Tokens/second (model-adjusted)
Uptime 20% Node online duration (log-scaled, 30-day cap)
Completion Rate 20% Successful inference tasks / total tasks in 24h

CPU nodes receive a fair power coefficient (default 0.3x) so they earn meaningful rewards even without GPU.

Governance

Token holders govern the network through proposals and voting:

  • 1 AIC = 1 Vote — voting power equals token balance
  • Quorum: 10% of total supply must participate
  • Approval: 51%+ of cast votes required to pass
  • Standard voting period: 7 days
  • Emergency voting period: 24 hours
  • Proposal types: Model selection, model addition/removal, parameter changes, emergency actions, protocol upgrades
  • Minimum stake: 1,000 AIC required to create a proposal

Project Structure

aicoin/
├── core/
│   ├── blockchain.py      # Blockchain manager (simulation + Web3)
│   ├── wallet.py          # BIP39/HD wallet with ECDSA signing
│   ├── mining_engine.py   # Compute meter + mining engine + reward distributor
│   ├── governance.py      # Governance manager + model registry + proposal executor
│   ├── node.py            # Full node (P2P + mining + API + governance)
│   ├── api_gateway.py     # REST API gateway
│   ├── config.py          # Configuration management
│   ├── router.py          # Intelligent request routing
│   ├── consensus.py       # Finality consensus mechanism
│   ├── async_blockchain.py # Async I/O path (asyncio + uvloop)
│   ├── dag_scheduler.py   # DAG-based parallel transaction scheduler
│   ├── worker_pool.py     # Multi-process worker pool (GIL bypass)
│   ├── hybrid_inference.py # Hybrid CPU/GPU inference engine
│   ├── rust_engine/       # Rust execution engine (PyO3 FFI)
│   └── distributed/       # Distributed inference modules
│       ├── distributed_node.py
│       ├── inference_coordinator.py
│       ├── model_manager.py
│       ├── raft_election.py
│       ├── network_manager.py
│       ├── sharded_model.py
│       ├── load_balancer.py
│       └── resource_monitor.py
├── contracts/             # Solidity smart contracts
├── deploy/                # Deployment tools (Hardhat + Python)
└── tests/                 # Test suite

Requirements

  • Python >= 3.10
  • ecdsa >= 0.18.0 (secp256k1 signing)
  • aiohttp >= 3.9.0 (API gateway)
  • pydantic >= 2.5.0 (data validation)
  • psutil >= 5.9.0 (system monitoring)

Optional

  • torch + transformers (AI model inference)
  • web3 (production blockchain connection)
  • uvloop + numpy (performance optimization)

License

MIT License

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aicoin-1.1.0.tar.gz (312.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aicoin-1.1.0-py3-none-any.whl (331.0 kB view details)

Uploaded Python 3

File details

Details for the file aicoin-1.1.0.tar.gz.

File metadata

  • Download URL: aicoin-1.1.0.tar.gz
  • Upload date:
  • Size: 312.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for aicoin-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ef87a458b651b0e728043f0d82a531012bda12487a65d2bbbec16d6c8174ade4
MD5 32f073d2f1b8c4e0361856ba3469112e
BLAKE2b-256 dc60191a92e0dea62ef6443bec963a4db66721d0ff2dc558ba25d2884ee16b0a

See more details on using hashes here.

File details

Details for the file aicoin-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: aicoin-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 331.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for aicoin-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75001180ae7fd949c0e48df3d60b414f7b622eff4bf46d19879c5298a1b456b8
MD5 adf190521bfc1ea1ea5228978de73308
BLAKE2b-256 e4345dccb56ceb7e06175fe5fef74182cfa9bec84ca74de7a125620b17e03e2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page