DISCLAIMER: This software is experimental and UNAUDITED. It is provided for research and testnet use only. Do not use with real funds. Not financial advice. Use at your own risk.
Rust implementation of novel cryptographic primitives and consensus algorithms based on the golden ratio phi = (1+sqrt(5))/2. These form the cryptographic foundation of the Artosphere protocol.
A 256-bit hash function that uses golden ratio constants in its round function.
- 24 compression rounds with phi-derived rotation constants
- Internal state based on phi and sqrt(2) bit expansions
- Nonlinear mixing via golden-angle-inspired transformations
- Produces 256-bit digests suitable for block hashing and Merkle trees
A novel proof-of-work variant where valid blocks must have hashes whose Zeckendorf decomposition (unique representation as a sum of non-consecutive Fibonacci numbers) meets a minimum Fibonacci index threshold.
- Mining: find a nonce such that the hash's Zeckendorf representation includes a Fibonacci number at or above the difficulty index
- Verification: deterministic check of nonce validity in O(log n) Fibonacci steps
- Difficulty scales naturally with Fibonacci sequence growth
An AEAD cipher combining AES-256-GCM as the cryptographic base with an A5 thematic permutation layer.
- AES-256-GCM provides authenticated encryption (NIST standard)
- A5 layer applies a reversible permutation inspired by alternating group theory
- HKDF-SHA256 key derivation with domain separation
- All sensitive memory zeroized on drop
A DAG-based blockchain structure where each block references two parent blocks following a Fibonacci pattern.
- Dual-parent block references create a directed acyclic graph
- Fibonacci-structured ancestry provides logarithmic proof paths
- Suitable for light client verification with compact proofs
# Compute phi-Hash-256 of a message
cargo run -- hash "hello world"
# Mine a block (genesis)
cargo run -- mine genesis 10
# Mine with custom max attempts
cargo run -- mine <prev_hash_hex> 12 --max-attempts 5000000
# Verify a mined block
cargo run -- verify <prev_hash_hex> <timestamp> <nonce> <difficulty>
# Run benchmarks
cargo run -- bench# Build
cargo build --release
# Run all tests (107 tests)
cargo test
# Run tests with output
cargo test -- --nocapture
# Run benchmarks (Criterion)
cargo bench
# Lint
cargo clippy -- -D warnings| Crate | Purpose |
|---|---|
aes-gcm |
AES-256-GCM authenticated encryption |
hkdf + sha2 |
Key derivation (HKDF-SHA256) |
num-bigint |
Arbitrary-precision integers for Zeckendorf decomposition |
clap |
CLI argument parsing |
zeroize |
Secure memory cleanup |
subtle |
Constant-time comparisons |
rand |
Cryptographic randomness |
criterion |
Benchmarking (dev) |
- Test coverage: 107 tests (all passing)
- A5-Crypto audit: 14 findings from internal security audit; 12 resolved, 2 accepted as design trade-offs. See
SECURITY_AUDIT_A5_CRYPTO.md. - phi-Hash-256: Security proof documented. 24 rounds provide adequate diffusion and avalanche properties.
- Audit status: Internal audit complete. Independent audit pending.
Note: A5-Crypto v2 is an experimental construction. The AES-256-GCM base layer provides NIST-standard security; the A5 thematic layer is an additional permutation that does not weaken the underlying AEAD guarantees.
phicoin/
src/
lib.rs # Library root
main.rs # CLI entry point
phi_hash.rs # phi-Hash-256 implementation
proof_of_phi.rs # Zeckendorf consensus algorithm
a5_crypto.rs # A5-Crypto v2 AEAD cipher
fib_tree.rs # Fibonacci Tree DAG structure
tests/
test_phi_hash.rs # Integration tests
benches/
benchmarks.rs # Criterion benchmarks
MIT
- Rust Core (this repo)
- Solidity Contracts (DeFi protocol)