Stratum
Stratum is a communication protocol used between mining hardware (or mining software) and mining pools to efficiently coordinate work distribution and share submission. It replaced older, less efficient protocols and has become the industry standard.
Understanding Stratum
Section titled “Understanding Stratum”Before Stratum, miners used the getwork protocol, which required constant polling of the pool server for new work. This was inefficient and placed heavy load on pool infrastructure. Stratum introduced a push-based model where the pool sends new jobs to miners whenever they become available, and miners submit completed shares back.
Think of Stratum as a factory assembly line communication system. Instead of workers walking to the manager’s office every few seconds to ask “What should I do next?” (getwork), the manager sends instructions directly to each worker’s station whenever there is a new task (Stratum). This is faster and wastes far less time.
The Stratum protocol operates over a TCP connection and uses JSON-RPC formatted messages. Key operations include:
- mining.subscribe: The miner connects and receives session parameters including ExtraNonce1 and ExtraNonce2 size.
- mining.authorize: The miner authenticates with a worker name and optional password.
- mining.notify: The pool sends a new job with the block template data.
- mining.submit: The miner returns a completed share with the nonce and extranonce2 values.
- mining.set_difficulty: The pool adjusts the share difficulty for the miner.
Practical Example
Section titled “Practical Example”When an ASIC miner boots up and connects to a pool at stratum+tcp://pool.example.com:3333, it first subscribes and authorizes. The pool then pushes a mining.notify message containing the previous block hash, coinbase transaction template, Merkle branches, and other data. The miner begins hashing and submits shares via mining.submit whenever it finds a hash below the share difficulty.