Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cortex Node

A Go implementation of the Cortex full node, a blockchain whose virtual machine can run AI and machine-learning model inference on-chain, intended for blockchain engineers, miners, and developers building AI-powered smart contracts.

License Go Last commit

Overview

Cortex is a public blockchain that lets smart contracts call AI and machine-learning models directly through the Cortex Virtual Machine (CVM), so model execution is verifiable and reproducible across every node.

This node (Go module github.com/CortexFoundation/CortexTheseus) implements the full Cortex protocol: peer-to-peer networking, transaction processing, the EVM-compatible CVM runtime, state storage, mining, and RPC and console tooling. Consensus is proof-of-work based on the Cortex Cuckoo cycle. AI models and input data are distributed through a content-addressed storage layer, and inference results are computed deterministically, with optional CUDA and GPU acceleration.

What it provides

  • On-chain AI and ML inference: machine-learning models executed from smart contracts via the CVM.
  • A full node in one binary: p2p networking, state, transactions, consensus, RPC and console.
  • Proof-of-work mining using the Cortex Cuckoo cycle, with optional CUDA and GPU acceleration.
  • An EVM-compatible virtual machine extended for verifiable AI model execution.
  • Decentralized model and data storage over content-addressed storage (TorrentFS).
  • Command-line tools under cmd/: cortex, bootnode, abigen, devp2p, keytools and others.
  • The Bernard testnet for development.
  • Linux-first builds (Ubuntu and CentOS) on x64, driven by a Makefile.

Components

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 and GPU
Storage Content-addressed model and data storage (TorrentFS)
Build Make, CMake, GCC/G++

Requirements

  • Go 1.20 or newer (built and tested with Go 1.22)
  • CMake 3.11.0 or newer, GCC/G++ 5.4 or newer, and make
  • 8 GB or more of RAM for compilation
  • An x64 CPU; AVX2 recommended
  • Linux. Ubuntu 18.04 or newer is recommended; CentOS 7.6 is supported but not recommended
  • For GPU mining only: CUDA 9.2 or newer and an NVIDIA driver 396.37 or newer

Install

Build from source:

git clone --recursive https://github.com/CortexFoundation/CortexTheseus.git
cd CortexTheseus
make clean && make -j$(nproc)

Verify that the CVM runtime library links correctly:

ldd plugins/libcvm_runtime.so

If that fails, run rm -rf cvm-runtime && git submodule init && git submodule update, then rebuild.

Usage

Run a full node:

cd CortexTheseus
export LD_LIBRARY_PATH=$PWD:$PWD/plugins:$LD_LIBRARY_PATH
./build/bin/cortex

List all available options:

./build/bin/cortex --help

Run the developer testnet (Bernard):

./cortex --bernard

Project structure

├── cmd/            CLIs: cortex, bootnode, abigen, devp2p, keytools and others
├── consensus/      Proof-of-work consensus (Cuckoo cycle)
├── core/           Blockchain core, state and transaction processing
├── ctxc/           Cortex protocol and 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 and chain parameters
├── genesis.json    Genesis configuration
├── go.mod          Go module definition
└── Makefile        Build automation

Related projects

Project Description
cvm-runtime CVM runtime, the AI inference container
torrentfs Decentralized file and model storage layer
inference AI wrapper with a fixed API for inference and storage
solution Proof-of-work, Cortex Cuckoo cycle
rosetta-cortex Rosetta API integration
docker Docker images and deployment

Contributing

Review CODINGSTYLE.md, then open an issue or submit a pull request.

Author

Morpheus Adam — GitHub · sam.zeonic.me · morpheusadam95@gmail.com

License

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.

About

Cortex full node — the official Go implementation of a decentralized AI-on-blockchain protocol for on-chain machine learning.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages