BlockchainAi is the official Golang implementation of Cortex — a public blockchain that brings artificial intelligence and machine‑learning inference on‑chain. Cortex lets smart contracts call AI/ML models directly through the Cortex Virtual Machine (CVM), enabling decentralized AI DApps where model execution is verifiable and reproducible across every node.
The node (Go module github.com/CortexFoundation/CortexTheseus) implements the full Cortex protocol: networking, transaction processing, the EVM‑compatible CVM runtime, state storage, mining, RPC/console tooling, and a Proof‑of‑Work consensus based on the Cortex Cuckoo cycle. AI models and input data are distributed via a content‑addressed storage layer, and inference results are computed deterministically (with optional CUDA/GPU acceleration) so that on‑chain AI is trustless.
This repository is for blockchain engineers, AI/ML researchers, miners, and DApp developers who want to run a Cortex full node, build AI‑powered smart contracts, or experiment with decentralized machine learning.
🔎 Keywords: AI on blockchain, decentralized AI, Cortex blockchain, on‑chain machine learning, Cortex Virtual Machine (CVM), Golang blockchain node, smart contract AI inference, proof‑of‑work Cuckoo cycle, GPU mining, Web3 AI.
- 🧠 On‑chain AI/ML inference — execute machine‑learning models directly from smart contracts via the CVM.
- 🔗 Full Cortex node — networking (p2p), state, transactions, consensus, RPC, and console in one binary.
- ⛏️ Proof‑of‑Work mining — Cortex Cuckoo cycle PoW with optional CUDA/GPU acceleration.
- 🤖 Deterministic CVM — EVM‑compatible virtual machine extended for verifiable AI model execution.
- 🗂️ Decentralized model & data storage — AI models/inputs distributed via content‑addressed (TorrentFS) storage.
- 🧪 Developer tooling — CLIs under
cmd/(cortex,bootnode,abigen,devp2p,keytools, …). - 🌐 Testnet support — run the Bernard testnet for development.
- 🐧 Cross‑platform builds — Linux‑first (Ubuntu/CentOS), x64 with
Makefile‑driven builds.
| Component | Technology |
|---|---|
| Language | Go 1.22 |
| Module | github.com/CortexFoundation/CortexTheseus |
| Virtual machine | Cortex Virtual Machine (CVM), EVM‑compatible |
| Consensus | Proof‑of‑Work (Cortex Cuckoo cycle) |
| AI runtime | CVM runtime (libcvm_runtime.so), optional CUDA/GPU |
| Storage | Content‑addressed model/data storage (TorrentFS) |
| Build | Make, CMake, GCC/G++ |
- Go 1.20+ (built/tested with Go 1.22)
- CMake 3.11.0+, GCC/G++ 5.4+, make
- 8 GB+ RAM recommended for compilation
- x64 CPU (AVX2 recommended)
- (Optional, for GPU mining) CUDA 9.2+ and a compatible NVIDIA driver (396.37+)
- Linux (Ubuntu 18.04+ recommended; CentOS 7.6 supported but not recommended)
git clone --recursive https://github.com/CortexFoundation/CortexTheseus.git
cd CortexTheseus
make clean && make -j$(nproc)Verify the CVM runtime library links correctly:
ldd plugins/libcvm_runtime.soIf it fails, run
rm -rf cvm-runtime && git submodule init && git submodule update, then rebuild.
cd CortexTheseus
export LD_LIBRARY_PATH=$PWD:$PWD/plugins:$LD_LIBRARY_PATH
./build/bin/cortexView all available options:
./build/bin/cortex --help./cortex --bernard| Project | Description |
|---|---|
| cvm-runtime | CVM runtime — the AI inference container |
| torrentfs | Decentralized file/model storage layer |
| inference | AI wrapper — fixed API for inference & storage |
| solution | PoW — Cortex Cuckoo cycle |
| rosetta-cortex | Rosetta API integration |
| docker | Docker images & deployment |
BlockchainAi/
├── cmd/ # CLIs: cortex, bootnode, abigen, devp2p, keytools, …
├── consensus/ # Proof-of-Work consensus (Cuckoo cycle)
├── core/ # Blockchain core, state & transaction processing
├── ctxc/ # Cortex protocol & full-node service
├── miner/ # Mining
├── p2p/ # Peer-to-peer networking
├── rpc/ # JSON-RPC layer
├── console/ # Interactive JS console
├── crypto/ # Cryptography primitives
├── pow/ # Proof-of-Work
├── params/ # Network & chain parameters
├── genesis.json # Genesis configuration
├── go.mod # Go module definition
└── Makefile # Build automation
Contributions are welcome! Please review CODINGSTYLE.md, then open an
issue or submit a pull request.
The library packages are licensed under GNU LGPL‑3.0 (COPYING.LESSER); the
command‑line binaries are licensed under GNU GPL‑3.0 (COPYING). See
LICENSE, COPYING, and COPYING.LESSER for details.
Web developer & cheerful hacker · PHP · Laravel · Go
⭐ If this decentralized‑AI node interests you, consider giving it a star! ⭐