Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting Started

The stratum proxy is an aggregating mining proxy. It accepts Stratum V1 and/or Stratum V2 miners downstream, opens a single Stratum V2 extended channel to an upstream pool, turns the pool’s jobs into jobs for its own miners, and forwards qualifying shares upstream.

This page takes you from nothing to miners hashing through the proxy. Each step links to the full reference when you need more detail.

Before you start

You need:

  • An x86-64 Linux host with Docker, reachable by your miners.
  • From the pool operator:
    • the proxy image name,
    • the pool’s Stratum V2 address (host:port),
    • the pool’s authority public key,
    • your pool account name.
  • Accurate clocks. Run NTP on the proxy host and on your miners. Stratum V2 encryption rejects certificates from a peer whose clock is more than 10 seconds off. See How the proxy’s encryption works.
  • Network access: outbound from the proxy host to the pool address, and inbound from your miners to the proxy’s miner ports (3333 for Stratum V1 and 3336 for Stratum V2 in the examples below). Do not expose the miner ports to the internet.

1. Generate the proxy’s authority keypair

Skip this step if you will only connect Stratum V1 miners.

Stratum V2 miners authenticate the proxy with a keypair that you generate:

cargo install key-utils
key-utils-bin

It prints a Secret Key and a Public Key. You need both in the next step, and you configure your Stratum V2 miners with the public key in step 5. Keep the secret key private. See Generating the proxy’s authority keypair.

2. Write the config file

Save this as stratum-proxy.toml and replace each <...> value:

[logger]
log_level = "INFO"

[network]
listen_address = "0.0.0.0"
listen_port_sv1 = 3333          # Stratum V1 miners
listen_port_sv2 = 3336          # Stratum V2 miners
# The proxy's own Noise identity, presented to downstream SV2 miners.
authority_public_key = "<PROXY_AUTHORITY_PUBLIC_KEY>"
authority_secret_key = "<PROXY_AUTHORITY_SECRET_KEY>"

[difficulty]
submit_interval_secs = 25.0
initial_hashrate_ths = 45.036       # starting difficulty 2^18

# Optional liveness endpoint; see [health] below.
# [health]
# port = 8080

[upstream]
user_identity = "<your-pool-account>"

[[upstream.endpoints]]
address = "<pool-host>:<pool-sv2-port>"
authority_pubkey = "<POOL_AUTHORITY_PUBLIC_KEY>"
max_job_delay_secs = 60
  • authority_public_key and authority_secret_key are the keypair from step 1. For a Stratum V1 only proxy, remove them and listen_port_sv2.
  • user_identity is your pool account. address and authority_pubkey are the pool’s address and key.
  • Set initial_hashrate_ths to the hashrate of your smallest miner. Vardiff adjusts each miner from there.

Every other setting can stay at its default. See Configuration for all of them.

3. Start the proxy

From the directory that holds stratum-proxy.toml:

docker run -d --name stratum-proxy --restart unless-stopped \
  --ulimit nofile=65535:65535 \
  --log-driver json-file --log-opt max-size=20m --log-opt max-file=1250 \
  -p 3333:3333 -p 3336:3336 \
  -v $(pwd)/stratum-proxy.toml:/config/stratum-proxy.toml:ro \
  <image>

Replace <image> with the image name the pool operator gave you.

  • --ulimit nofile lets the proxy hold many miner connections open at once.
  • The --log-opt settings cap how much log history Docker keeps.
  • The -p ports must match listen_port_sv1 and listen_port_sv2 in your config.
  • The config file is mounted read-only at /config/stratum-proxy.toml, where the image expects it.

4. Check that it connected to the pool

docker logs -f stratum-proxy

Within a few seconds you should see these events, in this order:

  1. Listening on TCP: once for each miner port.
  2. Connecting to upstream pool
  3. Upstream SetupConnection success
  4. Upstream channel opened

Until the pool channel is open, the proxy turns miners away. If you see Upstream connection ended instead, its error field says why. See Reading the error on Upstream connection ended.

5. Point your miners at the proxy

Miner protocolPool URLAlso configure
Stratum V1stratum+tcp://<proxy-host>:3333—
Stratum V2<proxy-host>:3336The proxy’s authority public key from step 1.

For the worker name, use <name>.<worker>, for example site1.rack4-s19. The proxy uses it to identify each miner in its logs. Every share reaches the pool through the proxy’s own channel, under the user_identity account in your config.

When a miner connects, the proxy logs Incoming connection, then subscribe success, then authorize success. If a miner does not get that far, see Miner connections.

Next steps

  • Configuration: every setting, including failover to backup pool endpoints and the optional health endpoint.
  • Troubleshooting and Logs: what every log line means, and how to recognise tampering and interception.