Core Smart Contracts for the Hypernode Decentralized GPU Network
Production-ready Solana programs powering the Hypernode marketplace, staking, rewards distribution, slashing, and DAO governance.
Hypernode is a decentralized GPU marketplace built on Solana, enabling users to access computational resources and node operators to monetize their hardware. This repository contains the core smart contracts that power the entire ecosystem.
| Program | Purpose | Status |
|---|---|---|
| hypernode-nodes | Node registry, hardware specs, reputation tracking | ✅ Deployed () |
| hypernode-jobs | Job marketplace with dynamic queue, IPFS integration | ✅ Deployed () |
| hypernode-staking | Time-locked HYPER staking with HYPER-XP multipliers | ✅ Production Ready |
| hypernode-rewards | Reflection-based O(1) rewards distribution | ✅ Production Ready |
| Program | Purpose | Status |
|---|---|---|
| hypernode-markets | Market configuration, pricing, job parameters | ✅ Production Ready |
| hypernode-slashing | Evidence-based node penalties for misbehavior | ✅ Production Ready |
| hypernode-governance | DAO voting with HYPER-XP-weighted power, proposals | ✅ Production Ready |
| hypernode-facilitator | x402 payment protocol, micropayment channels | ✅ Production Ready |
Recent Update:
hypernode-jobsandhypernode-nodesmigrated from hypernode-core-protocol (now deprecated).
- ✅ Node registration with hardware specifications
- ✅ GPU type tracking (NVIDIA RTX, A100, H100, AMD MI250/MI300)
- ✅ Reputation scoring (0-1000 scale based on job completion)
- ✅ Heartbeat monitoring for uptime tracking
- ✅ Stake validation and requirements
- ✅ Trustless job-to-node matching via dynamic queue
- ✅ IPFS content-addressed storage (32-byte hashes)
- ✅ SPL token escrow with automatic settlement
- ✅ Permissionless recovery for expired jobs
- ✅ Three queue states: Empty, Node-waiting, Job-waiting
- ✅ Event emission for off-chain tracking
- ✅ Market configuration and parameter management
- ✅ Job pricing mechanisms
- ✅ Timeout configuration
- ✅ Node stake minimum requirements
- ✅ Total jobs and nodes tracking
- ✅ Time-locked staking (2 weeks to 1 year)
- ✅ HYPER-XP multipliers (1x → 4x based on duration)
- ✅ Cooldown period enforcement
- ✅ Cross-program integration with Markets & Rewards
- ✅ Reflection algorithm for O(1) distribution
- ✅ 1% marketplace fees redistributed to HYPER-XP holders
- ✅ Automatic proportional rewards
- ✅ Gas-efficient math operations
- ✅ Validator consensus (minimum 3 validators)
- ✅ 7-day appeal period
- ✅ Maximum 50% stake slash
- ✅ IPFS evidence storage
- ✅ HYPER-XP-weighted voting
- ✅ 10% quorum requirement
- ✅ 3-day voting period + 1-day execution delay
- ✅ Multiple proposal types (market params, treasury, upgrades)
Overall Risk: ✅ **SAFE FOR **
| Category | Issues | Status |
|---|---|---|
| Critical | 3 | ✅ Fixed (533e491) |
| High | 3 | ✅ Fixed (6bdfc0f) |
| Medium | 3 | 📝 Documented |
| Low | 3 | 📝 Documented |
Security Fixes Implemented:
- C-1: Account ownership validation in Markets
- C-2: Integer overflow protection in Rewards
- C-3: Reentrancy protection in Slashing
- H-1: Stake active check in withdraw
- H-2: Proposal ID collision prevention
- H-3: Queue size limit enforcement
See SECURITY_AUDIT.md for full details.
Compute Unit (CU) Savings: 35-40% reduction
| Optimization | Impact | Savings |
|---|---|---|
| Zero-copy deserialization | High | ~10,000 CU |
| Circular buffer queue | High | ~5,000 CU |
| Struct field packing | Medium | 7 bytes/account |
| Function inlining | Medium | ~200 CU/call |
Cost Analysis:
- Before: ~20,000 CU average → 5 SOL/year (1M transactions)
- After: ~13,000 CU average → 3 SOL/year (1M transactions)
- Savings: 2 SOL/year = ~$200 @ $100/SOL
See GAS_OPTIMIZATION.md for full details.
┌─────────────────────────────────────────────────────┐
│ Hypernode DAO │
│ (Governance Program) │
└────────────────────┬────────────────────────────────┘
│
┌─────────────┼─────────────┐
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Markets │ │ Staking │ │ Rewards │
│ Program │←→│ Program │←→│ Program │
└────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │
│ ┌──────┴──────┐ │
└──────│ Slashing │──────┘
│ Program │
└─────────────┘
- Markets → Staking: Verify node HYPER-XP stake
- Markets → Rewards: Distribute 1% fees
- Slashing → Staking: Execute stake slash
- Rewards → Staking: Register/unregister HYPER-XP
All Solana programs are automatically compiled using GitHub Actions on every push to main or develop branches. This eliminates local compilation issues and ensures consistent builds.
Build Workflow: .github/workflows/build-programs.yml
- ✅ Programs compiled in Ubuntu Linux environment
- ✅ Tests executed automatically
- ✅ Artifacts (.so files + IDLs) uploaded
- ✅ Linting checks (rustfmt + clippy)
# Check latest builds
https://github.com/Hypernode-sol/hypernode-llm-deployer/actions- Go to Actions tab
- Select latest successful build
- Download "solana-programs" artifact
- Contains:
*.sofiles and*.jsonIDLs
Deploy to Solana using the automated workflow.
Deploy Workflow: .github/workflows/deploy-.yml
# 1. Generate deployment keypair
solana-keygen new --outfile deploy-keypair.json
# 2. Add as GitHub Secret
# Go to: Settings → Secrets → New repository secret
# Name: SOLANA_DEPLOY_KEYPAIR
# Value: <paste contents of deploy-keypair.json>
# 3. Fund the wallet ()
solana airdrop 2 deploy-keypair.json - Go to Actions tab
- Select "Deploy to " workflow
- Click "Run workflow"
- Type "deploy" to confirm
- Wait for deployment to complete
The workflow will:
- ✅ Build all programs
- ✅ Deploy to
- ✅ Verify deployed programs
- ✅ Generate deployment summary with explorer links
If you prefer manual deployment:
# Configure for
solana config set
# Deploy using Anchor
anchor deploy --provider.wallet ~/.config/solana/id.json
# Verify deployment
solana program show <PROGRAM_ID> # Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install Solana CLI
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
# Install Anchor
cargo install --git https://github.com/coral-xyz/anchor --tag v0.29.0 anchor-cli --locked# Clone repository
git clone https://github.com/Hypernode-sol/hypernode-llm-deployer.git
cd hypernode-llm-deployer
# Automated setup (recommended)
chmod +x scripts/setup-dev.sh
./scripts/setup-dev.sh
# Or manual setup
anchor build
cd sdk && yarn install && yarn build
cd../worker && yarn install && yarn build
# Run tests
./scripts/run-tests.sh
# Or: anchor test# Quick development setup
make install # Install all dependencies
make build # Build programs and packages
make test # Run all tests
make clean # Clean build artifacts
# Deploy to different networks
./scripts/deploy-programs.sh
./scripts/deploy-programs.sh mainnet
# Using docker-compose for local development
docker-compose up -d# Configure for
solana config set
# Create wallet (if needed)
solana-keygen new --outfile ~/.config/solana/.json
# Airdrop SOL for testing
solana airdrop 2
# Deploy
anchor deploy Update these in Anchor.toml after deployment:
[programs.]
hypernode_markets = "YOUR_MARKETS_PROGRAM_ID"
hypernode_staking = "YOUR_STAKING_PROGRAM_ID"
hypernode_rewards = "YOUR_REWARDS_PROGRAM_ID"
hypernode_slashing = "YOUR_SLASHING_PROGRAM_ID"
hypernode_governance = "YOUR_GOVERNANCE_PROGRAM_ID"hypernode-llm-deployer/
├── programs/ # Solana programs
│ ├── hypernode-markets/ # Job/node marketplace
│ ├── hypernode-staking/ # Time-locked staking
│ ├── hypernode-rewards/ # Reflection rewards
│ ├── hypernode-slashing/ # Fraud penalties
│ └── hypernode-governance/ # DAO governance
├── tests/ # Integration tests
│ ├── hypernode-markets.ts
│ ├── hypernode-staking.ts
│ ├── hypernode-rewards.ts
│ └── integration.ts
├── sdk/ # TypeScript SDK
│ ├── src/
│ │ ├── MarketClient.ts
│ │ ├── JobClient.ts
│ │ ├── StakingClient.ts
│ │ └── RewardsClient.ts
│ └── package.json
├── worker/ # Worker node client
│ └── src/
│ ├── NodeManager.ts
│ └── handlers/
├── governance-ui/ # React governance dashboard
│ └── src/components/
├── templates/ # AI framework templates
│ ├── pytorch/
│ ├── huggingface/
│ └── stable-diffusion/
├── Anchor.toml # Anchor configuration
├── SECURITY_AUDIT.md # Security audit report
├── GAS_OPTIMIZATION.md # Gas optimization report
└── README.md # This file
# Test individual programs
anchor test --skip-deploy -- --test-threads=1# Full end-to-end flow
anchor test| Program | Coverage | Status |
|---|---|---|
| Markets | 85% | ✅ |
| Staking | 90% | ✅ |
| Rewards | 80% | ✅ |
| Slashing | 75% | ✅ |
| Governance | 70% | ✅ |
HYPER Token
- Mint Address:
92s9qna3djkMncZzkacyNQ38UKnNXZFh4Jgqe3Cmpump - Total Supply: 1,000,000,000 HYPER
- Decimals: 6
- Distribution: 100% public launch
HYPER-XP Multipliers
- 2 weeks: 1.0x
- 1 month: 1.25x
- 6 months: 2.5x
- 1 year: 4.0x
- Architecture Guide - System design and program interactions
- API Reference - Complete instruction reference
- SDK Guide - TypeScript SDK documentation
- Worker Guide - Node operator setup
- Governance Guide - DAO participation
- Markets, Staking, Rewards programs
- Basic job matching and escrow
- Time-locked staking with multipliers
- Slashing and Governance programs
- Security audit and fixes
- Gas optimizations (35-40% reduction)
- Zero-copy deserialization
- Deploy to
- Integration testing
- Bug fixes and improvements
- External professional audit
- Mainnet deployment
- Treasury multi-sig setup
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
anchor test - Submit a pull request
MIT License - see LICENSE for details
- GitHub Organization: github.com/Hypernode-sol
- Main Repository: github.com/Hypernode-sol/hypernode-llm-deployer
- Twitter: @hypernode_sol
Built on Solana. Powered by decentralization.