Skip to content

cyberia-to/hemera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hemera

Unaudited cryptography. Not finalized — hash outputs may change before stable release.

Hemera (Ἡμέρα, "Day") is the cryptographic hash primitive of cyber. A single function, a single mode (sponge), a single output: 32 raw bytes over the Goldilocks field. Every particle, every cyberlink, every neuron identity, every Merkle root in the cybergraph is a Hemera output.

Hemera = Poseidon2(
  p  = 2⁶⁴ − 2³² + 1     Goldilocks field
  d  = 7                   S-box: x → x⁷
  t  = 16                  state width (elements)
  Rꜰ = 8                   full rounds (4 + 4)
  Rₚ = 16                  partial rounds
  r  = 8                   rate (56 bytes in)
  c  = 8                   capacity (64 bytes)
  out = 4 elements          32 bytes out
)

Every parameter that appears in code is a power of 2. The only non-power-of-2 values are d = 7 (a mathematical constraint — the minimum invertible exponent over Goldilocks) and derived sums (24 total rounds, 144 total constants) that never become variables.

identity, not representation

The 32-byte Hemera output IS the particle address. No version prefix, no multicodec header, no length byte. Hemera(content) — that is the identity. Two agents hashing the same content produce the same address. The first cyberlink to that address brings the particle into the cybergraph.

permanence

Parameters chosen at genesis are permanent commitments. Hemera addresses live decades. If Hemera is ever broken: full graph rehash under a new primitive. No version byte, no algorithm agility. Storage proofs guarantee content availability for rehashing.

self-bootstrapping

Round constants are generated by the zero-constant permutation (Hemera₀) absorbing the seed [0x63, 0x79, 0x62, 0x65, 0x72] — the bytes that spell "cyber". No foreign primitives in the dependency chain.

in the protocol

  • particle addressing: address = Hemera(content_bytes)
  • cyberlink identity: edge_id = Hemera(neuron_id ∥ source ∥ target ∥ weight ∥ time)
  • nox jet: Hemera is the hash pattern (opcode 15), accelerated from ~2,800 to ~736 cost
  • tri-kernel ranking: Hemera outputs are Goldilocks field elements — directly usable in polynomial commitments and ZK circuits without conversion
  • STARK constraints: ~736 per hash (vs ~50,000-100,000 for BLAKE3)

Workspace

Crate Description
rs Core Rust implementation (cyber-hemera on crates.io)
wgsl GPU backend — WGSL shader + wgpu dispatch
cli CLI binary (hemera)
bench Benchmarks (criterion)

Three implementations cross-verify against shared test vectors in vectors/.

Usage

use cyber_hemera::{hash, keyed_hash, derive_key, Hasher};

// One-shot
let digest = hash(b"hello world");

// Streaming
let mut hasher = Hasher::new();
hasher.update(b"hello ");
hasher.update(b"world");
assert_eq!(hasher.finalize(), digest);

// Keyed
let mac = keyed_hash(&[0u8; 32], b"message");

// Key derivation
let key = derive_key("my-app v1", b"key material");

// Content tree hash
let root = cyber_hemera::tree::root_hash(b"file contents");

CLI

hemera file1.txt file2.txt    # hash files
echo hello | hemera           # hash stdin
hemera --check sums.txt       # verify checksums

Install: cargo install --path cli

the name

Hemera (Ἡμέρα) — primordial Greek goddess of Day. Daughter of Erebus (Darkness) and Nyx (Night). One of the Protogenoi, the first-born entities from Chaos. From arbitrary bytes (darkness), Hemera brings forth clear, deterministic identity (daylight).

Poseidon  (2019) — the Olympian god of the sea
Poseidon2 (2023) — the optimized successor
Hemera    (2026) — the Protogenoi: older, deeper, permanent

See reference for the full decision record.

License

cyber

About

💧 the hash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors