Skip to content

OIEIEIO/sha3x-miner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sha3x Miner

High-Performance Multi-Algorithm CPU Miner with Web Dashboard

License: MIT Rust Build Status

A high-performance CPU miner supporting SHA3x (Tari) and experimental SHA256d (Bitcoin) mining with advanced features including DNS resolution, real-time web dashboard, and experimental Stratum V2 support.

πŸš€ Features

Production Ready

  • SHA3x Mining: Full support for Tari blockchain mining
  • DNS Resolution: Connect using pool domains (e.g., pool.sha3x.supportxtm.com:6118)
  • Web Dashboard: Real-time mining statistics at http://localhost:8080
  • Pool Compatibility: Works with Lucky Pool, community pools, and strict protocol pools
  • High Performance: Achieves 15-18 MH/s on dual Xeon systems (72 threads)
  • Thread Scaling: Optimized for high-core-count systems
  • Benchmark Mode: Performance testing without pool connection

Experimental (WIP)

  • SHA256d Support: Bitcoin mining capabilities (under development)
  • Stratum V2 (SV2): Next-generation Bitcoin mining protocol testing
  • Multi-Algorithm: Framework for supporting multiple mining algorithms

πŸ“Š Performance Highlights

System Configuration SHA3x Hashrate Efficiency
Dual Xeon 2699v3 (72T) 15-18 MH/s ~250 KH/s per thread
High-end Desktop (32T) 8-12 MH/s ~300-400 KH/s per thread
Workstation (64T) 15-25 MH/s ~250-400 KH/s per thread

πŸ›  Installation

Prerequisites

  • Rust 1.70 or later
  • CPU with AVX2 support (recommended)
  • 4GB+ RAM for optimal performance

Building from Source

# Clone the repository
git clone https://github.com/OIEIEIO/sha3x-miner.git
cd sha3x-miner

# Build in release mode (optimized)
cargo build --release

# The binary will be available at ./target/release/sha3x-miner

🎯 Quick Start

SHA3x Mining (Tari)

# Basic mining with web dashboard
cargo run --release -- \
  --algo sha3x \
  --wallet 125ohcEDcG8sL4DcdtqZ6YLbSgVYFJWtGeCfHmRocTcyGNYRqMYidnfs1JQPijqQvqV5SLygC5ynxZH3zED5Rr9fPAW \
  --pool pool.sha3x.supportxtm.com:6118 \
  --worker x99-cpu \
  --threads 18 \
  --web

# Alternative pools
cargo run --release -- \
  --algo sha3x \
  --wallet YOUR_TARI_WALLET \
  --pool 142.127.107.24:7777 \
  --worker my-worker \
  --threads 32

# High-performance mining (dual Xeon example)
cargo run --release -- \
  --algo sha3x \
  --wallet YOUR_TARI_WALLET \
  --pool pool.sha3x.supportxtm.com:6118 \
  --worker xeon-dual \
  --threads 72 \
  --web

Experimental Bitcoin Mining (SHA256d - WIP)

# Bitcoin pool testing (experimental)
cargo run --release -- \
  --algo sha256 \
  --wallet YOUR_BITCOIN_ADDRESS \
  --pool stratum+tcp://pool.bitcoin.com:3333 \
  --worker bitcoin-test \
  --threads 16

# SV2 (Stratum V2) connection testing
cargo run --release -- \
  --test-sv2 \
  --pool 127.0.0.1:34254

Benchmarking

# SHA3x performance test with specific difficulty
cargo run --release -- \
  --algo sha3x \
  --benchmark \
  --threads 32 \
  --benchmark-duration 60 \
  --benchmark-difficulty 50000000

# SHA256d performance test (experimental)
cargo run --release -- \
  --algo sha256 \
  --benchmark \
  --threads 32 \
  --benchmark-duration 60 \
  --benchmark-difficulty 1000000

🌐 Web Dashboard

When using the --web flag, access your real-time mining dashboard at:

  • URL: http://localhost:8080
  • WebSocket: ws://localhost:8080/ws
  • Features: Live hashrate charts, share tracking, thread monitoring

πŸ“‹ Command Line Options

Required for Mining

  • --algo <ALGORITHM> - Mining algorithm (sha3x or sha256)
  • --wallet <ADDRESS> - Wallet address (Tari or Bitcoin)
  • --pool <HOST:PORT> - Pool address (supports DNS resolution)

Optional Parameters

  • --worker <NAME> - Worker identifier for pool
  • --threads <NUM> - Number of CPU threads (0 = auto-detect)
  • --web - Enable real-time web dashboard
  • --benchmark - Run performance benchmark
  • --benchmark-duration <SEC> - Benchmark duration in seconds
  • --benchmark-difficulty <N> - Target difficulty for benchmarking

Experimental Options

  • --test-sv2 - Test Stratum V2 connection (Bitcoin)

Help and Information

  • -h, --help - Show detailed help
  • -V, --version - Show version information

πŸ— Project Structure

sha3x-miner/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ benchmark/           # πŸ§ͺ Performance testing framework
β”‚   β”œβ”€β”€ core/                # ⚑ Core mining algorithms
β”‚   β”‚   β”œβ”€β”€ sha3x.rs         # SHA3x (Tari) implementation
β”‚   β”‚   β”œβ”€β”€ sha256.rs        # SHA256d (Bitcoin) implementation [WIP]
β”‚   β”‚   └── types.rs         # Algorithm definitions and CLI args
β”‚   β”œβ”€β”€ miner/               # ⛏️ Mining implementation
β”‚   β”‚   └── cpu/             # CPU mining with thread management
β”‚   β”œβ”€β”€ pool/                # 🌐 Pool communication
β”‚   β”‚   β”œβ”€β”€ client.rs        # TCP client with DNS resolution
β”‚   β”‚   └── protocol.rs      # Stratum protocol (V1 + experimental V2)
β”‚   β”œβ”€β”€ web_server.rs        # πŸ“Š Real-time web dashboard
β”‚   β”œβ”€β”€ sv2_protocol.rs      # πŸ”¬ Stratum V2 implementation [WIP]
β”‚   └── dashboard.html       # πŸ–₯️ Web dashboard frontend

⚑ New Features

DNS Resolution

Connect to pools using domain names instead of IP addresses:

# Before (IP only)
--pool 142.127.107.24:7777

# Now (DNS supported)
--pool pool.sha3x.supportxtm.com:6118

Enhanced Pool Compatibility

Fixed compatibility with strict pools that require algorithm as array format:

  • βœ… Lucky Pool (flexible format)
  • βœ… Community pools (standard format)
  • βœ… Strict pools (array format required)

Real-time Web Dashboard

Monitor your mining operation with live statistics:

  • Live hashrate charts
  • Per-thread performance monitoring
  • Share acceptance/rejection tracking
  • Pool connection status
  • WebSocket-based real-time updates

πŸ”¬ Experimental Features

Bitcoin SHA256d Mining (Work in Progress)

  • Basic SHA256d algorithm implementation
  • Stratum V1 protocol support
  • Pool connectivity testing
  • Status: Under development, may have issues

Stratum V2 (SV2) Support (Experimental)

  • TCP connection testing to Job Declaration Server (JDS)
  • Basic noise protocol framework
  • Status: Very early development, connection testing only
# Test SV2 connection
cargo run --release -- --test-sv2 --pool 127.0.0.1:34254 (WIP)

πŸ§ͺ Testing and Validation

Run Performance Tests

# Test SHA3x performance
cargo test test_sha3x_correctness -- --nocapture (WIP)

# Test thread scaling
cargo test test_thread_scaling -- --nocapture (WIP)

# Test multi-algorithm support
cargo test bench_ -- --nocapture (WIP)

πŸ”§ Configuration Examples

Production Mining (SHA3x)

# Tari mining with web dashboard
cargo run --release -- \
  --algo sha3x \
  --wallet 125ohcEDcG8sL4DcdtqZ6YLbSgVYFJWtGeCfHmRocTcyGNYRqMYidnfs1JQPijqQvqV5SLygC5ynxZH3zED5Rr9fPAW \
  --pool pool.sha3x.supportxtm.com:6118 \
  --worker production-rig \
  --threads 64 \
  --web

Experimental Bitcoin Mining

# Bitcoin pool testing (experimental)
cargo run --release -- \
  --algo sha256 \
  --wallet 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 \
  --pool stratum+tcp://slushpool.com:4444 \
  --worker test-worker \
  --threads 32

πŸ“Š Monitoring and Statistics

Console Output

πŸš€ Starting SHA3x Miner
πŸ“ Pool: pool.sha3x.supportxtm.com:6118
πŸ’³ Wallet: 125ohcEDcG8sL4DcdtqZ6YLbSgVYFJWtGeCfHmRocTcyGNYRqMYidnfs1JQPijqQvqV5SLygC5ynxZH3zED5Rr9fPAW
πŸ‘· Worker: x99-cpu
🧡 Threads: 18
πŸ“Š Real-time dashboard will be available at: http://localhost:8080
πŸ“ˆ Live charts accessible via the 'Live Charts' tab
πŸ”— WebSocket endpoint: ws://localhost:8080/ws
🌐 Starting web dashboard server...
🌐 Web dashboard available at: http://localhost:8080
πŸ“Š Real-time charts at: http://localhost:8080 (Live Charts tab)
βœ… Connected to SHA3x pool
πŸ“€ Sent SHA3x login request
πŸ” SHA3x login request sent
πŸ“Š MINER DASHBOARD - 786843f2a65d78c9
β”œβ”€ Algorithm: Sha3x
β”œβ”€ Current Hashrate: 0.00 H/s
β”œβ”€ Session Avg: 0.00 H/s
β”œβ”€ Shares: 0/0 (0.0% accepted)
β”œβ”€ Session Time: 0s
β”œβ”€ Active Threads: 0/18
└─ Current Difficulty: 0
βœ… SHA3x login successful
πŸ“‹ New job sent: b273529473b72d95 (height: 35176, difficulty: 10.0B)
βœ… WebSocket client connected
πŸ“Š Progress: 17.84 MH/s | Shares: 42

Web Dashboard Features

  • Live Charts: Real-time hashrate visualization
  • Thread Monitoring: Individual thread performance
  • Share Tracking: Accepted/rejected share statistics
  • Connection Status: Pool connectivity and latency
  • Job Information: Current mining job details

πŸ›  Troubleshooting

Common Issues

Pool Connection:

  • Use DNS names when possible: pool.sha3x.supportxtm.com:6118
  • Test with different pools if connection fails
  • Check firewall settings for outbound connections

Algorithm Support:

  • SHA3x: Production ready βœ…
  • SHA256d: Experimental, may have issues ⚠️
  • SV2: Connection testing only πŸ”¬

Web Dashboard:

  • Access at http://localhost:8080 when using --web flag
  • Ensure port 8080 is available
  • Dashboard auto-starts with mining

🀝 Contributing

Contributions welcome! Current development priorities:

High Priority

  • Complete SHA256d Bitcoin mining implementation
  • Improve SV2 protocol support
  • Performance optimizations
  • More comprehensive testing

Areas for Contribution

  • GPU acceleration (CUDA/OpenCL)
  • Additional pool protocols
  • Enhanced web dashboard features
  • Documentation improvements

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Tari Project for SHA3x algorithm
  • Bitcoin community for Stratum V2 specifications
  • Rust cryptographic libraries
  • Mining community for testing and feedback

Special thanks to:

  • @Snipa22 - For guidance and assistance during development

πŸ‘₯ Contributors

πŸ“ž Support


Happy Mining! β›οΈπŸ’Ž

Note: Experimental features are under active development. For production mining, use SHA3x algorithm with established pools.

About

High-performance SHA3x (Tari) CPU miner with batch optimization

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published