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.2.2.tar.gz (281.6 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.2.2-py3-none-any.whl (297.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aicoin-0.2.2.tar.gz
Algorithm Hash digest
SHA256 577575a2f95b93c1d88b7fa72b11ba4fd879acab253264acc8d520336fc31673
MD5 b4bb3d088436d06fd822409a0b8c1b27
BLAKE2b-256 2b7d9da741563036fd1a1181e7510cf7c6b91cdeec8b3761351b6a5cbd784568

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aicoin-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6aa4ca42f3c2c48d948149430b207bf91fb7f6a285c0cfb75ad3850ab6309635
MD5 0d88ae6fb5e8ab779c6346d42aec4a25
BLAKE2b-256 6de25657fbec9f6acb3f21b9b116e3afa23e5927ce52de4a9308aad59e372419

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