A Stratum to Stratum proxy pool. Released under AGPL-V3.
proxypool
is a pool server that splits work from an upstream pool server and redistributes them to its miners, handling both share submission and sharelogging for it's patrons.
Hosted on Doge Street mining pool
Donations :) DGJucYFxGt84y2YQEyskGVpg5aJ8vKTVtb
There is a bug in cgminer v3.7.2 that incorrectly assumes the extraNonce2
field is always 4 bytes long, this results in some parts of the coinbase2
being overwritten by the nonce rendering all submitted work invalid. This only affects upstream servers that have coinbase2
as non zero values. P2Pool is not affected.
If you are running a pool server that is using non zero values in coinbase2
(such as stratum-mining
), please ask your miners to upgrade to the latest cgminer
or sgminer
.
- Vardiff
- Address validation
- Redis pubsub for share logging
Currently only Scrypt is supported for upstream servers. The source does not yet include the CPPSRB payout scripts, it will be released once they are cleaned up and thoroughly tested.
The main problem to solve is how to generate unique work for every proxypool client.
The idea is to reduce the size of extraNonce2
so that the server controls the first few bytes. This means that server will be able to generate a unique coinbase for each client, mutating the coinbase hash.
This reduces the block search space for clients. However, the impact is negligible. With a 4 byte upstream extraNonce2
, and with the proxypool server keeping 2 bytes for itself (clients get the other 2). This allows the server to have 65536 concurrent connections and clients to have a maximum hashrate of 2^32 x 2^16, or 256 tera hashes per second, which is more than enough for Scrypt based coins at the time of writing.
Upon client share submission, the server checks that the share matches the required upstream difficulty and resubmits it under it's own name.
Hackage package coming soon.
cabal
>= 1.18 is recommended since it includes for sandboxes.
To build:
$ cabal sandbox init
$ cabal configure
$ cabal build
All configuration is done in proxypool.json
. Most options should be self explanatory.
The proxypool implements the proper address validation algorithm for public keys. Since different coins prepend a different byte to the checksum, this option is configurable in publicKeyByte
. It is expected that miners use their payout address as their username in their mining client. The server does not check passwords.
extraNonce2Size
and extraNonce3Size
control the how the upstream's extraNonce2
is split. Thus extraNonce2Size
and extraNonce3Size
should add up the to the upstream's extraNonce2
's size.
Variable difficulty allows the server to dynamically adjust share difficulty for clients, improving miner efficency and reducing server load. Difficulty adjustments happen every vardiffRetargetTime
or if the client has submitted vardiffShares
in vardiffRetargetTime
.
Vardiff | Configuration |
---|---|
vardiffRetargetTime |
How long in seconds before the server changes the clients's share difficulty |
vardiffTarget |
How many shares should be submitted in vardiffRetargetTime |
vardiffAllowance |
How much under/over target is tolerated, 0.25 = 25% |
vardiffMin |
The minimum share difficulty |
vardiffInitial |
The initial share difficulty |
vardiffShares |
The number of shares submitted in vardiffRetargetTime before a difficulty adjustment is forced |
Since the proxy pool validates shares before submitting to the upstream, profiling results show that checking shares consume around 50% of the server's CPU time. A malicious client sending invalid shares can cause a denial of service for the pool server. The server disconnects a client if they submit over 90% dead shares.