Skip to content
@k-nuth

Knuth Project

High performance Bitcoin development platform

knuth Github Releases Build status CPP Telegram

High performance Bitcoin development platform.

Knuth is a high performance implementation of the Bitcoin protocol focused on users requiring extra performance and flexibility, what makes it the best platform for wallets, exchanges, block explorers and miners.

Not just a node

Knuth is a multi-crypto full node, but it is also a development platform.

Knuth's core is written in C++23, on top of it we provide a set of libraries and modules written in various programming languages that you can use as basis for building your application.

At the moment we have libraries in the following languages: C++, C, Javascript, TypeScript, JS/TS WebAssembly, C# and Python. You can build your own library in the language of your choice on top of our C library.

Core Components

Knuth provides multiple ways to use the platform:

🏗️ Core Infrastructure (This Repository)

🚀 Node Executable

The complete Bitcoin node that you can run out of the box. Perfect for running a full node, mining, or as a backend for applications that need blockchain access.

🔧 C++ Library

A high-performance C++23 library that gives you direct access to all Bitcoin protocol functionality. Ideal for building performance-critical applications.

🌐 C API

A stable C interface that provides access to all core functionality and serves as the foundation for bindings in other programming languages.

🌍 Language Bindings (Separate Repositories)

Built on top of the C API, these bindings allow you to use Knuth from your preferred programming language:

🟨 JavaScript & TypeScript

🟣 C#

  • C# API - .NET binding for Windows, Linux, and macOS

🐍 Python

  • Python API - Pythonic interface to Knuth functionality

Getting Started

Prerequisites

All Knuth components are now available through a single unified package:

  1. Install and configure the Knuth build helper:
$ pip install kthbuild --user --upgrade
$ conan config install https://github.com/k-nuth/ci-utils/raw/master/conan/config2023.zip
  1. Install the unified Knuth package:
$ conan install --requires=kth/0.68.0 --update --deployer=direct_deploy

This single installation provides you with:

  • bin/kth - The node executable
  • lib/ - All static libraries (libnode.a, libc-api.a, etc.)
  • include/kth/ - C++ headers and C API headers

🚀 Running the Node Executable

After installation, you can immediately run the full Bitcoin node:

# Run the node
$ ./kth/bin/kth

🔧 Using the C++ Library

For C++ developers, link against the appropriate libraries:

// example.cpp
#include <kth/node.hpp>

int main() {
    kth::node::node node{"config.cfg"};
    node.initchain();
    node.run();
    
    auto& chain = node.chain();
    auto height = chain.get_last_height();
    
    std::cout << "Current height: " << height << std::endl;
    return 0;
}

When compiling, link against the static libraries found in lib/:

$ g++ -std=c++23 example.cpp -I./kth/include -L./kth/lib -lnode -lblockchain -ldomain -linfrastructure

🌐 Using the C API

For C developers or language bindings:

// hello_knuth.c
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <kth/capi.h>

int main() {
    // Create and configure node
    kth_node_t node = kth_node_construct("config.cfg", stdout, stderr);
    
    // Initialize blockchain database
    kth_node_initchain(node);
    
    // Run the node
    kth_node_run_wait(node);
    
    // Get blockchain interface
    kth_chain_t chain = kth_node_get_chain(node);
    
    // Query current height
    uint64_t height;
    chain_get_last_height(chain, &height);
    printf("Current height: %" PRIu64 "\n", height);
    
    // Cleanup
    kth_node_destruct(node);
    return 0;
}

When compiling, link against the C API library:

$ gcc hello_knuth.c -I./kth/include -L./kth/lib -lc-api

For more detailed instructions, please refer to our documentation.

Releases

C++

C

Javascript TypeScript

JS/TS WebAssembly

C#

Python

Key Features

Performance matters

We designed Knuth to be a high performance node, so our build system has the ability to automatically detect the microarchitecture of your processor and perform an optimized build for it.

For those who don't want to wait for compilation times, we provide pre-built binaries compatible with Intel's Haswell microarchitecture. But you don't have to worry about that, our build system will do everything for you.

Modular architecture

Knuth is based on a modular architecture simple to modify, expand and learn. Any protocol change can be introduced in Knuth much faster and more efficiently than in reference implementations.

Cross-platform

Knuth can be used in any computer architecture and operating system, it only requires a 64-bit system.

Knuth has been well tested on x86-64 processors and on the following operating systems: FreeBSD, Linux, macOS and Windows. However, it is not limited to these, Knuth can be used in any computer architecture and any operating system, the only requirement is a 64-bit system.

If you find a problem in any other platform, please let us know.

Language Bindings

C++ C Javascript TypeScript JS/TS WebAssembly C# Python

Any protocol change can be introduced in Knuth much faster and more efficiently than in reference implementations.

Donation

Knuth is a community backed project developed. Donations received will be used to subsidize development costs for general maintenance and support of our implementation.

Your contributions are greatly appreciated!

bitcoincash:qrlgfg2qkj3na2x9k7frvcmv06ljx5xlnuuwx95zfn

See fund.kth.cash for active Flipstarter campaigns.

License

Knuth node is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT

Contributing

Branch Naming Conventions

To optimize CI/CD performance, we use specific branch prefixes that determine which workflows are executed:

  • docs/ - Documentation-only changes (fast validation, ~30s)
  • style/ - Code formatting, copyright updates, comment fixes (fast validation)
  • chore/ - Maintenance tasks, dependency updates (fast validation)
  • noci/ - Explicitly skip heavy CI (fast validation)

All other branches (feature/, fix/, refactor/, etc.) run the full CI pipeline.

📖 See Branch Conventions Guide for detailed usage examples.

Contact

You can contact us through our Telegram group or write to us at info@kth.cash.

Security Disclosures

To report security issues please contact:

Fernando Pelliccioni (fpelliccioni@gmail.com) - GPG Fingerprint: 8C1C 3163 AAE1 0EFA 704C 8A00 FE77 07B7 4C29 E389

Pinned Loading

  1. kth-mono kth-mono Public

    High performance Bitcoin development platform

    C++

  2. js-wasm js-wasm Public

    WebAssembly interface for Bitcoin Cash full node

    TypeScript 1

  3. cs-api cs-api Public

    Bitcoin full node as a C# library

    C# 3 3

  4. js-api js-api Public

    Bitcoin full node as a Javascript library

    JavaScript 10 2

  5. py-api py-api Public

    Bitcoin full node as a Python library

    Python 1

Repositories

Showing 10 of 51 repositories

Most used topics

Loading…