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]

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

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-0.3.1.tar.gz (299.5 kB view details)

Uploaded Source

Built Distribution

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

aicoin-0.3.1-py3-none-any.whl (317.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aicoin-0.3.1.tar.gz
Algorithm Hash digest
SHA256 dbe8f3fa9ce5323105984810f1b8a4e8946e74cbf4e64e79c20a1277197a3f91
MD5 8ce97f3eb17ae5e52314df2dedd07c86
BLAKE2b-256 96cab1780a89fbdbd76e41d331aa3997d36e9e54b4e43e45147b80aac6c1dc51

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aicoin-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e0c48750b7d837b4008dc97305fa3d29190ed131fa3a7b9feaf3fcc0ff53568
MD5 c2d3a559a1925288d249abd6ab53a1f1
BLAKE2b-256 1649ef851f309f26e3d8abb5712d50e4df054d75c0103b71af5a3465fffa23ba

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