Bitcoin mining may usher in the 3.0 era, Stratum V2 will return power to miners

Bitcoin mining may usher in the 3.0 era, Stratum V2 will return power to miners

In order to obtain a more stable and reliable income stream than solo mining, most Bitcoin miners today choose to mine through mining pools. This is achieved through the open source "Stratum" mining protocol, which is currently used by almost all mining pools and was announced by SlushPool seven years ago.

Now, Braiins, the company behind Slush Pool, has announced plans for the second-generation Stratum protocol (Stratum V2). The Prague-based mining company began this research work two years ago and believes that the second-generation protocol improves the first-generation Stratum protocol in several key aspects:

“It solves historical technical and security issues, is generally more efficient, and allows for some advanced use cases like job selection or easier farm management,” Brains co-CEO Pavel Moravec told Bitcoin Magazine. “This should have been done years ago, really.”

 

The principle of the first generation Stratum mining protocol

 


As a brief supplement, let us first mention the principle of using Stratum V1 for pool mining.

First, mining pool users (sometimes simply called miners) connect their mining computers (usually specialized machines with ASIC chips) to the mining pool, or more specifically, they connect their computers to the computers operated by the mining pool operator.

The mining computer then requests a partial “block template” from the mining pool operator. This partial block template is essentially an incomplete Bitcoin block.

Importantly, the transactions in this block are selected by the mining pool operator. In fact, the transactions themselves are not sent to the miners, but instead, a Merkle path (a series of hashes) of all transactions is sent.

In addition to this, mining pool operators can also choose which “version bits” to include, which may be related to activating soft fork protocol upgrades.

Miners then begin hashing parts of the block template, hoping that one of the hashes will produce a valid block header that satisfies the network’s proof-of-work requirement. If a miner hashes a valid block header, it is returned to the pool operator, who adds it to the rest of the block and broadcasts it to the Bitcoin network. The pool operator then distributes the block reward to each miner in the pool based on the percentage of work they put in. (This is measured by having miners send almost-valid block headers, which are proof that the miner performed work)

Therefore, the adoption of the first generation of the Stratum protocol will give mining pool operators more power than miners. They are not only responsible for allocating rewards, but also decide which transactions are included in the block and which version bits are included. If they want, a mining pool operator can decide to censor certain transactions or block certain protocol upgrades.

The second generation Stratum protocol is inspired by Betterhash

 


Last year, Matt Corallo, an engineer at Chaincode Labs and a Bitcoin Core developer, proposed an alternative mining protocol called BetterHash, and the second-generation Stratum protocol was inspired by BetterHash. Instead of having the pool operator send (part of) the block template to the miners in the pool, the second-generation Stratum protocol allows miners to choose to send the block template to the pool operator. This "job selection" allows miners to choose the transaction and block version themselves.

To do this, Braiins (with help from Matt Corallo) had to solve some practical problems with BetterHash. The most important of these is that it is possible for a miner to mine on an invalid block template (for example, because it contains an invalid transaction). Even if a miner is able to find a valid hash, the block itself is still invalid, and the same miner can still benefit from valid blocks found by other miners.

One solution to this problem is for the mining pool operator to first check whether the miner's block template is valid before putting it into the pool. However, in a large public mining pool, this step will also encounter technical difficulties.

“Imagine what happens when a new block is discovered on the Bitcoin network, and every miner in a mining pool wants to start using a new block template?” Moravec explained. “Each of them could have a slightly different version of the mempool (unconfirmed transactions), and possibly different transaction selection rules… They all want to start mining immediately. Having them all send their block templates to the mining pool for approval would basically be a denial of service attack the first second after a block is discovered by the network. This mechanism needs to be extended to work in practice.”

Braiins solves this problem by letting the mining pool operator asynchronously check the validity of new block templates. As soon as the miner submits a block template, the hashing operation can start immediately. At the same time, the mining pool operator starts checking all block templates.


Moravec added:

“If a block template is later found to be invalid, the reward to the miner can be adjusted accordingly. Thus, the miner has an incentive to work on the appropriate block and provide all the data in a timely manner. He can continue working on his template without delay.”

 

Improved safety, efficiency and flexibility

 


In addition to changes in transaction selection, the second-generation Stratum protocol will include more improvements, some of which may be very important for many miners.

For example, in the first generation of the Stratum protocol, there is no cryptographic data verification to ensure that the miner's computer is truly connected to the pool operator's computer, which opens the door to man-in-the-middle attacks: for example, an attacker can intercept the communication between the miner and the pool operator and trick the miner into working on a block provided by the attacker. The attacker can then pay the block reward of this block to one of his own addresses, effectively "hijacking" the miner's computing power.

The second-generation Stratum protocol resists this attack by allowing mining pool operators to cryptographically sign some block templates. If miners know the public key of the mining pool operator, they can check whether some block templates have valid signatures, thereby determining whether these block templates are indeed provided by the mining pool operator.

Second, the efficiency of the second-generation Stratum protocol will also be higher than the first generation. The reason is that the first-generation Stratum protocol communication is carried out through human-readable text (JSON), while the second-generation Stratum protocol communication is carried out in binary (computer-readable code). Moravec said that coupled with some data elimination in the protocol layer itself, this will reduce the data shared between mining pool operators by 1/2-2/3, making communication faster and cheaper.

Third, the second-generation Stratum protocol has a built-in "multiplexing" mechanism. This means that miners can have independent communication channels on the same connection, allowing their machines to share data about temperature, chip voltage, or how the power supply is working. Mining pools can provide additional services based on this information, or miners can share it with other services or servers.

Fourth, the second-generation Stratum protocol also allows mining pools to "guess" what the next block will be. Whenever a new block is found, it takes a while for the mining pool to determine which transactions are included in the block, and then which transactions cannot be included in the next block. Today, many mining pools wait for a few seconds when mining the next block to ensure that no double-spending transactions are included in the block (otherwise it will invalidate the block).

With the second-generation Stratum protocol, pool operators (or miners who choose their own transactions) can make an educated guess about which transactions will be included based on all the unconfirmed transactions. In the first few seconds, they can start mining what they think may be the valid next block. This efficiency improvement may benefit miners, especially when the block subsidy becomes a small part of the block reward and is eventually replaced by transaction fees.

Areas for improvement

 


Finally, the Braiins team said that there are still some unannounced improvements to the second-generation Stratum protocol. Although the company has a running prototype, the protocol specifications have not yet been finalized.

“We now want to gather feedback, finalize the proposal internally, and then publish a Bitcoin Improvement Proposal (BIP). I imagine that will spark another round of discussion… In the meantime, we will deploy the second generation of the Stratum protocol to SlushPool and release it as part of the beta version of Brains OS, and we are implementing it as quickly as possible so that everyone can participate,” Moravec said.


<<:  Digital currencies of giants: different intentions and ambitions

>>:  A Grin mining machine costs 20,000 US dollars, earning thousands of dollars a day. The battle for Asic mining machines is about to begin.

Recommend

What does Tian Xiang in Ming Palace represent?

In Ziwei Doushu, Tianxiang Star is one of the 14 ...

The impact of seasonal mining fluctuations on Bitcoin

So-called seasonal mining fluctuations on the Bit...

When will people with moles on their hands find love?

Marriage is largely determined by fate, with very...

How to read men's palm lines

There are many palm lines on everyone's palm,...

Triangular eyebrows fortune telling diagram

Characteristics of triangular eyebrows <br /&g...

Is it good for a woman to have a mole on her left cheek? What does it mean?

Is it good for a woman to have a mole on her left...

Fortune telling based on face shape

Everyone's head shape is different. Some peop...

Behind the Crazy Collaboration: YFI Founder’s DeFi Universe

Since announcing the upcoming launch of Yearn Vau...

What does a mole in a man's philtrum mean? He has a great talent for cooking.

Is it good for a man to have a mole in his philtr...

How to read palmistry and analyze financial lines

There are various lines in our palms, and differe...

Miner's Confession: How to Easily Have a Sustainable Income

Warren Buffett once said: If you don’t find a way...

What does it mean to have two symmetrical moles on the back of the neck?

Not everyone has a mole on the back of the neck, ...

What is the fate of a woman with a higher left eyebrow and a lower right eyebrow?

As the saying goes, symmetry creates beauty, but s...