DPMP v2 is a lightweight, high-reliability Stratum v1 mining proxy designed to sit between one or more miners and multiple upstream mining pools.
It enables deterministic dual-pool scheduling, advanced difficulty/extranonce handling, and deep observability via Prometheus metrics β while remaining simple to deploy and operate.
This repository contains the v2 architecture, which is a ground-up redesign focused on correctness, robustness, and long-running stability.
- Python 3.10+
python3-venvpackage installed
sudo apt install -y python3-venv
Install:
git clone https://github.com/ckryza/dpmpv2.git ~/dpmp
cd ~/dpmp
./installer/install.sh
After install:
- Stratum:
:3351 - Metrics:
:9210/metrics - Dashboard:
http://<dpmp-proxy-ip>:8855/
You can preview what the installer would do without making any changes:
cd ~/dpmp
./installer/install.sh --check
cd ~/dpmp
./installer/upgrade.sh
cd ~/dpmp
./installer/upgrade.sh --check
cd ~/dpmp
./installer/uninstall.sh
The non-docker installer is intentionally conservative.
What install.sh does:
- Creates
~/dpmpif missing - Creates a Python virtualenv and installs dependencies
- Installs systemd user services (
dpmpv2.service,dpmpv2-nicegui.service) - Creates
dpmp/config_v2.jsonfromconfig_v2_example.jsononly if missing - Enables linger and auto-starts services
What it does NOT do:
- Does not overwrite an existing config
- Does not touch wallets, pool credentials, or logs
- Does not require root
(e.g., browse to '<dpmp-proxy-ip>:8855/'), click on the Config tab, and update Pool A and Pool B settings (host, port, name, wallet) before mining. Pay special attention to the wallet addresses and make sure the wallet address you add is correct for the pool you are adding it to.
If you encounter errors associated either with a particular miner or a particular pool:
- Please make sure that all events are being logged on the Config tab
- Click APPLY + RESTART to restart DPMP and recreate the error
- Click on the Download Log button on the Logs tab
- Send a description of the problem (i.e., miner-related or pool-related and identify the miner or pool) to dpmp.project@gmail.com and attach the log file.
We have tested DPMP with a number of different miners and pools but it is by no means an exhaustive list. The log data you provide will help us to expand the list of supported miners and pools.
At a high level, DPMP v2:
- Accepts Stratum connections from miners (acts like a pool)
- Maintains concurrent Stratum connections to two upstream pools (acts like a miner)
- Routes jobs and share submissions according to a scheduler
- Ensures correct propagation of:
- difficulty
- extranonce
- job IDs
- Exposes detailed runtime metrics for monitoring and analysis
- Logs structured, machine-readable events for debugging and auditing
The proxy is intentionally transparent: miners and pools do not need to be modified or aware that DPMP is in the middle.
- Simultaneous connections to Pool A and Pool B
- Weight-based scheduling (e.g.
50:50,70:30) - Realtime weighting adjustments via GUI slider
- Time-sliced switching with stickiness controls
- Safe handling of pool transitions to avoid stale or invalid submits
- Strict job ownership tracking per pool
- Extranonce consistency enforcement
- Difficulty forwarding with pool-aware gating
- Duplicate and stale share detection
- Graceful handling of miner reconnects
- Built-in Prometheus metrics endpoint
- Tracks:
- downstream miner connections
- upstream pool connections
- message RX/TX counts
- difficulty state
- scheduler behavior
- Designed to integrate with Grafana or custom dashboards
- JSON-formatted logs
- Explicit event types (e.g.
pool_switched,share_result,job_forwarded) - Designed for both human debugging and automated analysis
- Suitable for ingestion into Loki or other log systems
- NiceGUI-based interface (primary)
- Live config editing, view logs, and status
DPMP v2 operates in three distinct roles simultaneously:
-
Downstream Pool Role
Listens for miner connections and serves Stratum jobs. -
Upstream Miner Role
Connects to real pools, subscribes, authorizes, and receives work. -
Scheduler / Router
Decides which pool is βactive,β forwards jobs, and routes share submissions safely.
The design emphasizes:
- explicit state tracking
- defensive validation
- clear separation of responsibilities
- β Actively used in real mining setups
- β Stable for long-running operation
- π§ Configuration, install, and GUI documentation intentionally evolving
- π§ Future work planned around:
- testing with additional miners to confirm compatibility
- testing with additional pools to confirm compatibility
- richer GUI (using NiceGUI)
- additional scheduling strategies
To keep the repository clean and safe:
- No live configuration files (local
config.jsonis ignored) - No secrets or credentials
- No logs or backups
- No Docker deployment (current focus is non-Docker installs)
Installation, configuration, and operational runbooks will be added once those workflows are finalized.
DPMP v2 is designed for users who:
- Run one or more ASIC or CPU/GPU miners that do not internally support dual-pool mining (i.e., Avalon Q, Avalon Nano3S, etc.)
- Want to split hash power across pools deterministically, such as mine to a Bitcoin pool and a Bitcoin Cash pool simultaneously
- Care about correctness, observability, and long-term stability
- Prefer transparent tooling over black-box pool logic
- add Stats tab with Worker and Pool tables
- address pool/miner compatibility issues
- fix: no slider or auto-balancer display on 0/100 or 100/0 config ratios
- adjust hashrate allocation logic to better account for individual miner hashrate
- ratio convergence is now faster
- prep for transition to fleet management
- can now switch between Slider and Auto-Balance with no restart required (added switch button)
- Auto-Balance times now in local time
- minor cosmetic updates
- calculate realtime network hashrate for BTC and BCH (short-term and long-term)
- add auto-balance options to config
- add auto-balance logic to DPMP and dashboard
- Fixes for ck-type pools and bootstrap sequence
- Add realtime hashrate allocation slider to GUI
- Fixed mining.set_extranonce and client.reconnect issues for NerdAxe Gamma
- Fixed Braiins BM-101 initialization and handshake issues
- Fixed reject storms during pool switches.
- Improved scheduler convergence and validation.
- Increased grace period for stale submits.
- Ensured correct single-pool behavior at 0/100 and 100/0 weights.
- Added pool failover protection.
- Added global exception handling.
- Added periodic state pruning.
MIT License
This software operates at the Stratum protocol level.
Misconfiguration can result in rejected shares or lost revenue.
Use at your own risk and validate behavior carefully in your environment.
More documentation coming soon.