WebMiner ๐
Simple Standalone Static Monero Webminer
โ Production Ready - All core features implemented and testedA lightweight, ethical, consent-based Monero webminer that runs entirely in modern browsers. Built as a single JavaScript file with no external dependencies for easy self-hosting and integration.
โจ Key Features
- ๐ก๏ธ Consent-First: Explicit user permission required - no dark patterns
- ๐ฑ Universal Compatibility: Works in all modern browsers (Chrome 70+, Firefox 65+, Safari 14+, Edge 79+)
- โก Single File Deployment: One JavaScript file (89KB development, 54KB production)
- ๐ง Self-Hostable: Deploy on any standard web server
- ๐๏ธ Configurable Resource Usage: 10-50% CPU throttling options
- ๐ Secure: No eval(), CSP compatible, secure WebSocket connections
- ๐ Transparent: Real-time performance monitoring and earnings estimates
- ๐ Device-Friendly: Intelligent battery protection, thermal throttling, and adaptive performance optimization
- ๐ Smart Monitoring: Real-time performance tracking with health scoring and optimization recommendations
- ๐ฑ Mobile-Optimized: Touch-friendly interface, orientation handling, and mobile-specific power management
๐ฏ Philosophy
WebMiner prioritizes ethical implementation over mining efficiency. Every design decision puts user consent, transparent communication, and maintainable code first. Mining should never happen without explicit user permission, and users should always understand exactly what their browsers are doing.โ ๏ธ WebSocket-to-Stratum Proxy Required
Important: Most Monero pools use TCP Stratum protocol, which browsers cannot access directly. You need a WebSocket-to-Stratum proxy server to bridge the connection. ๐ Complete Proxy Setup Guide - Includes Node.js proxy server code, Docker deployment, and production configuration.Browser (WebMiner) --[WebSocket]--> Proxy Server --[TCP Stratum]--> Mining Pool
๐ Quick Integration
Once your proxy is running, integration is simple:<!-- Development Version (webminer.js) - Full documentation, 89KB -->
<script src="webminer.js"
data-pool="wss://your-proxy.example.com"
data-wallet="YOURMONEROADDRESS"
data-throttle="0.25">
</script>
<!-- Production Version (webminer.min.js) - Optimized, 54KB -->
<script src="webminer.min.js"
data-pool="wss://your-proxy.example.com"
data-wallet="YOURMONEROADDRESS"
data-throttle="0.25">
</script>
Or programmatic control:
WebMiner.init({
pool: 'wss://your-proxy.example.com',
wallet: 'YOURMONEROADDRESS',
autoStart: false,
throttle: 0.25
});
๐ฆ Build Options
| Build | File | Size | Use Case | |-------|------|------|----------| | Development |webminer.js
| 89 KB | Development, debugging, customization |
| Production | webminer.min.js
| 54 KB | Live websites, CDN deployment |
Both builds include identical functionality - use development for debugging and production for deployment.
๐ ๏ธ Technical Approach
- Mining Algorithm: Monero's RandomX (CPU-optimized)
- Performance: WebAssembly + JavaScript fallback
- Architecture: Web Workers to prevent UI blocking
- Connection: WebSocket pool protocol
- Compatibility: Progressive enhancement with graceful degradation
๐งช Testing the Implementation
All core features are complete! Test the full mining system with consent management and adaptive optimizations: # Clone and serve locally
python3 -m http.server 9000
# Open http://localhost:9000/examples/basic.html
# Open the comprehensive test suite
# http://localhost:9000/tests/test-suite.html
<script src="webminer.js"
data-pool="wss://pool.example.com"
data-wallet="YOURMONEROADDRESS"
data-throttle="0.25">
</script>
# Open the optimization test suite
# http://localhost:9000/tests/optimization-tests.html
# Test performance monitoring, adaptive throttling, mobile optimizations
Note: The implementation includes complete mining functionality with WebAssembly RandomX, pool connections, real hash calculations, and comprehensive optimization features. The system intelligently adapts to device capabilities, protects battery life, and provides mobile-optimized experiences. Ready for production use with real pool URLs and wallet addresses.
๐ Documentation
- API Reference:
docs/API.md
- Build Guide:
docs/BUILD.md
- Demo Page:
examples/basic.html
- Test Suite:
tests/test-suite.html
๐ Static Site Generator
WebMiner includes a Node.js static site generator that converts markdown documentation to a navigable HTML website with built-in consensual mining UI:<h1>Generate HTML site from markdown files</h1>
node generate-site.js
<h1>Generate with WebMiner integration (optional)</h1>
node generate-site.js \
--pool="wss://pool.supportxmr.com:443" \
--wallet="YOURMONEROADDRESS" \
--throttle="0.25"
Features:
- Converts all
.md
files to.html
(README.md โ index.html) - Automatically excludes files with
REVIEW
orPLAN
in the name - Respects
.gitignore
patterns - Generates navigation bar with current page highlighting
- Creates responsive
styles.css
stylesheet - Produces clean, accessible HTML5 documents
- Optional: Embeds webminer.js script with pool/wallet configuration
- Consensual UI: Beautiful banner asking for user permission before mining
- Status Display: Real-time hash rate and one-click stop button
๐ Development Progress
Milestone 1: Basic Framework โ
- [x] Consent system implementation
- [x] Basic mining worker structure
- [x] Pool connection prototype
- [x] Simple UI controls
Milestone 2: Core Mining โ
- [x] WebAssembly RandomX integration
- [x] JavaScript fallback implementation
- [x] Hash rate calculation
- [x] Share submission system
Milestone 3: Optimization โ
- [x] Performance monitoring - Real-time device capability detection and health scoring
- [x] Adaptive throttling - Dynamic CPU usage adjustment based on device conditions
- [x] Mobile optimizations - Touch-friendly UI and mobile-specific power management
- [x] Battery protection - Navigator Battery API integration with automatic mining pause
Milestone 4: Single-File Build โ
- [x] Build system for concatenation
- [x] WebAssembly embedding (inline Uint8Array)
- [x] Minification and optimization (40% size reduction)
- [x] Browser compatibility (vanilla ES6+, no transpilation)
Milestone 5: Documentation โ
- [x] Complete API documentation
- [x] Build system documentation
- [x] Integration examples
- [x] Comprehensive test suite
๐ฎ Use Cases
- Content Creators: Monetize websites with user consent
- Developers: Easy integration into web applications
- Organizations: Alternative revenue streams with transparency
- Researchers: Browser-based mining experimentation
๐ Security & Ethics
- User Control: One-click stop functionality
- Resource Limits: Hard CPU usage caps
- Privacy: No personal data collection
- Transparency: Clear earnings expectations
- Mobile Protection: Battery and thermal safeguards
๐ Available Documentation
- API Reference - Complete documentation in
docs/API.md
- Build Guide - Build system details in
docs/BUILD.md
- Integration Examples - Working demos in
examples/
directory - Test Suites - Comprehensive tests in
tests/
directory - Security Best Practices - Documented in API reference
- Mobile Device Guidelines - Included in API documentation
๐ค Contributing
This project is in early development. Contribution guidelines will be available once the core framework is complete.โ๏ธ License
License information will be provided with the initial release.๐ฏ Project Goals - All Achieved โ
Ready for production use! This project sets a new standard for ethical browser-based cryptocurrency mining.
Built with ๐ for the open web