AstryxChain is an experimental hashing research repository focused on Astryx/GAQWH-style diffusion. It currently includes:
- a Python prototype hash (
astryx.gaqwh) used for rapid experimentation, and - a Rust crate (
astryx) with a pure-Rust walk/compression pipeline and fixed output APIs.
⚠️ Security notice: this project is unaudited and not standardized. It is not a replacement for SHA-2/SHA-3/BLAKE3 in production critical systems without substantial external cryptanalysis.
- Project goals
- Current status
- Repository structure
- Install and quick start (Python)
- Rust crate usage
- Deterministic example outputs
- CLI usage
- How CI works
- Testing locally
- Blockchain-oriented hardening guidance
- Threat model and limitations
- Roadmap
- License
AstryxChain aims to provide a reproducible sandbox for evaluating a quantum-walk-inspired hash design with:
- deterministic behavior,
- variable output lengths,
- strong diffusion/avalanche behavior,
- practical APIs for blockchain-adjacent components (block IDs, tx IDs, Merkle leaves, PoW experiments),
- cross-language implementation experiments (Python reference/prototype + Rust implementation).
This repo is intentionally explicit about what it is not: a fully audited cryptographic suite.
- Maturity: experimental research code.
- Primary language stack: Python + NumPy prototype, plus Rust crate.
- Stability target: deterministic outputs and regression-test coverage.
- Security state: no formal proof, no external third-party audit, no standardization-track review.
If your use case is a production blockchain, this repository is best treated as a testbed and should be paired with established primitives and a formal security process.
astryx/
__init__.py # Python package exports
core.py # compatibility re-exports
gaqwh.py # Python prototype hash
src/
lib.rs # Rust public API: astryx/astryx_256/astryx_512
walk.rs # Rust walk simulation and quantization
compress.rs # Rust compression/mixing layer
tests.rs # Rust tests
.github/workflows/ci.yml # Multi-job CI pipeline (Python + Rust + docs sanity)
tests/
test_hash.py # Python unit tests + CLI checks
scripts/
benchmark_hashes.py # benchmark helper
produce_results.py # deterministic output helper
cli.py # Python CLI entrypoint
Cargo.toml # Rust crate manifest
README.md
git clone https://github.com/MeridianAlgo/AstryxChain
cd AstryxChain
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .from astryx import gaqwh
msg = "block_header_height_124"
h256 = gaqwh(msg, output_bits=256)
h512 = gaqwh(msg, output_bits=512)
print(h256)
print(h512)gaqwh(data, output_bits) in Python:
- accepts
str | bytes, - returns lowercase hex string,
- requires
output_bits > 0and multiple of 64.
The Rust crate is named astryx and exposes:
astryx(input: &[u8], output_bits: usize) -> Vec<u8>(256or512),astryx_256(input: &[u8]) -> [u8; 32],astryx_512(input: &[u8]) -> [u8; 64],- compatibility aliases:
gaqwh,gaqwh_256,gaqwh_512.
Example:
use astryx::{astryx_256, astryx_512};
let h256 = astryx_256(b"Astryx");
let h512 = astryx_512(b"Astryx");
assert_eq!(h256.len(), 32);
assert_eq!(h512.len(), 64);Message: "Astryx"
- 256-bit:
50c20f902e5d0995f654d0665ff05b1e5b7fba21cd637442a8d7690eff7c2466 - 512-bit:
50c20f902e5d0995f654d0665ff05b1e5b7fba21cd637442a8d7690eff7c2466145519be2cb4a990c69ba3e4e5624ec18fa5b06855fd0fb5f22f31a39512ae5e
Message: "block_header_height_124"
- 256-bit:
ee236a94851f098ecec9a5f4222f17794d0800c3113f565b0791b7522475a6d4
Message: b"Astryx"
- 256-bit:
b0902b30549ac346d16ddf5c6756f6dd5efd8e77640a356172b85c8ce391545b - 512-bit:
b0902b30549ac346d16ddf5c6756f6dd5efd8e77640a356172b85c8ce391545b4abe83fe50bd98f5853995b7e3737668ad9ae5777e21c04bf1681c0c7a4cfe15
Note: Python prototype and Rust crate are both deterministic but currently separate implementation tracks and are not byte-for-byte equivalent.
python cli.py "Astryx"
echo "Astryx" | python cli.py
python cli.py -b 256 "block_header_height_124"
python cli.py -b 512 "block_header_height_124"If no positional input is provided and stdin is empty, the CLI returns a guidance message.
The GitHub Actions workflow (.github/workflows/ci.yml) has three jobs:
-
python-tests
- matrix on Python
3.10/3.11/3.12, - installs package + requirements,
- runs unittest discovery,
- runs a CLI smoke test.
- matrix on Python
-
rust-tests
- installs stable Rust toolchain,
- checks formatting (
cargo fmt --check), - runs
cargo test --all-targets --all-features, - uses Cargo cache for faster reruns.
-
docs-consistency
- basic sanity checks that core docs and key files exist.
The workflow also includes:
workflow_dispatchfor manual runs,- concurrency cancellation to avoid duplicated CI load on force-pushes.
python -m unittest discover -s tests -qcargo fmt --all -- --check
cargo test --all-targets --all-featurespython scripts/benchmark_hashes.py --size 1024 --iterations 2000Optional benchmark comparators:
blake3viapip install blake3kangaroo12viapip install pycryptodome
To move toward blockchain-grade operational safety, use this checklist:
-
Cryptanalysis phase
- commission independent external review,
- run structured preimage/collision differential campaigns,
- include reduced-round distinguishers and trail analyses.
-
Protocol integration hygiene
- domain-separate all hash contexts (block header vs tx ID vs Merkle node),
- use versioned prefixes (e.g.,
b"ASTRYX-BLOCK-V1" || payload), - avoid cross-protocol digest reuse without tags.
-
Consensus safety
- lock exact algorithm + test vectors in spec,
- cross-check outputs on multiple architectures/compilers,
- introduce mandatory canonical serialization before hashing.
-
Implementation hardening
- fuzz parsers and hash API boundaries,
- add property tests (determinism, output-length invariants, avalanche distributions),
- track performance regression thresholds in CI.
-
Operational readiness
- define migration plan/versioning if hash changes,
- document replay/rollback strategy,
- stage activation via testnet and shadow-mainnet verification.
- No post-quantum security proof is provided.
- “Quantum-walk-inspired” does not imply standardized post-quantum assurances.
- No side-channel certification.
- No guarantee of equivalence between independent implementation families unless explicitly tested.
Use this repo for experimentation, education, and prototyping unless/until independent review says otherwise.
- Publish a formal algorithm specification with normative test vectors.
- Add cross-language conformance harness (Python ↔ Rust) or explicitly version divergent variants.
- Add nightly benchmark trend reporting.
- Expand docs in
docs/with protocol integration examples and domain-separation recipes. - Add dedicated fuzzing and long-run statistical test automation.
MIT.