Internet Replacement System
Complete β’ Zero-Knowledge Privacy β’ Universal Basic Income β’ Post-Quantum Security
ZHTP is a network node that orchestrates a complete internet replacement system. It coordinates 9 specialized library packages to provide through mesh networking, zero-knowledge privacy for all communications, universal basic income distribution, and quantum-resistant cryptographic security.
- Complete ISP Replacement - Pure mesh networking with Bluetooth LE, WiFi Direct, and LoRaWAN
- Zero-Knowledge Privacy - All communications protected with ZK proofs and post-quantum cryptography
- Universal Basic Income - 33 ZHTP daily, 1000 ZHTP monthly for all verified citizens
- Decentralized Governance - DAO-based decision making with liquid democracy
- Web4 Protocol Stack - Next-generation internet protocols
- Real-time Monitoring - Comprehensive system health and performance metrics
##Architecture
ZHTP operates as a Level 1 Orchestrator that coordinates Level 2 Components:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ZHTP Orchestrator β
β (Level 1 - Main) β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
βββββββββββββΌββββββββββββ
β β β
βββββββΌββββββ βββββΌββββ βββββββΌββββββ
βProtocols β βNetworkβ βBlockchain β
β β β β β β
βββββββββββββ βββββββββ βββββββββββββ
β β β
βββββββΌββββββ βββββΌββββ βββββββΌββββββ
βStorage β βEconomyβ βConsensus β
β β β β β β
βββββββββββββ βββββββββ βββββββββββββ
β β β
βββββββΌββββββ βββββΌββββ βββββββΌββββββ
βIdentity β βProofs β βCrypto β
β β β β β β
βββββββββββββ βββββββββ βββββββββββββ
The ZHTP node requires all 9 specialized libraries to function:
| Library | Purpose | Status |
|---|---|---|
| lib-crypto | Post-quantum cryptography (CRYSTALS-Dilithium/Kyber) | - |
| lib-proofs | Zero-knowledge system (Plonky2) | Required |
| lib-identity | Privacy-preserving identity management | Required |
| lib-storage | Distributed storage with encryption | Required |
| lib-network | Mesh networking (BLE, WiFi Direct, LoRaWAN) | Required |
| lib-blockchain | Blockchain layer with UBI support | Required |
| lib-consensus | Consensus mechanism | Required |
| lib-economy | Economic incentives and DAO governance | Required |
| lib-protocols | High-level protocol implementations | Required |
The ZHTP orchestrator contains sophisticated internal systems:
- aggregation.rs - Cross-package configuration coordination
- validation.rs - Configuration conflict detection and resolution
- environment.rs - Environment-specific settings (dev/staging/prod)
- mesh_modes.rs - Mesh networking mode management
- security.rs - Security level configurations
- argument_parsing.rs - Command-line argument processing
- command_execution.rs - Command handling and orchestration
- interactive_shell.rs - Interactive shell with auto-completion
- commands/ - Specialized command handlers for each subsystem
- components.rs - Component lifecycle management
- blockchain_provider.rs - Blockchain integration layer
- shared_blockchain.rs - Shared blockchain state management
- metrics.rs - Real-time system metrics collection
- health_check.rs - Component health monitoring
- alerting.rs - Alert management and notifications
- dashboard.rs - Web dashboard with live visualization
- service_container.rs - Dependency injection container
- event_bus.rs - Inter-component messaging system
- component_manager.rs - Component startup and shutdown coordination
- dependency_injection.rs - Advanced dependency resolution
- server.rs - HTTP API server for external integration
- endpoints.rs - RESTful API endpoint definitions
- handlers/ - Request handlers for each functional area
- Rust 1.70+ - Install from rustup.rs
- All ZHTP Libraries - Ensure all 9 lib-* packages are available in parent directory
- System Requirements - 4GB RAM, 10GB storage minimum
- Clone the ZHTP repository structure:
git clone https://github.com/SOVEREIGN-NET/SOVEREIGN_NET.git
cd SOVEREIGN_NET/zhtp- Verify dependencies are available:
# Check that all required libraries exist
ls -la ../lib-*
# Should show: lib-blockchain, lib-consensus, lib-crypto, lib-economy,
# lib-identity, lib-network, lib-proofs, lib-protocols, lib-storage- Build the ZHTP node:
cargo build --release- Run initial setup:
# Create default configuration
cargo run -- node start --dev# Start the interactive ZHTP shell
cargo run
# Available commands in the shell(not all of them work):
zhtp> help # Show all available commands
zhtp> node start --port 9333 # Start the orchestrator node
zhtp> node status # Check node health
zhtp> monitor system # View system metrics
zhtp> wallet create --name "MyWallet" --type citizen
zhtp> dao info # Check DAO status
zhtp> identity create TestUser # Create new DID identity
zhtp> network status # Check mesh network status# Start ZHTP server (API mode)
cargo run -- --server
# Server will be available at http://127.0.0.1:9333
# API documentation: http://127.0.0.1:9333/docs# Execute single commands directly
cargo run -- node start --config config.toml
cargo run -- wallet balance <address>
cargo run -- dao claim-ubi
cargo run -- network peers# Start with default settings
cargo run -- node start
# Start with custom configuration
cargo run -- node start --config custom.toml --port 9333 --dev
# Start in pure mesh mode (no TCP/IP fallback)
cargo run -- node start --pure-mesh# Create a new Zero-Knowledge DID identity
cargo run -- identity create-did Alice \
--type human \
--recovery-options "phrase1,phrase2"
# Verify an existing identity
cargo run -- identity verify <identity_id>
# List all identities
cargo run -- identity list# Create a new citizen wallet
cargo run -- wallet create --name "CitizenWallet" --type citizen
# Check wallet balance
cargo run -- wallet balance <wallet_address>
# Transfer funds between wallets
cargo run -- wallet transfer \
--from <from_wallet> \
--to <to_wallet> \
--amount 1000
# View transaction history
cargo run -- wallet history <wallet_address># Get DAO information
cargo run -- dao info
# Create a new proposal
cargo run -- dao propose \
--title "Network Upgrade" \
--description "Implement new features"
# Vote on a proposal
cargo run -- dao vote --proposal-id <id> --choice yes
# Claim your Universal Basic Income
cargo run -- dao claim-ubi# Check network status
cargo run -- network status
# View connected peers
cargo run -- network peers
# Test network connectivity
cargo run -- network test# View system metrics
cargo run -- monitor system
# Check component health
cargo run -- monitor health
# View performance metrics
cargo run -- monitor performance
# Check system logs
cargo run -- monitor logs# List all components
cargo run -- component list
# Start a specific component
cargo run -- component start lib-blockchain
# Check component status
cargo run -- component status lib-network
# Restart a component
cargo run -- component restart lib-consensus[node]
name = "zhtp-node"
mesh_port = 33444
api_port = 9333
environment = "development"
data_dir = "./data"
[mesh]
mode = "hybrid" # hybrid, pure-mesh, offline
enable_bluetooth = true
enable_wifi_direct = true
enable_lorawan = false
[security]
level = "enhanced" # basic, enhanced, paranoid
quantum_resistant = true
zero_knowledge = true
[economy]
ubi_enabled = true
dao_participation = true
daily_ubi_amount = 33000000000000000000 # 33 ZHTP tokens
monthly_ubi_amount = 1000000000000000000000 # 1000 ZHTP tokens
[monitoring]
enable_dashboard = true
dashboard_port = 9334
metrics_interval = 30
health_check_interval = 60
[logging]
level = "info"
output = "console"
file_path = "./logs/zhtp.log"export ZHTP_CONFIG_PATH="./config.toml"
export ZHTP_DATA_DIR="./data"
export ZHTP_LOG_LEVEL="info"
export ZHTP_MESH_PORT="33444"
export ZHTP_API_PORT="9333"
export ZHTP_ENVIRONMENT="development"The ZHTP node provides a comprehensive REST API on port 9333:
Base URL: http://127.0.0.1:9333/api/v1
POST /identity/create- Create new DID identityPOST /identity/verify- Verify identityGET /identity/list- List all identities
POST /wallet/create- Create new walletGET /wallet/balance/{address}- Get wallet balancePOST /wallet/transfer- Transfer fundsGET /wallet/history/{address}- Get transaction history
GET /dao/info- Get DAO informationPOST /dao/proposal/create- Create proposalPOST /dao/proposal/vote- Vote on proposalPOST /dao/ubi/claim- Claim UBI
GET /network/status- Network statusGET /network/peers- Connected peersGET /network/test- Network connectivity test
For complete API documentation, visit: http://127.0.0.1:9333/docs when the server is running.
Access the live monitoring dashboard at http://127.0.0.1:9334 when the node is running:
- System Metrics - CPU, memory, network usage
- Component Health - Status of all 9 ZHTP libraries
- Network Statistics - Mesh network connectivity and performance
- Economic Metrics - UBI distribution, transaction volumes
- Security Status - Cryptographic operations, threat detection
Logs are written to ./logs/zhtp.log by default:
# View real-time logs
tail -f ./logs/zhtp.log
# Filter for specific components
grep "lib-network" ./logs/zhtp.log
# View error logs only
grep "ERROR" ./logs/zhtp.log# Check overall system health
curl http://127.0.0.1:9333/api/v1/health
# Check specific component health
curl http://127.0.0.1:9333/api/v1/health/lib-blockchain# Development build
cargo build
# Release build with optimizations
cargo build --release
# Build with specific features
cargo build --features "pure-mesh,development"# Run all tests
cargo test
# Run specific test suite
cargo test integration_tests
# Run with verbose output
cargo test -- --nocapture# Start in development mode with enhanced logging
cargo run -- node start --dev
# Use custom configuration for development
cargo run -- node start --config dev-config.toml --dev- CRYSTALS-Dilithium - Digital signatures
- CRYSTALS-Kyber - Key encapsulation
- Quantum-resistant - Protection against future quantum computers
- Plonky2 Proofs - Privacy-preserving transaction validation
- Selective Disclosure - Reveal only necessary information
- Anonymous Communications - No metadata leakage
- Anti-Spam - Economic incentives prevent network abuse
- Quality Rewards - Better service providers earn more
- Decentralized Governance - Community-driven security decisions
- Uses mesh networking with TCP/IP fallback
- Gradual transition from traditional internet
- Best compatibility with existing systems
- Complete using only mesh protocols
- Maximum privacy and decentralization
- Requires multiple ZHTP nodes in area
- Local-only operations without external connectivity
- Useful for development and testing
- Complete functionality simulation
- Core orchestrator implementation
- Configuration management system
- CLI interface and interactive shell
- Monitoring and health checks
- API server with REST endpoints
- Complete mesh networking implementation
- functionality
- Multi-protocol support (BLE, WiFi Direct, LoRaWAN)
- Network topology optimization
- π UBI distribution implementation
- π DAO governance mechanics
- π Economic incentive algorithms
- π Quality-based reward system
- π Production security hardening
- π Scalability optimizations
- π Mobile device support
- π Global network coordination
We welcome contributions to the ZHTP project! Please see:
- CONTRIBUTING.md - Contribution guidelines
- CODE_OF_CONDUCT.md - Community standards
- DEVELOPMENT.md - Development setup and practices
# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/SOVEREIGN_NET.git
cd SOVEREIGN_NET/zhtp
# Create a feature branch
git checkout -b feature/your-feature-name
# Make your changes and test
cargo test
cargo fmt
cargo clippy
# Submit a pull request
git push origin feature/your-feature-nameThis project is licensed under the MIT License - see the LICENSE file for details.
- Complete Documentation: docs/README.md - Start here for comprehensive documentation
- API Reference: docs/api-reference.md - Complete API endpoint documentation
- CLI Reference: docs/cli-reference.md - Command-line interface guide
- Configuration Guide: docs/configuration-guide.md - Setup and configuration
- Deployment Guide: docs/deployment-guide.md - Production deployment
- Architecture Overview: docs/architecture.md - System architecture
- Module Analysis: docs/module-analysis.md - Detailed code analysis
- GitHub Issues: Report bugs and request features
- Discussions: Community discussions and Q&A
# Built-in help system
cargo run -- help
cargo run -- node --help
cargo run -- wallet --help
# Interactive help in shell mode
zhtp> help
zhtp> help wallet
zhtp> help daoZHTP - Revolutionizing Internet Infrastructure
Building the foundation for Web4 and true digital sovereignty
Website β’ Documentation β’ Community