A complete, self-contained repository containing all the Rust code needed to build and run ZHTP (Zero-Trust Hybrid Protocol) orchestrator nodes for the Sovereign Network.
Default Branch: development
This is a monorepo - all libraries are in this repository as regular directories (not git submodules). For alpha development, all work happens here.
Git Strategy:
development- main development branch (default)- Feature branches created from
development - All lib-* crates are regular directories in this repo
Seed is the root of trust - all identity components derive from a single seed:
- DID:
did:zhtp:{Blake3(seed || "ZHTP_DID_V1")} - NodeId:
Blake3("ZHTP_NODE_V2:" + DID + ":" + device)β 32 bytes - Secrets: Derived deterministically from seed
- PQC Keypairs: Random attachments (Dilithium2, Kyber512) - can be rotated
Constructors:
ZhtpIdentity::new_unified(identity_type, age, jurisdiction, primary_device, seed?)seed=Noneβ random seed (exportable for multi-device)seed=Some(...)β deterministic identity (same seed β same DID/NodeIds)
V0 (Current): ProofEnvelope { version="v0", proof: ZkProof } wraps legacy proofs
V1 (Planned): Typed/governed proofs with full validation
All proof serialization includes version markers for forward compatibility.
- lib-blockchain - Blockchain data structures and consensus
- lib-consensus - Consensus mechanisms and validation
- lib-crypto - Cryptographic primitives with post-quantum support
- lib-dht - Distributed Hash Table for peer discovery
- lib-dns - DNS resolution and management
- lib-economy - Economic models and token management
- lib-identity - Seed-anchored identity and authentication (ADR-0001)
- lib-network - Network layer and mesh networking
- lib-proofs - Versioned zero-knowledge proofs (ADR-0003)
- lib-protocols - Protocol definitions and handlers
- lib-storage - Distributed storage layer
- zhtp - ZHTP Orchestrator node (main binary)
- Rust 1.70+ (install from rustup.rs)
- Git (for cloning the repo)
Linux/macOS/WSL:
# Build all crates
./build.sh
# Run a node with default config
./run-node.sh
# Run with custom config
./run-node.sh zhtp/configs/test-node2.tomlWindows (PowerShell):
# Build all crates
.\build.ps1
# Run a node with default config
.\run-node.ps1
# Run with custom config
.\run-node.ps1 -ConfigFile crates\zhtp\configs\test-node2.toml# Build entire workspace in release mode
cargo build --release --workspace
# Run the orchestrator
./target/release/zhtp-orchestrator --config zhtp/configs/test-node1.tomlNode configuration files are in zhtp/configs/:
test-node1.toml- Default node configurationtest-node2.toml- Secondary node for testing multi-node networks
- Node Settings: ID, type (full/light), security level
- Network Settings: Ports, multicast addresses, bootstrap peers
- Mesh Networking: Hybrid mesh + TCP/IP mode
- Crypto Settings: Post-quantum cryptography options
- DHT Settings: Peer discovery configuration
To test a multi-node network:
Terminal 1:
./run-node.sh zhtp/configs/test-node1.tomlTerminal 2:
./run-node.sh zhtp/configs/test-node2.tomlNodes will automatically discover each other via:
- UDP multicast (224.0.1.75:37775)
- DHT peer discovery
- Bootstrap peer connections
sovereign-mono-repo/
βββ Cargo.toml # Workspace configuration
βββ build.sh / build.ps1 # Build scripts
βββ run-node.sh / run-node.ps1 # Node launcher scripts
βββ lib-blockchain/ # Blockchain library
βββ lib-consensus/ # Consensus library
βββ lib-crypto/ # Crypto library
βββ lib-dht/ # DHT library
βββ lib-dns/ # DNS library
βββ lib-economy/ # Economy library
βββ lib-identity/ # Identity library
βββ lib-network/ # Network library
βββ lib-proofs/ # Proofs library
βββ lib-protocols/ # Protocols library
βββ lib-storage/ # Storage library
βββ zhtp/ # Main orchestrator
β βββ src/ # Source code
β βββ configs/ # Configuration files
β βββ Cargo.toml # Package manifest
βββ target/ # Build artifacts (gitignored)
# Build specific library
cargo build -p lib-crypto
# Run tests for specific crate
cargo test -p lib-network
# Build all with verbose output
cargo build --workspace --verbose# Run all tests
cargo test --workspace
# Run tests with output
cargo test --workspace -- --nocaptureWhen a node starts successfully, you'll see:
- β Node ID - Unique identifier for this node
- β Local IP - Network interface address
- β Mesh Port - P2P communication port
- β Multicast Discovery - Active peer discovery
- β Active Components - Crypto, Network, DHT loaded
- β Broadcasting - Announcing presence every 30 seconds
- Post-quantum cryptography support
- Zero-trust security model
- Encrypted mesh networking
- DHT-based peer discovery (no central authority)
- Configurable security levels (Low/Medium/High)
- Ensure Rust 1.70+ is installed:
rustc --version - Update Rust:
rustup update - Clean build:
cargo clean && cargo build --release
- Check firewall allows UDP port 37775 (multicast)
- Check firewall allows TCP port 33444 (mesh)
- Verify network interface supports multicast
- Expected if you're the first node on the network
- Once other nodes start, they'll discover via multicast
MIT OR Apache-2.0
Sovereign Network Team
| Contributor | Role |
|---|---|
| Seth Ramsay | Founder |
| Peter Rutherford | Lead Developer |
| Brad Eagle | Developer |
| David Edwards | Developer |
| David Scott | Developer |
| Hugo Perez | Developer |
| Stephen Casino | Developer |
Need Help? Check the individual crate README files in each lib-*/ folder for library-specific documentation.