hekate-core 0.37.0

Core primitives for the Hekate ZK proving system.
Documentation

hekate-core

Crates.io Docs.rs CI License: AGPL-3.0-only

Copyright (c) 2026 Andrei Kochergin and Oumuamua Labs.

Configuration, execution traces and proof types of Hekate, the Rust zero-knowledge proof engine. The witness of a Hekate program is a table of typed columns: TraceBuilder fills it, Config sets the proof parameters, and InnerProof is what the prover returns.

Usage

cargo add hekate-core hekate-math

The trace of a XOR checksum over private words. Row i holds word i and the checksum of the words before it, and the row after the last word holds the result:

use hekate_core::errors;
use hekate_core::trace::{ColumnTrace, ColumnType, TraceBuilder};
use hekate_math::Block32;

const WORD: usize = 0;
const ACC: usize = 1;
const ACTIVE: usize = 2;

const LAYOUT: [ColumnType; 3] = [ColumnType::B32, ColumnType::B32, ColumnType::Bit];

fn generate_trace(words: &[u32], rows: usize) -> errors::Result<ColumnTrace> {
    let num_vars = rows.trailing_zeros() as usize;
    let mut tb = TraceBuilder::new_secret(&LAYOUT, num_vars)?;
    let mut acc = 0;

    for (row, &word) in words.iter().enumerate() {
        tb.set_b32(WORD, row, Block32::from(word))?;
        tb.set_b32(ACC, row, Block32::from(acc))?;

        acc ^= word;
    }

    tb.set_b32(ACC, words.len(), Block32::from(acc))?;
    tb.fill_selector(ACTIVE, words.len())?;

    Ok(tb.build())
}

rows is a power of two above words.len() and at least Config::default().min_table_rows(). new_secret zeroizes the columns when the trace drops. The hekate-program README builds the circuit this trace satisfies.

Features

Feature Default Effect
std yes The standard library
parallel yes Rayon threads, here and in hekate-crypto and hekate-math
blake3 yes BLAKE3 as DefaultHasher
sha2, sha3 no SHA-256 or SHA3-256 as DefaultHasher; the prover must hash the same way
secure-memory no Zeroize every trace on drop, also those built with TraceBuilder::new

Documentation

License

AGPL-3.0-only. See LICENSE and NOTICE. Commercial licenses are available from Oumuamua Labs info@oumuamua.dev.