Mining pool basics¶
Bitcoin Gold uses Equihash-Bitcoin Gold (BTG) (N=144, K=5, personalization BgoldPoW), an ASIC-resistant proof-of-work that fits in roughly 2.5 GB of RAM per mining thread. This page covers the operating concepts of a Bitcoin Gold (BTG) mining pool — the part that interfaces with bgoldd and the part that talks to miners over Stratum.
This is not a guide to running a profitable pool. It is a guide to the moving parts so you can decide whether to join an existing pool, run a small private one, or contribute upstream.
Who this is for¶
You want to understand how a Bitcoin Gold (BTG) pool:
- Receives
getblocktemplatefrom a full node. - Distributes work to miners over Stratum.
- Tracks shares and computes rewards.
- Submits valid blocks back to
bgoldd.
What you'll learn¶
- The full request flow from miner to blockchain.
- The
bgolddRPCs a pool needs. - How PPLNS / PPS / SOLO differ in payout.
- Why a pool needs
--zmqpubhashblock.
Concepts¶
Equihash-Bitcoin Gold (BTG) mining parameters¶
| Parameter | Value |
|---|---|
| Algorithm | Equihash-Bitcoin Gold (BTG) (Zcash-derived) |
| N, K | 144, 5 |
| Personalization | BgoldPoW |
| Solution size | 100 bytes |
| Memory per thread | ~2.5 GB |
| Block time target | 10 minutes (600 s) |
| Difficulty adjustment | Zawy's LWMA, 45-block window |
You can verify these against your own bgoldd:
bgold-cli getmininginfo
bgold-cli getblocktemplate '{"rules":["segwit"]}' | jq '.coinbasetxn,.target, .mintime'
Stratum protocol¶
Bitcoin Gold (BTG) pools speak standard Stratum v1 (the same as BTC and most Equihash coins). The basics:
| Method | Direction | Purpose |
|---|---|---|
mining.subscribe |
miner → pool | Login, get extranonce1 |
mining.authorize |
miner → pool | Authenticate with walletaddress.workername |
mining.notify |
pool → miner | New job: job_id, prevhash, coinb1, coinb2, merkle_branch, version, nbits, ntime, clean_jobs |
mining.submit |
miner → pool | Submit share: worker_name, job_id, extranon ce2, ntime, nonce, solution |
mining.set_difficulty |
pool → miner | Server-set per-worker difficulty |
The wallet address embedded in the mining.authorize call is the payout address for that miner. Pools credit all rewards to that address (minus fees).
Payout schemes¶
| Scheme | Risk to miner | Risk to pool | Notes |
|---|---|---|---|
| PPS (Pay Per Share) | None — every accepted share has a fixed value | Pool absorbs variance | Higher pool fee (~3 %). |
| PPLNS (Pay Per Last N Shares) | Reward varies with pool luck | Pool has no risk | Lower fee (~0.5–1 %). Standard for Equihash coins. |
| SOLO | Miner keeps full block reward | No pool, just the daemon | Only worth it for very large hashrate. |
Bitcoin Gold (BTG) community pools mostly use PPLNS.
The role of a full node¶
A pool is a daemon wrapper. The chain itself is held by one or more bgoldd instances. The pool:
- Calls
getblocktemplateon each new tip (ZMQhashblocktriggers a refresh). - Constructs a Stratum job from the template, replacing the coinbase output with the miner's address.
- Distributes the job to subscribed miners.
- Collects
mining.submitshares, validates the Equihash solution locally (cheap), and credits shares. - When a share is also a valid block (meets network difficulty), submits it to
bgolddviasubmitblock.
1. The bgoldd side¶
A pool needs a bgoldd that exposes:
- RPC for
getblocktemplate,submitblock,getblock,getblockhash. - ZMQ for
hashblock(so the pool re-templates immediately on a new block, instead of polling).
Add to /var/lib/bitcoingold/.bitcoingold/bitcoingold.conf:
# Required for any pool backend
server=1
txindex=1
rpcuser=pool
rpcpassword=STRONG_PASSWORD
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
# Re-template on new block
zmqpubhashblock=tcp://127.0.0.1:38335
# Pool traffic (don't cap upload — helps the network)
maxuploadtarget=0
A small set of submitblock-related limits the pool will rely on:
# Maximum number of blocks the pool can submit in parallel
# (default is fine; raise if you have many workers)
bgold-cli submitblock <hex>
2. Reference pool software¶
A few options for actually running the pool backend:
| Software | Language | Notes |
|---|---|---|
| node-stratum-pool | Node.js | Used by many small BTC-fork pools. Requires manual patches for Bitcoin Gold (BTG). |
| Miningcore | C# | Modern, multi-coin. Has Bitcoin Gold (BTG) support upstream. |
| yiimp | PHP | Older, more complex; many existing Bitcoin Gold (BTG) pools run it. |
| MPOS | PHP | Front-end only; needs a stratum backend. |
For v1, the simplest path is Miningcore — it has Bitcoin Gold (BTG) support out of the box (configurable coin definitions), a real admin UI, and supports Stratum + Stratum-WS.
3. Miningcore for Bitcoin Gold (BTG) (sketch)¶
# Build (after cloning)
git clone https://github.com/coinfoundry/miningcore.git
cd miningcore
docker build -t miningcore .
The coins.json for Bitcoin Gold (BTG):
{
"coin": {
"name": "BitcoinGold",
"symbol": "Bitcoin Gold (BTG)",
"website": "https://btgofficial.org",
"explorer": "https://explorer.bitcoingold.services",
"explorerTxLink": "https://explorer.bitcoingold.services/tx/{0}",
"explorerAddressLink": "https://explorer.bitcoingold.services/address/{0}",
"type": "pow-hash-equihash",
"algorithm": "equihash-btg",
"equihashParameters": "144,5",
"personalization": "BgoldPoW",
"txComment": false,
"family": "bitcoin",
"network": "main",
"rewardReductionPercent": 0,
"blockTime": 600,
"hardForkBlockHeight": 536200,
"defaultPort": 8338,
"defaultP2PPort": 8338,
"defaultRpcPort": 8332,
"genesisBlockHash": "00000000e0781ebe24b91eedc293adfea2f557b53ec379e78959de3853e6f9f6",
"blockReward": "12.5",
"minimumConfirmations": 1,
"coinbaseTxComment": false,
"payoutScheme": "PPLNS",
"walletEnabled": false
}
}
Genesis block hash
The Bitcoin Gold (BTG) genesis is 00000000e0781ebe24b91eedc293adfea2f557b53ec379e78959de3853e6f9f6. The block time is 1516123516, nonce 0x56bd5142.
4. What to expose to miners¶
Your pool's Stratum endpoint. For Bitcoin Gold (BTG), common choices:
| Address | Use |
|---|---|
stratum+tcp://btg.example.com:3333 |
Stratum v1 (universal) |
stratum+ssl://btg.example.com:3334 |
Stratum v1 over TLS (more secure) |
stratum+tcp://btg.example.com:3335 |
Stratum v1 with fixed difficulty |
Port 3333 is the historical default for Equihash-Bitcoin Gold (BTG) pools. The actual port is up to you.
5. Worker setup¶
A miner connects with:
URL: stratum+tcp://btg.example.com:3333
Username: GYf8nyo1c8oWsHzbvL1fD3Ckgg68UzBi5J.worker1
Password: x
The part before the . is the payout address (a Bitcoin Gold (BTG) P2PKH or bech32 address). The pool credits all shares to that address. The part after the . is the worker name (for the miner's own stats).
If you're running your own miner to your own pool:
# Example with EWBF (popular Equihash miner; legacy but stable)
./ewbf-equihash-btg \
--algo 144_5 \
--pers BgoldPoW \
--server btg.example.com \
--port 3333 \
--user GYf8nyo1c8oWsHzbvL1fD3Ckgg68UzBi5J.worker1 \
--pass x
For modern GPU miners, lolMiner or miniZ support Equihash-Bitcoin Gold (BTG) with much better tuning.
6. Verifying the pool is healthy¶
# Does the pool have a fresh block template?
stratum-cli ping btg.example.com:3333
# Stratum subscribe (raw)
echo '{"id":1,"method":"mining.subscribe","params":[]}' | \
timeout 5 nc -q1 btg.example.com 3333
# Expect: extranonce1, extranonce2_size
# Stratum authorize
echo '{"id":2,"method":"mining.authorize","params":["GYf8nyo1c8oWsHzbvL1fD3Ckgg68UzBi5J.w","x"]}' | \
timeout 5 nc -q1 btg.example.com 3333
# Expect: {"id":2,"result":true,"error":null}
A healthy pool accepts both calls in well under a second and immediately pushes mining.notify to subscribed clients.
7. Operations¶
Payouts¶
- PPLNS pool → cron-driven payout script that runs every N hours.
- PPS pool → immediate credit at the time of share acceptance.
- SOLO → only the block-finding miner gets paid; the pool does nothing.
For PPLNS, the payout address is the miner's mining.authorize user. The pool has its own coinbase script that takes the pool fee from each block reward.
Fee structure¶
| Tier | Typical fee |
|---|---|
| PPS | 2–4 % |
| PPLNS | 0.5–1 % |
| SOLO | 0 % (but you keep the whole block reward yourself) |
Monitoring¶
Watch:
- Stale share rate — should be <2 %. Higher means the pool is lagging on
getblocktemplaterefreshes. - Reject rate — should be <1 %. Higher means stale jobs or bugs in the share validator.
- Pool hashrate — 5-minute EMA. Drops signal problems.
- Block-finding rate — actual blocks / expected blocks. Tracks luck.
Troubleshooting¶
"Invalid solution" rejection storm¶
Usually means a bug in the share validator or a configuration mismatch. Check that equihashParameters: "144,5" and personalization: "BgoldPoW" match the network exactly.
"Stratum subscribe" returns null extranonce¶
The pool is misconfigured. Restart the pool backend.
"Connection refused" from your own pool¶
Blocks not being submitted¶
submitblock is failing. Check bgoldd's debug.log:
Common cause: the pool is submitting a block whose coinbase doesn't validate under Bitcoin Gold (BTG)'s rules (e.g. a wrong address version byte). Compare the pool's coinbase script to a known-good block.
What to do next¶
- Stand up a public Bitcoin Gold (BTG) pool with Miningcore + a
nginx+ a front-end likeMiningcore-ui(or build your own). - Expose stats: per-worker hashrate, payout history, network difficulty — see the Blockbook / ElectrumX patterns for inspiration.
- Run an ElectrumX + Blockbook stack alongside the pool so users can check their balance without trusting you.
- Harden the pool host following Hardening.
- Read the Bitcoin Gold (BTG) wiki Technical-Spec to understand the consensus rules your pool must respect.
Source / further reading¶
- BTCGPU/equihash — reference Equihash-Bitcoin Gold (BTG) solver.
- lolMiner — modern Equihash-Bitcoin Gold (BTG) miner.
- miniZ — alternative Equihash miner.
- Stratum mining protocol v1 spec.
- Bitcoin Gold (BTG) Network spec.