By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.
Mining Software

Past and future of bitcoin mining protocols: Stratum V2 overview

In this blogpost, we will delve in the history and evolution of the mining connection protocols to understand how Stratum V2 is shaping the future of mining. Stratum V2 is the next-generation protocol for pooled mining. It is the evolution of the current Stratum V1 and Betterhash protocols. It increases security, makes data transfers more efficient, and reduces mining infrastructure requirements. Additionally, it lets miners select transaction sets and improves decentralization.

Published on Apr 10, 2024
START READING
Published on Apr 10, 2024

Table of Contents

History of mining pools and protocols

In the early days of bitcoin mining, miners had to connect and interact with the bitcoin protocol itself by running full nodes. 

To standardize the communication between miners and Bitcoin protocol, an open-source “getwork” protocol was used as a quick and easy solution for standalone miners to start mining. The getwork protocol utilized HTTP as a method to connect with the bitcoin protocol. However, HTTP is typically used for web pages, and it was not ideal for coordinating peers to mine bitcoin. Thus, many inefficiencies became apparent as mining grew more popular. 

By 2012, getwork’s inefficiencies had grown very problematic as mining underwent radical changes and network hashrate grew exponentially. This required a considerable amount of network bandwidth on the miner side and a practically infeasible amount of bandwidth on the server (i.e. pool) side to facilitate the increase in miner participation. 

At this point, it was quite clear that the getwork protocol was not a scalable solution. 

The limitations of the getwork protocol became even more apparent as pooled mining grew in popularity. This led Marek "Slush" Palatinus, who created Slush Pool in 2010, to develop the stratum protocol (Stratum V1) for communication between miners and pools. This has since been the standard protocol for pooled mining, withstanding tremendous growth in the bitcoin network (~10 TH/s to 600 EH/s).

The current state of the mining protocol

Stratum (V1) and its criticism

Stratum V1 was criticized for being initially developed as a secret to the public as no formal BIP was used to describe its implementation. However, it was argued that Stratum V1 is not related to the Bitcoin protocol or implementation — rather it is a custom pooled mining extension, which shouldn’t require an official BIP.

Another source of controversy was that, while Stratum V1 was being developed, the community had spent months developing an open-source protocol called “getblocktemplate“ (BIP22) that would supersede the “getwork” protocol. With Stratum V1 being released near the same time, direct adoption for the getblocktemplate protocol suffered. However, it should be noted that the Stratum servers use a getblocktemplate mechanism under the surface, while simply adding a lot of other improvements around it. 

Unfortunately, the one significant downside of not using the getblocktemplate solution was that miners lost the ability to construct their own block templates (i.e. choose which transactions are in the blocks they mine.) Although this doesn’t harm the economic incentives of mining at all because miners are all incentivized to include the highest fee transactions in their blocks, it does introduce a vulnerability if pool operator(s) were to be compromised. This is why we are reintroducing the ability for miners to construct their own blocks in Stratum V2.

Slush announced the protocol in 2012, and a quick scroll through the conversation reveals many of these critiques.

Finally, there’s the matter of security. As Ruben Recabarren pointed out in his paper, Hardening Stratum, the Bitcoin Pool Mining Protocol, Stratum V1 is vulnerable to possible man-in-the-middle attacks. Although no significant cases of "hashrate hijacking" have been reported, it's possible that they can occur undetected, making it all the more critical that the bitcoin mining industry moves on to a more secure protocol. Hashrate hijacking prevention is another key feature of Stratum V2.
Stratum V1 did a great job since its implementation, but the bitcoin network has grown exponentially, and new developments constantly come out from the community.

BetterHash proposal by Matt Corallo

For most of bitcoin’s history to this point, pool operators have been in control of which transactions end up in the blocks that get mined. Pools provide miners with work (job assignments) and the miners submit the completed work back to the pools. This has made miners somewhat dependent on pools to act honestly and fairly.

In order to address this mining pool centralization issue, a new mining protocol was specified by then Chaincode Labs (now Spiral) engineer, Matt Corallo. Matt first proposed Betterhash in 2018 as an attempt to modernize the mining protocol. 

Matt Corallo is a famous developer known for Stratum V2 and BetterHash. He’s also done development work for Blockstream, Chaincode Labs, and Square.

BetterHash mining protocol superseded the getblocktemplate protocol and brought along a host of quality improvements for miners. One of the largest improvements was the ability for pools to accept work from miners who constructed their own block templates.

Its intent was to shift the power back to the miners by giving them control in choosing their own transaction sets, rather than receiving block templates from the mining pools. This increases decentralization by alerting miners whenpools may censor transactions on uneconomic block construction. 

However, BetterHash had some flaws which made it difficult to implement for pools, so it ultimately never advanced beyond the specification phase.

Comparing bitcoin mining protocols: Stratum V1, Better Hash, Stratum V2

Stratum V2 is an advancement over BetterHash and Stratum V1, primarily for its efficiency, security, and miner autonomy. It reduces bandwidth usage, speeding up mining communications, and introduces stronger security to prevent man-in-the-middle attacks. Additionally, it grants miners greater control over transaction selection in block mining, a capability limited in Stratum V1 and only somewhat improved by BetterHash. These enhancements make Stratum V2 a more optimized, secure, and decentralized mining solution.

Stratum V2 - the mining protocols endgame

SV2 benefits miners, pools, & everyone else

Stratum V2 was developed in 2019 by the Braiins founders Pavel Moravec and Jan Čapek, in collaboration with Matt Corallo and other industry experts.

It is both an upgraded version of the original Stratum protocol used for bitcoin mining and an evolution of Betterhash. 

This new protocol offers a number of benefits: it makes mining more secure, allows for data to be sent and received more efficiently, and reduces the need for heavy-duty mining equipment. Additionally, Stratum V2 gives miners the power to choose which transactions they include in a block, helping to spread out decision-making and support decentralization in bitcoin mining. 

Thanks to these updates, Stratum V2 simplifies the mining process, increases safety, and encourages a more distributed and decentralized approach to mining.

SV2 Open Source Reference Implementation

Some mining pools, like Braiins Pool, are actively using this protocol to enhance the mining experience, and the development of Stratum V2 has continued unabated in recent years. In March 2024, a group of developers released the official SRI (Stratum V2 Reference Implementation) v1.0 version of the protocol, furthering the work on the protocol and developing additional features beyond the specifications created by Braiins' founders and Matt Corallo.

We believe that SV2 has a bright future and holds the potential to innovate and revolutionize the mining industry. In the meantime… see you in the next blog post!

Contribute and implement Stratum V2

The SV2 movement grows stronger every day, several prominent companies are on board. Visit the website of the open-source initiative and join today https://stratumprotocol.org 

KonferenceWebXWhereWhenConfirmed
Cell
CellCellCell
Cell
CellCellCell
Cell
CellCellCell
Cell
CellCellCell
Cell
CellCellCell
Cell
CellCellCell
Cell
CellCellCell

You can view the changelog also in our documentation.
See the full changelog

Get notified when we release new update

By subscribing you are agreeing to our Privacy Policy
Wohoo! You're subscribed, we'll be in touch soon.
Something went wrong. Please try again.
Share now

About Braiins

Bitcoin mining software company: Braiins Pool, Braiins OS & Stratum V2.

By miners, for miners.

Past and future of bitcoin mining protocols: Stratum V2 overview

Mining Software

Published

10.4.2024

In this blogpost, we will delve in the history and evolution of the mining connection protocols to understand how Stratum V2 is shaping the future of mining. Stratum V2 is the next-generation protocol for pooled mining. It is the evolution of the current Stratum V1 and Betterhash protocols. It increases security, makes data transfers more efficient, and reduces mining infrastructure requirements. Additionally, it lets miners select transaction sets and improves decentralization.

Table of Contents

History of mining pools and protocols

In the early days of bitcoin mining, miners had to connect and interact with the bitcoin protocol itself by running full nodes. 

To standardize the communication between miners and Bitcoin protocol, an open-source “getwork” protocol was used as a quick and easy solution for standalone miners to start mining. The getwork protocol utilized HTTP as a method to connect with the bitcoin protocol. However, HTTP is typically used for web pages, and it was not ideal for coordinating peers to mine bitcoin. Thus, many inefficiencies became apparent as mining grew more popular. 

By 2012, getwork’s inefficiencies had grown very problematic as mining underwent radical changes and network hashrate grew exponentially. This required a considerable amount of network bandwidth on the miner side and a practically infeasible amount of bandwidth on the server (i.e. pool) side to facilitate the increase in miner participation. 

At this point, it was quite clear that the getwork protocol was not a scalable solution. 

The limitations of the getwork protocol became even more apparent as pooled mining grew in popularity. This led Marek "Slush" Palatinus, who created Slush Pool in 2010, to develop the stratum protocol (Stratum V1) for communication between miners and pools. This has since been the standard protocol for pooled mining, withstanding tremendous growth in the bitcoin network (~10 TH/s to 600 EH/s).

The current state of the mining protocol

Stratum (V1) and its criticism

Stratum V1 was criticized for being initially developed as a secret to the public as no formal BIP was used to describe its implementation. However, it was argued that Stratum V1 is not related to the Bitcoin protocol or implementation — rather it is a custom pooled mining extension, which shouldn’t require an official BIP.

Another source of controversy was that, while Stratum V1 was being developed, the community had spent months developing an open-source protocol called “getblocktemplate“ (BIP22) that would supersede the “getwork” protocol. With Stratum V1 being released near the same time, direct adoption for the getblocktemplate protocol suffered. However, it should be noted that the Stratum servers use a getblocktemplate mechanism under the surface, while simply adding a lot of other improvements around it. 

Unfortunately, the one significant downside of not using the getblocktemplate solution was that miners lost the ability to construct their own block templates (i.e. choose which transactions are in the blocks they mine.) Although this doesn’t harm the economic incentives of mining at all because miners are all incentivized to include the highest fee transactions in their blocks, it does introduce a vulnerability if pool operator(s) were to be compromised. This is why we are reintroducing the ability for miners to construct their own blocks in Stratum V2.

Slush announced the protocol in 2012, and a quick scroll through the conversation reveals many of these critiques.

Finally, there’s the matter of security. As Ruben Recabarren pointed out in his paper, Hardening Stratum, the Bitcoin Pool Mining Protocol, Stratum V1 is vulnerable to possible man-in-the-middle attacks. Although no significant cases of "hashrate hijacking" have been reported, it's possible that they can occur undetected, making it all the more critical that the bitcoin mining industry moves on to a more secure protocol. Hashrate hijacking prevention is another key feature of Stratum V2.
Stratum V1 did a great job since its implementation, but the bitcoin network has grown exponentially, and new developments constantly come out from the community.

BetterHash proposal by Matt Corallo

For most of bitcoin’s history to this point, pool operators have been in control of which transactions end up in the blocks that get mined. Pools provide miners with work (job assignments) and the miners submit the completed work back to the pools. This has made miners somewhat dependent on pools to act honestly and fairly.

In order to address this mining pool centralization issue, a new mining protocol was specified by then Chaincode Labs (now Spiral) engineer, Matt Corallo. Matt first proposed Betterhash in 2018 as an attempt to modernize the mining protocol. 

Matt Corallo is a famous developer known for Stratum V2 and BetterHash. He’s also done development work for Blockstream, Chaincode Labs, and Square.

BetterHash mining protocol superseded the getblocktemplate protocol and brought along a host of quality improvements for miners. One of the largest improvements was the ability for pools to accept work from miners who constructed their own block templates.

Its intent was to shift the power back to the miners by giving them control in choosing their own transaction sets, rather than receiving block templates from the mining pools. This increases decentralization by alerting miners whenpools may censor transactions on uneconomic block construction. 

However, BetterHash had some flaws which made it difficult to implement for pools, so it ultimately never advanced beyond the specification phase.

Comparing bitcoin mining protocols: Stratum V1, Better Hash, Stratum V2

Stratum V2 is an advancement over BetterHash and Stratum V1, primarily for its efficiency, security, and miner autonomy. It reduces bandwidth usage, speeding up mining communications, and introduces stronger security to prevent man-in-the-middle attacks. Additionally, it grants miners greater control over transaction selection in block mining, a capability limited in Stratum V1 and only somewhat improved by BetterHash. These enhancements make Stratum V2 a more optimized, secure, and decentralized mining solution.

Stratum V2 - the mining protocols endgame

SV2 benefits miners, pools, & everyone else

Stratum V2 was developed in 2019 by the Braiins founders Pavel Moravec and Jan Čapek, in collaboration with Matt Corallo and other industry experts.

It is both an upgraded version of the original Stratum protocol used for bitcoin mining and an evolution of Betterhash. 

This new protocol offers a number of benefits: it makes mining more secure, allows for data to be sent and received more efficiently, and reduces the need for heavy-duty mining equipment. Additionally, Stratum V2 gives miners the power to choose which transactions they include in a block, helping to spread out decision-making and support decentralization in bitcoin mining. 

Thanks to these updates, Stratum V2 simplifies the mining process, increases safety, and encourages a more distributed and decentralized approach to mining.

SV2 Open Source Reference Implementation

Some mining pools, like Braiins Pool, are actively using this protocol to enhance the mining experience, and the development of Stratum V2 has continued unabated in recent years. In March 2024, a group of developers released the official SRI (Stratum V2 Reference Implementation) v1.0 version of the protocol, furthering the work on the protocol and developing additional features beyond the specifications created by Braiins' founders and Matt Corallo.

We believe that SV2 has a bright future and holds the potential to innovate and revolutionize the mining industry. In the meantime… see you in the next blog post!

Contribute and implement Stratum V2

The SV2 movement grows stronger every day, several prominent companies are on board. Visit the website of the open-source initiative and join today https://stratumprotocol.org 

on social media

Be the first to know!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

BECOME A PUBLISHED AUTHOR

Browse books

Share article

Be the first to know!

Get updates about our new mining content, product updates & more.
Thank you! Your submission has been received!

Read Privacy Policy.

Oops! Something went wrong while submitting the form.
We apologize but our blog is available only in English, Spanish and Russian.