Author: Braiins
Source: https://braiins.com/blog/past-and-future-of-bitcoin-mining-protocols-stratum-v2-overview
In this blog post, we'll explore the historical evolution of Bitcoin mining pool network connection protocols to understand how Stratum V2 is shaping the future of Bitcoin mining. "Stratum V2" is the next-generation mining pool protocol, derived from the current Stratum V2 and Betterhash protocols. It improves security, makes data transmission more efficient, and lowers the barrier to entry for mining infrastructure. Furthermore, it allows pool miners to select the transactions they mine, thereby increasing mining decentralization.

The History of Mining Pools and Mining Protocols
Initially, miners had to connect to and interact with the Bitcoin protocol by running a full node.
To standardize communication between miners and the Bitcoin protocol, an open-source "getwork" protocol was developed as a quick and easy solution to help independent miners get started mining. The getwork protocol uses HTTP as a connection method to the Bitcoin protocol. However, HTTP, commonly used on web pages, is not ideal for coordinating peer nodes to mine Bitcoin. Consequently, as mining became more popular, its inefficiencies became increasingly apparent .
By 2012, with the mining industry undergoing significant changes and the network hash rate rapidly increasing, the inefficiency of getwork had become a major problem. It required a significant amount of network bandwidth to be used between miners, and the server (i.e., the mining pool) had to spend an unsustainable amount of bandwidth to support the growing number of miners.
At this point, it was clear that the getwrok protocol was not a scalable solution .
As pooled mining grew in popularity, the limitations of the GetWork protocol became increasingly apparent . This led Marek "Slush" Palatinus, who founded Slush Pool in 2010, to develop the Stratum protocol (Stratum V1) for communication between pools and miners. Since then, Stratum V1 has remained the standard protocol for pooled mining, despite the massive growth of the Bitcoin network and mining industry (from ~10 TH/s to 600 EH/s).
The Current State of Mining Pool Protocols
Stratum (V1) and its criticisms
Stratum V1 has been criticized for being developed in secrecy and then released publicly without a formal BIP describing its implementation. However, it can be argued that Stratum V1 has nothing to do with the Bitcoin protocol or implementation—it is simply a custom pooled mining plugin, and therefore should not require a formal BIP .
Another source of controversy stems from the fact that, during the development of Stratum V1, the community spent several months developing an open-source protocol called " getblocktemplate (BIP22) " to replace the getwork protocol. Almost immediately after the release of Stratum V1, direct adoption of the getblocktemplate protocol began to stall. However, it should be noted that Stratum's servers also use the getblocktemplate protocol behind the scenes, simply adding numerous optimizations around it.
Unfortunately, using the getblocktemplate protocol has a significant drawback: miners lose the ability to construct their own block templates (that is, to choose which transactions to include in their mined blocks) . While this doesn't affect miners' economic incentives, as they are always incentivized to include the transactions with the highest fees in their blocks, it does introduce a vulnerability—the potential for mining pool operators to be hijacked. This is why we're reintroducing the ability for miners to construct their own blocks in Stratum V2.
Slush released the Stratum protocol in 2012 , and a quick browse through the posts will reveal plenty of this kind of criticism.
Finally, there's the issue of security. As Ruben Recabarren points out in his paper " Stratum: A Bitcoin Mining Pool Protocol and Its Enhancements , " Stratum V1 is not immune to potential man-in-the-middle attacks . While there haven't been any notable cases of "hash rate hijacking," it's still possible in lesser-known locations, making it even more crucial for the Bitcoin mining industry to migrate to a more secure protocol. Protecting against hash rate hijacking is another key feature of Stratum V2. While Stratum V1 does an excellent job within its implementation, the Bitcoin network continues to grow, and new developments are constantly emerging within the community .
Matt Corallo's BetterHash proposal
For most of Bitcoin's history, mining pool operators controlled which transactions were included in the blocks they mined. Mining pools assigned tasks to miners, who then submitted proof of work to meet the requirements. This made miners somewhat dependent on the pool's honesty and fairness .
To address the issue of mining pool centralization, Matt Corallo, an engineer at Chaincode Labs (now working at Spiral), proposed a new mining protocol. Matt proposed Betterhash in 2018 as an attempt to update the mining protocol.
Matt Corallo is known for Stratum V2 and BetterHash. He has also worked as a developer at Blockstream, Chaincode Labs, and Square.
The BetterHash mining protocol replaces the getblocktemplate protocol and brings a series of quality improvements for miners. One of the biggest improvements is that miners can construct their own block templates, and mining pools can use these templates to distribute tasks .
BetterHash aims to return power to miners by allowing them to select their own transactions rather than having to accept block templates from mining pools. This provides decentralization by reminding miners that mining pools may censor transactions in uneconomical block constructions.
However, BetterHash had some glitches that made it difficult for mining pools to implement it, so it ultimately never made it past the standardization stage.
Comparing Mining Protocols: Stratum V1, BetterHash, and Stratum V2
Stratum V2 is an improved version of BetterHash and Stratum V1, primarily focusing on efficiency, security, and miner autonomy. It reduces bandwidth usage, speeds up mining communication, and introduces more robust security to prevent man-in-the-middle attacks . Furthermore, it gives miners greater control over transaction selection, something limited in Stratum V1 and somewhat enhanced in BetterHash. These enhancements make Stratum V2 a more optimized, secure, and decentralized mining solution.
Stratum V2 | Stratum V1 | BetterHash | |
---|---|---|---|
Low overhead for miners | :white_check_mark: | :white_check_mark: | |
Mining pool with low overhead | :white_check_mark: | ||
Easy to update the protocol | :white_check_mark: | :white_check_mark: | |
Easy to extend | :white_check_mark: | :white_check_mark: | |
Hash rate hijacking prevention | :white_check_mark: | :white_check_mark: | |
Custom task selection | :white_check_mark: | :white_check_mark: | |
Special Mission Selection Agreement | :white_check_mark: | ||
With firmware implementation | :white_check_mark: | :white_check_mark: | |
Empty block elimination | :white_check_mark: | ||
Instant backend switching | :white_check_mark: |
Stratum V2: The Ultimate Winner of the Mining Pool Protocol
SV2 benefits miners, mining pools, and everyone else
Stratum V2 was launched in 2019 by Braiions founders Pavel Moravec and Jan Čapek, and also combined the efforts of Matt Corallo and other industry experts.
It is both an upgraded version of the Stratum protocol originally used for Bitcoin mining and an evolution of BetterHash.
This new protocol offers multiple benefits: it makes mining more secure, allows for more efficient data transmission and reception, and reduces the need for high-load mining equipment . Furthermore, Stratum V2 gives miners the power to choose which transactions to include in their blocks, helping to decentralize decision-making and Bitcoin mining.
Thanks to these upgrades, Stratum V2 simplifies mining operations, improves security, and encourages a more distributed and decentralized mining ecosystem .
SV2 open source reference implementation
Mining pools like Braiins Pool are actively using the protocol to optimize the mining experience, and development of Stratum V2 has continued in recent years. In March 2024, a group of developers released the official SRI (Stratum V2 Reference Implementation) v1.0, which furthered protocol development and added additional features, taking it beyond the specification established by Braiins founder and Matt Corallo.
We believe SV2 has a bright future and has the potential to revolutionize the mining industry. Stay tuned for the next blog post!
**Contributing to and implementing Stratum V2**
The SV2 movement is growing, with several well-known companies joining. For more information, see this page: https://stratumprotocol.org/
(over)