What is the Stratum V2 Mining Protocol?

Table of Contents

Today, to earn a reliable stream of income, many miners join something called a mining pool. This option has been enabled using the open-source mining protocol that is known as Stratum. Stratum was first designed by Slush Pool about seven years ago, and it has become one of the most popular options today among Bitcoin miners everywhere. The reason why mining pools have become so popular is that this makes it easier for an individual miner to compete. Today, the ability to mine Bitcoin blocks requires a tremendous amount of power that requires specialized hardware. Then, multiple pieces of hardware often work together to generate some reliable income. This is where Stratum comes into play.

Slush Pool, the company behind Stratum, is owned by another company called Braiins. Now, Braiins has put out a second version of Stratum, called Stratum V2. This is the second version of the mining protocol that has become so popular among Bitcoin miners everywhere. This software has been in the works for more than two years. Now, it has finally been released, and it makes several key improvements when compared to the V1 of Stratum. According to the developers, Stratum V2 solves several security issues and historical problems. In general, this version of the software is simply more efficient and can even be used for advanced cases. This includes the management of mining farms and even worker selection. Many of the users are saying that this upgrade should have been done years ago; however, Bitcoin miners everywhere are happy that it is here now. The reality is that the Stratum V2 has the potential to change the way nearly every Bitcoin miner and mining pool operates. Therefore, it is crucial to take a closer look at the Stratum V2 mining protocol and how it makes improvements when compared to its predecessor, the Stratum V1 mining protocol.

A Refresher Course on the Stratum V1 Mining Protocol

First, it is essential to take a refresher course on the Stratum V1 mining protocol. This is one of the first Bitcoin mining protocols to be used by individual miners and pools alike. First, there is something called a hasher. This is the user of the mining pool. Usually, the hasher is referred to as a miner. The miner connects to their mining computer, which is typically a specialized machine that uses something called ASIC chips. Then, this mining computer is connected to the mining pool. After this, the mining computer has to request something called a block template from the operator of the pool. This block template is required to make an incomplete Bitcoin block. It is called incomplete because it doesn’t contain the required Proof of Work that marks it as a valid block. Without this Proof of Work, the Bitcoin block will not be accepted by the chain, and the miner will not receive the transaction fee.

As an important note, the transactions that take place on this block are selected by the operator of the mining pool. The transactions themselves are not sent to the miner. Only the Merkle path, which is a series of hashes, is sent to the miner. Finally, the operator of the pool is the person who chooses which version bit to include. This could matter when it comes to soft fork protocol upgrades down the road.

Once all of this is done, the hasher is the person who goes to work when it comes to the template of the partial block. The goal is to hit on one of the valid block headers, which will establish that the Proof of Work requirement has been met. Should a valid block header be produced, the block will be sent to the mining pool operator. Then, the operator is responsible for adding what is left of the block before sending it out to the Bitcoin network as a whole. Finally, the reward for the block is distributed among all of the participants in the mining pool. The operator is responsible for deciding how much of the transaction fee each user receives. Usually, this is based on the amount of work that has been put in by each hasher. Often, this is measured by having hashers send in their partially complete block templates as proof that they were working.

In this sense, Stratum V1 provided the operator of the mining pool with a powerful position. First, the operator is responsible for deciding which transactions are included in the block. The operator is also the person who sends in the block for validation, making them in charge of everything. Finally, the operator is the person who receives the fee. Then, the operator needs to distribute this fee to everyone else. The operator of the mining pool could, in theory, decide to cut someone out of the distribution or block them totally from certain upgrades. In this manner, the operator of the mining pool occupies one of the most powerful positions when it comes to the Stratum V1 protocol. Now, it is time to take a closer look at the Stratum V2 mining protocol.

The Stratum V2 Mining Protocol Comes from BetterHash

The Stratum V2 mining protocol has been inspired by a proposal that was put forth by Chaincode Labs, BetterHash. Essentially, the Stratum V2 mining protocol takes the Stratum V1 mining protocol and flips it over. Remember that in the first protocol, the operator was responsible for sending block templates to hashers for completion. Now, hashers are responsible for sending block templates to the operator of the mining pool. In essence, the Stratum V2 mining protocol is changing the process of work selection. In this manner, hashers can pick transactions by themselves and choose a block version on which to work. To make this protocol work, Braiins had to integrate BetterHash to solve some of their problems.

Furthermore, there was also the potential for the hasher to be mining an invalid template, which translates to wasted work. Even if the hasher might be able to find a valid hash for their portion of the work, the block would still be deemed invalid. In essence, this would not help the pool at all.

One of the solutions to these problems involved taking the pool operator and having that person check to make sure the block template was valid. On the other hand, in a large pool that might be public, this would lead to significant technical difficulties as well. Think about a single new block being found on the Bitcoin network only to have every hasher wanting to work on that block. This could lead to different transaction selection rules, various unconfirmed transactions, and many people working in parallel instead of working together. Having all of these miners send their block templates back to the pool to get them approved would lead to a tremendous DDOS rate.

So, how did this problem get solved when it comes to the Stratum V2 mining protocol? Braiins worked to solve this problem by having pool operators check the validity of various new block templates asynchronously. As soon as a single miner receives approval from a pool operator, he or she can get to work hashing it. In the meantime, the pool operator is responsible for checking all block templates. If the block template is found to be invalid, the reward for that miner can be adjusted individually. In this manner, the hasher is incentivized using the Stratum V2 mining protocol to provide all of the data regarding the block promptly.

On the other hand, the miner is still free to work on his templates without facing any delays. This is the unique solution posed by the Stratum V2 mining protocol. Now, there are a few other advantages of the Stratum V2 mining protocol to note as well.

The Advantages of the Stratum V2 Mining Protocol

Now, it is time to take a closer look at some of the advantages that come with the Stratum V2 mining protocol. In addition to changing how transactions are selected, the Stratum V2 mining protocol provides several additional improvements. Some of them are going to be critical for Bitcoin miners and hashers.

Now, those who used the Stratum V1 mining protocol likely remember that there was no authentication to make sure that the server that the miner is supposedly using is connected to the server the pool operator is using. This means that there could be an opening for something called a man in the middle attack. In this attack, someone intercepts the communication between the miner and the operator. This could allow the attacker to hijack the hashrate and steal the rewards of the miner.

The way the Stratum V2 mining protocol counters this attack is that the pool operators can cryptographically sign partial block templates. If the hasher knows the public key of the pool operator, they can check that the partial block template comes with a valid signature. This lets the hasher understand that the block came from an actual pool operator.

Furthermore, the Stratum V2 mining protocol is far more efficient than its predecessor—the Stratum V1 mining protocol communicated using text that is readable by the miner (JSON). In contrast, the Stratum V2 mining protocol communicates using binary code. Combined with the elimination of some data on the level of the protocol, this means that communications between pool operators and hashers could be cut in half, which means that communications are faster and cheaper.

Besides, the Stratum V2 mining protocol includes a built-in method that can be used for something called multiplexing. In this manner, hashers will have access to independent communication channels even though they might use the same connections. This means that miners can have their machines share data on their power supplies, temperatures, and more. Mining pools could provide extra services using this information. Also, the hasher might be able to share this information with another server or service. In this manner, the Stratum V2 mining protocol is expanding the array of services offered by the protocol, placing it a cut above its predecessor.

Furthermore, the Stratum V2 mining protocol also lets the pools guess as to what the next block might be. Whenever the pool finds a new block, it always takes a minute for the pool to figure out which transactions were included in that block. They do not include any transactions for several seconds. They do this to make sure they do not include a double-spend. This process is eliminated using the Stratum V2 mining protocol. In this protocol, pool operators can make an educated guess about the transactions that will be included in the next block. This is based on all of the unconfirmed transactions. In the first few seconds, they have a head start on the next block because of these guesses. This means that the next block might be completed more quickly. Less time per block means more blocks solved, leading to more money for the pool.

In this manner, the main improvements of the Stratum V2 mining protocol include security, flexibility, and efficiency. Security is improved because the Stratum V2 mining protocol eliminates the possibility of something called a man in the middle attack. Flexibility is improved because of the new communication channels and the various data that can be sure using the Stratum V2 mining protocol. Finally, efficiency is enhanced because the mining pool might get a head start on the next block using the Stratum V2 mining protocol. While these advances are impressive, there are even more improvements that could be made on the Stratum V2 mining protocol.

There Are Future Improvements To be Made on the Stratum V2 Mining Protocol

While the improvements that have been made so far with the new mining protocol are undoubtedly impressive, the creators have announced that there are going to be more improvements in the future. Right now, the company is not running a prototype. The specification of the protocol has not yet been announced.

For now, the company is in the middle of collecting feedback from numerous people to make sure the proposal has been finalized before it is published. This will lead to another round of discussions while the Stratum V2 is deployed to Slush Pool. While the company is working as fast as possible, they know that more improvements have to be made.

Without a doubt, this new mining protocol has the potential to change just about everything when it comes to the world of Bitcoin mining. This means that blocks could be solved faster, providing a more reliable income stream to everyone who counts on Bitcoin mining as a way to support themselves.

Share the Post:

Disclaimer: The information provided on this blog is for informational purposes only and should not be taken as any form of advice.

Related Posts