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.
We apologize but our blog is available only in English, Spanish and Russian.
阶层Stratum V2协议

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. 

到了2012年,随着挖矿行业的巨变,网络算力呈指数倍增长,getwork协议的低效成了非常棘手的问题。它要求矿工要有相当大的网络带宽,而要服务器(即矿池)方面也有能满足所有矿工的带宽增长并不现实。 

在这点上,getwork协议很明显不是一个可持续的解决方案。 

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.

另一个引起争议的原因是,在开发阶层Stratum V1协议的同时,比特币社群花了几个月时间开发名为"getblocktemplate"(BIP22)的开源协议,该协议本该取代"getwork"协议。但随着阶层Stratum V1协议的几乎同时发布,getblocktemplate协议的直接采用受到影响。不过,需要指明的是,阶层协议的服务器其实也使用了getblocktemplate协议的机制,并在其之上做了不少改进。 

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. 

然而,BetterHash协议存在一些缺陷,难以在矿池上投入实用,最终只停留在理论阶段。

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.

Still scrolling?
Keep reading!

The Basics of Building a Bitcoin Mining Greenhouse

阶层Stratum V2协议

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.

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. 

到了2012年,随着挖矿行业的巨变,网络算力呈指数倍增长,getwork协议的低效成了非常棘手的问题。它要求矿工要有相当大的网络带宽,而要服务器(即矿池)方面也有能满足所有矿工的带宽增长并不现实。 

在这点上,getwork协议很明显不是一个可持续的解决方案。 

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.

另一个引起争议的原因是,在开发阶层Stratum V1协议的同时,比特币社群花了几个月时间开发名为"getblocktemplate"(BIP22)的开源协议,该协议本该取代"getwork"协议。但随着阶层Stratum V1协议的几乎同时发布,getblocktemplate协议的直接采用受到影响。不过,需要指明的是,阶层协议的服务器其实也使用了getblocktemplate协议的机制,并在其之上做了不少改进。 

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. 

然而,BetterHash协议存在一些缺陷,难以在矿池上投入实用,最终只停留在理论阶段。

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 

Get notified when we release new update

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

By subscribing you agree with Privacy Policy

Share article