How to Decentralize Merge-Mining with Stratum V2: A Guide to DMND and RootstockLabs Integration
Step-by-step guide to merge-mining Bitcoin and RSK using DMND and RootstockLabs with Stratum V2, giving miners control over block templates and direct rBTC rewards.
Overview
The partnership between DMND and RootstockLabs marks a significant step toward decentralizing Bitcoin mining by bringing Stratum V2 to merge-mining. This integration allows miners to construct their own block templates while also handling the selection and inclusion of merge-mined block commitments from the Rootstock (RSK) sidechain. Unlike traditional setups where the pool controls block templates and distributes rewards, this new feature puts miners in direct control, enabling them to claim sidechain rewards in rBTC without revenue sharing or intermediary custody. This guide walks you through the process, prerequisites, and best practices to leverage this technology.

Prerequisites
Before diving into the setup, ensure you have the following:
- Mining Hardware: ASIC miners capable of running modern firmware (e.g., Braiins OS+ or open-source alternatives) that support Stratum V2.
- DMND Account: Register with DMND (Decentralized Mining Network) to access their pool and Stratum V2 endpoint.
- Rootstock Wallet: A wallet that supports rBTC and RSK sidechain operations (e.g., Metamask with RSK network).
- Technical Familiarity: Basic understanding of Bitcoin mining, merge-mining concepts, and command-line interface for configuration.
- Network Connectivity: Stable internet connection with low latency to DMND’s Stratum V2 servers.
Step-by-Step Instructions
1. Configure Your Mining Hardware for Stratum V2
Stratum V2 requires custom firmware. Most modern ASICs (e.g., Antminer S19 series, Whatsminer M50) can be flashed with Braiins OS+ or Vnish. Follow your manufacturer’s guide to update firmware. Ensure Stratum V2 is enabled in the mining interface.
Example configuration (via web interface):
- Log into miner dashboard.
- Navigate to Mining Settings.
- Set URL to
stratum+tcp://dmnd-pool.example.com:3333(replace with actual DMND endpoint). - Enable Stratum V2 and Template Construction.
- Save and restart miner.
2. Set Up DMND Pool Account and Template Construction
DMND allows miners to create their own block templates. You’ll need to generate a template provider key through DMND’s dashboard.
- Log in to DMND Dashboard (hypothetical).
- Go to Settings → Stratum V2.
- Click Generate New Template Key.
- Copy the key and store it securely.
On your miner, you may need to pass this key via command line. Example:
# Assuming custom firmware
./cgminer --stratum-v2 --template-key YOUR_KEY -o stratum+tcp://dmnd-pool.example.com:3333 -u YOUR_WALLET_ADDRESS -p x
3. Integrate Rootstock Merge-Mining Commitment
Merge-mining allows you to mine RSK sidechain alongside Bitcoin. With Stratum V2, you can directly include RSK commitments in your own block template. Download the RSK Merge-Mining Plugin provided by RootstockLabs.
- Install the plugin on your mining node (e.g., via Docker):
docker pull rootstock/merge-mining-plugin - Configure the plugin to connect to a Rootstock node (or public RPC).
- Set your RSK payout address for rBTC rewards.
Sample configuration file (config.toml):
[merge-mining]
enabled = true
augmented-block = true
rpc-url = "http://rsk-node:4444"
reward-address = "0xYourRSKAddress"
[stratum]
pool-url = "stratum+tcp://dmnd-pool.example.com:3333"
template-key = "YOUR_TEMPLATE_KEY"
4. Launch the Merge-Mining Process
- Start your Rootstock node (if running locally) and ensure it syncs.
- Run the merge-mining plugin:
./merge-mining-plugin --config config.toml - Monitor logs for successful handshake with DMND pool and RSK chain.
- Your miner should now produce blocks that include RSK commitments. Check dashboard for share submissions.
5. Verify Rewards
Unlike traditional pools, DMND sends rBTC rewards directly to your RSK wallet without a middleman. Use a block explorer like RSK Explorer to confirm your rBTC balance after a successful merge-mined block.
Common Mistakes
- Incorrect Template Key: Ensure the key from DMND dashboard matches the one in your miner configuration. Mismatched keys prevent Stratum V2 authentication.
- Missing Stratum V2 Support in Firmware: Not all firmware supports Stratum V2. Double-check that you’ve flashed an up-to-date version that includes template construction.
- Wrong RSK Network ID: The merge-mining plugin must point to the correct Rootstack chain (mainnet vs testnet). Mistaking network IDs leads to orphan blocks.
- Firewall Blocks: Port 4444 (RSK RPC) and Stratum ports (3333) must be open. Common oversight.
- Ignoring rBTC Wallet Compatibility: Not all Bitcoin wallets support rBTC. Use a wallet that explicitly handles RSK tokens.
Summary
This integration empowers miners to take full control of merge-mining by combining Stratum V2’s template construction with RootstockLabs’ sidechain. By following the steps above, you can mine both Bitcoin and RSK simultaneously, earning rBTC directly without pool-mediated revenue sharing. While it introduces complexity—requiring custom firmware, template keys, and a merge-mining plugin—the payoff is greater decentralization and autonomy. As this technology matures, it will test whether true miner-driven merge-mining strengthens or challenges network security.