- Crypto mining pools are becoming centralized through the Stratum mining protocol’s predefined rule set and block templates.
- “Over Stratum you get the block templates, you get information about how to build the coinbase and also information representing all of the transactions in the block. This means that end user miners have largely no control over what they’re mining on,” said Bitcoin Core Developer Matt Corallo in a recent interview.
- BetterHash protocol gives power back to miners to make their own rule sets and block templates, fostering decentralized mining.
A Bitcoin Core Developer – Matt Corallo – has created a new mining protocol designed to ensure that mining remains decentralized. He dubbed the project the “BetterHash Mining Protocol.” Centralization remains a core issue within the Bitcoin community, with four of the top five mining pools located in China. These four Chinese mining pools wield the majority of the network hash rate – a problem for a supposedly decentralized network. The current mining pools run a protocol called Stratum and it’s this protocol that causes most of the centralization concerns.
What Is Stratum?
Stratum is essentially the protocol that lets a mining rig talk to the mining pool and receive new work while sending completed blocks back to the pool. Stratum started out life as part of the lightweight Bitcoin wallet known as Electrum. Shortly after its implementation in Electrum, developers soon realized that the protocol had similar requirements to Bitcoin mining.
So, how does it work? It uses a line-based protocol to transmit messages back and forth between users, perfect for sending and receiving payments in a wallet – like Electrum. It also carries uses in mining when sending requests and receiving data. It utilizes a language called JSON (don’t worry, it’s super simple), which is widely used throughout the Bitcoin network, meaning it was practical to implement in both wallets and mining pools.
Stratum uses a set of templates and rules that the pool admins control. Even if a mining rig is owned by a private individual – such as yourself – you are mining according to the pool’s rules and wishes, not necessarily your own. This is potentially problematic as it creates an unknowingly centralized network of mining rigs all working to fulfil the wishes of the pool administrators.
When you visit a website and send sensitive information – such as your banking details – the website is required to have an SSL certificate. This means the data sent between your device and the website server is encrypted. If it’s unencrypted, hackers can intercept these data packets and get hold of all your personal information – something that nobody wants.
Stratum uses simple TCP sockets, meaning the data being transmitted between your mining rig and the mining pool isn’t encrypted. Hackers have a variety of options to potentially take over the Bitcoin mining pool or steal a nearly unlimited amount of BTC. Hackers could either inject the incoming work request with false information – meaning you create a hash with false transactions or possible double spends of Bitcoin. Or, they can simply send you their own work requests, meaning your mining power is being hijacked by a third party and you won’t see any mining rewards. However, there are measures in place to prevent this from happening, so don’t panic. If you want to learn more about these measures, “Hardening Stratum, the Bitcoin Pool Mining Protocol” by Ruben Recabarren and Bogdan Carbunar makes for an interesting read.
In addition to this hijacking of hash power potential, Stratum is essentially very inefficient, meaning there is a lot of wasted network traffic. When a mining rig is active, it will constantly request more data and work from the pool. Now, when there isn’t much work around, most of these requests will fail, and this takes up a lot of bandwidth on both the miner’s and pool’s side. The more bandwidth taken up, the slower the internet connection becomes at both ends, which in turn slows down the mining confirmation process.
Stratum Isn’t as Decentralized as We Are Led to Believe
Running the Stratum protocol in the mining pool you are part of enables the pool admins to control your rig and decide what you mine. While this is great for people with little to no knowledge of how to configure and operate their mining rig, it creates issues with decentralization.
Manufacturing a murky situation whereby one mining pool could quite easily gain 51% of the network hash rate and inflict untold madness upon the network is a possibility. While pools have reached the 51% threshold before – such as Ghash back in 2014 – it didn’t create much more than murmur at the time. While one rogue employee did double spend a small amount of Bitcoin, Ghash’s majority control of the network hash rate was uneventful, causing just a little bit of negative sentiment in Bitcoin’s value. Bitmain has been creeping close to 51% of the network hash rate, but it has now begun to lose control and has now fallen to more acceptable levels.
The issue with pools controlling 51% of the network hash rate – or more – comes from the fact there are so many potential bad parties who could abuse the related power. This would give all the miners in the pool the ability to double spend Bitcoin, rewrite Bitcoin history, or even steal an unlimited number of Bitcoins. This is a terrifying scenario and is the exact reason why decentralization is critical to Bitcoin’s survival.
So, do we have anything else to worry about? The risks in corporate-owned pools are slightly different, but are still there. For example, if a bad party manages to hack a mining firm – such as Bitmain – they could then take control of Bitmain’s entire hash power for quite some time. Another issue with corporate mining pools is natural disasters. Just this weekend the Bitcoin network hash rate collapsed by nearly 13 million TH/s due to mines being flooded.
How BetterHash Addresses the Decentralization Issue
Corallo has created two new protocols called “Work” and “Pool”, known collectively as “BetterHash”. This new system will allow individual miners to choose which transactions they include in blocks, rather than having mining pools decide this for them. This gives individual miners more freedom and autonomy, thus increasing decentralization in the mining process.
With Stratum, miners can still opt to include the transactions they want in blocks – known as creating their own templates – but large pools dislike this and won’t let these miners join. The larger pools prefer to prescribe the block templates to its miners for consistency, but this creates a centralized mining network.
BetterHash essentially prevents pool operators from using their position to tell miners whether they should adopt network upgrades or not. With miners having more control over the block templates, there is less chance of a government ordering a locally-operated mining pool to censor particular types of transactions.
To this extent, BetterHash creates a decentralized mining network where miners have both power and freedom. It will also help the total network hash rate increase while mitigating risks of 51% attacks on the network. Under the BetterHash protocol, miners will have the ability to chop and change between pools at their own discretion and with greater ease than before.
BetterHash is still being worked on and perfected, Corallo himself admitted in a tweet that it still contains major DoS vulnerabilities – but he is known to be working on these issues. You can follow the development of BetterHash on his GitHub and even download a copy to test it out for yourself. If you are really invested in pushing BetterHash forward you even help make history by contributing to the project!
Finally published a draft of the mining protocols I’ve been working on for a while today. Lots of potential to make mining more effecient, more secure, and more decentralized. https://t.co/0YbG7mKAhW Also discussions at https://t.co/xEfF7pPJk4 and https://t.co/ON8eTWT0jp
— Matt Corallo (@TheBlueMatt) 5 June 2018