Knowing of the difference between HTTP and Stratum mining protocols may be a business of cryptocurrency pool service providers. As a cryptocurrency miner, you may think that you are wasting time reading this article. Actually, there is no wasted time to be wasted in knowing these differences. The knowledge you received will add up your coin mining flight hours to carefully and effectively select the mining pool for your mining machine.
Look backward into some basic definition of HTTP and Stratum protocols, HTTP stands for Hypertext Transfer Protocol (HTTP) which is an application protocol for distributed, collaborative, and hypermedia information systems (Fielding, et al., 1996). To make it clearer, the application was created to help data transfers between web servers and web browser such as Google Chrome, Mozilla Firefox, Internet Explorer, and etc. In these sense, we could say that HTTP has developed for its specific reason of data transferring between network, while mining cryptocurrency needs some specific qualifications. The following condition later introduced the Stratum mining protocol tools.
According to Bitcoinwiki, The stratum protocol was extended to support pooled mining as a replacement for obsolete network protocol in late 2012 (N.A., n.d.). This is because transferring between servers and clients have gone beyond the limitation of what HTTP can do since cryptocurrency mining do more than sending and receiving information. Slushpool.com has an explanation of this complexity into 2 problems as following:
Ntime Rolling: Fast Minter problem.
This is because the development of mining rig efficiency has sharply increased. Nowadays, for every miner’s job receiving, a miner can modify only time and nonce and could say that HTTP is enough for 4.2 GHash/s mining rig which equivalent to a minute time approximately consume until new Bitcoin block arrives. What about 42 GHash/s rig request 10 network at once, and what about 1 THash/s ASIC miners machine? (slushpool.com, 2017) HTTP won’t be able to deal with these problems. For every new miner, it is like you were having a truck that could run 90 MPH on the dirt road. 90 MPH speed means nothing there similar to high-efficiency mining rig on HTTP protocol.
Long-polling is a problem of information lagging sending happened where the server purposely delays sending information until it has something to send. John T (T, 2016) provided an example of when you visited a website “a URL address taking minutes to load because the server is simply waiting for something to happen on its network”. This could create a lot of trouble for miners as miners will request data from the server to get a job, but it is not there yet as we mentioned before.
These 2 problems induced the Stratum protocol invention for lightweight Bitcoin client called Electrum as a prototype, where Stratum is a line-based protocol suing plain TCP socket, with payload encoded as JSON-RPC message. The client simply opens TCP socket and writes requests to the server in the form of JSON message finished by the newline character \n. Every line received by the client is again a valid JSON-RPC fragment which contained the response (slushpool.com, 2017).
One of the first company that started an implementation of Stratum mining protocol was MinerGate. The logic is simple: this is the most efficient protocol. The difference of HTTP and Stratum is similar to the kind of road that we use recently. We have dirt road, street, countryside road, and highway. If you were having a truck and run your logistic business, using dirt road is not a very good idea. The bitcoin price surged urging the mining difficulty since the higher price implied the higher demand for bitcoin both mining and trading with fewer blocks to be solved. The high-efficiency mining rig soon appeared in the market. Meant HTTP protocol would not suit your mining rig as well as if you require the immediate response from the pool server and client machines Stratum protocol is there.