npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stratum-pool-sha256

v2.1.3

Published

High performance SHA-256 Stratum poolserver in Node.js - zero dependencies, pure JavaScript

Readme

SHA-256 Stratum Pool with ASICBoost Support

High-performance Stratum pool server optimized for SHA-256 and SHA-256 ASICBoost mining. Built specifically for NiceHash, MiningRigRentals, and modern ASIC miners.

🎯 Purpose

This is a complete modernization of the original node-stratum-pool, specifically engineered for:

  • NiceHash compatibility with ASICBoost support
  • MiningRigRentals (MRR) full compatibility
  • SHA-256 ASICBoost (version rolling) for 20% power efficiency
  • Pure SHA-256 for standard mining operations

⚡ ASICBoost / Version Rolling

ASICBoost is a mining optimization that allows miners to find blocks ~20% more efficiently by rolling the version bits in the block header. This implementation supports:

  • Stratum extensions - Industry standard version rolling (BIP 310)
  • Version mask: 0x1fffe000 - Compatible with all major ASICs
  • Version range: 0x20000000 to 0x3FFFFFFF
  • Extended mining.submit - 6-parameter support for version submission
  • NiceHash compatible - Works with NiceHash's ASICBoost implementation
  • MRR compatible - Full support for MiningRigRentals

Why ASICBoost Matters

  • 20% power savings - Same hashrate, less electricity
  • 💰 Higher profitability - Lower operating costs
  • 🌡️ Cooler operation - Less heat generation
  • Industry standard - Supported by all modern SHA-256 ASICs

🚀 Features

  • SHA-256 & SHA-256AB - Dual algorithm support
  • Zero Native Dependencies - Pure JavaScript using BigInt
  • NiceHash Optimized - Full extranonce and version rolling support
  • MiningRigRentals Ready - Enhanced debugging and compatibility
  • Modern JavaScript - Node.js 18+ with ES6+ features
  • Production Tested - Running on multiple commercial pools

📦 Installation

npm install git+https://github.com/skaisser/node-stratum-pool.git

Or add to package.json:

"dependencies": {
    "stratum-pool-sha256": "github:skaisser/node-stratum-pool"
}

🔧 Configuration Examples

Bitcoin Cash with ASICBoost (NiceHash/MRR)

const Stratum = require('stratum-pool-sha256');

const pool = Stratum.createPool({
    coin: {
        name: 'BitcoinCash',
        symbol: 'BCH',
        algorithm: 'sha256',
        asicboost: true,  // ENABLE for NiceHash/MRR
        peerMagic: 'e3e1f3e8'
    },
    
    address: 'bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy',
    
    ports: {
        // Standard ports
        3333: { diff: 16 },     // Low difficulty
        3334: { diff: 256 },    // Medium difficulty
        
        // NiceHash/MRR ports (with ASICBoost)
        3335: { 
            diff: 65536,        // High difficulty for rentals
            varDiff: {
                minDiff: 16384,
                maxDiff: 4294967296,
                targetTime: 10,
                retargetTime: 60,
                variancePercent: 20
            }
        }
    },
    
    daemons: [{
        host: '127.0.0.1',
        port: 8332,
        user: 'rpcuser',
        password: 'rpcpass'
    }]
}, (ip, port, workerName, password, callback) => {
    // Parse difficulty from password (e.g., "d=500000")
    let difficulty = null;
    if (password) {
        const match = password.match(/d=(\d+(?:\.\d+)?)/i);
        if (match) {
            difficulty = parseFloat(match[1]);
        }
    }
    
    // Accept all miners with optional custom difficulty
    callback({ 
        error: null, 
        authorized: true, 
        disconnect: false,
        difficulty: difficulty  // Set custom difficulty if provided
    });
});

// Monitor ASICBoost shares
pool.on('share', (isValidShare, isValidBlock, data) => {
    if (data.version) {
        console.log(`⚡ ASICBoost share from ${data.worker} with version ${data.version.toString(16)}`);
    }
    
    if (isValidBlock) {
        console.log('🎉 Block found!');
    }
});

pool.start();

Standard Bitcoin (without ASICBoost)

const pool = Stratum.createPool({
    coin: {
        name: 'Bitcoin',
        symbol: 'BTC',
        algorithm: 'sha256',
        asicboost: false,  // DISABLE for standard Bitcoin
        peerMagic: 'f9beb4d9'
    },
    // ... rest of config
});

🔌 Port Configuration for Rentals

When setting up for NiceHash or MiningRigRentals, use high difficulty ports:

ports: {
    // Regular miners
    3333: { diff: 16 },
    
    // NiceHash / MiningRigRentals
    3335: {
        diff: 65536,  // Start with high difficulty
        varDiff: {
            minDiff: 16384,        // Minimum 16K
            maxDiff: 4294967296,   // Maximum 4G
            targetTime: 10,        // Share every 10 seconds
            retargetTime: 60,      // Adjust every minute
            variancePercent: 20    // 20% variance allowed
        }
    }
}

💪 Custom Difficulty via Password

Miners can request custom difficulty by including d=XXX in their password:

# Miner configuration examples:
username: myworker
password: d=500000     # Sets difficulty to 500,000

username: myworker  
password: x,d=10000000 # Sets difficulty to 10,000,000 (with other params)

The authorization function parses and applies the requested difficulty:

(ip, port, workerName, password, callback) => {
    // Parse d=XXX from password
    let difficulty = null;
    if (password) {
        const match = password.match(/d=(\d+(?:\.\d+)?)/i);
        if (match) difficulty = parseFloat(match[1]);
    }
    
    callback({ 
        error: null, 
        authorized: true,
        difficulty: difficulty  // Applied immediately to the miner
    });
}

This is especially useful for:

  • NiceHash/MRR: Set high fixed difficulty (e.g., d=500000)
  • Large farms: Reduce bandwidth with higher difficulty
  • Testing: Set specific difficulty for debugging

📊 Algorithm Support

| Algorithm | Description | ASICBoost | Use Case | |-----------|-------------|-----------|----------| | sha256 | Standard SHA-256 | Optional | Bitcoin, Namecoin | | sha256 + asicboost: true | SHA-256 with version rolling | Yes | Bitcoin Cash, NiceHash |

🛡️ Key Improvements

  • NiceHash Extranonce - Full extranonce.subscribe support
  • MRR Compatibility - Enhanced share debugging
  • Version Rolling - Stratum extension compliant
  • Zero Vulnerabilities - All dependencies updated
  • Pure JavaScript - No compilation needed
  • BigInt Precision - Accurate difficulty calculations

🧪 Testing

# Run tests
npm test

# Run with coverage
npm run test:coverage

📈 Performance

  • Handles 100,000+ concurrent connections
  • Processes millions of shares per minute
  • Memory efficient for 24/7 operation
  • Automatic difficulty adjustment

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Write tests for changes
  4. Submit a Pull Request

📜 License

MIT License - see LICENSE file

💰 Donations

Support continued development:

🪙 Bitcoin Cash (BCH):
bitcoincash:qq6avlec5l7769jhk5mk7rnsgz49wcx2kgxaklp9e8

Bitcoin (BTC):
bc1q8ukjnlykdpzry9j72lf7ekmpnf2umna6jyxqhn

🐕 Dogecoin (DOGE):
DNU41AwyLba2rCzmjjr8SoYuzhjWkWTHpB

☀️ Solana (SOL):
CcnuMRpNapWboQYEGw3KKfC3Eum5JWosZeC9ktGr2oyQ

🔷 Ethereum (ETH):
0x79eb82Ee97Ce9D02534f7927F64C5BdC4F396301


Built for the professional mining community 🛠️⚡