Hash Rate & Blockchain

Hash Rate & Blockchain

By GROUNDx | collaborative economy | 7 May 2020


 

Hello! Today we are going to talk a little bit about the "HASH RATE & BLOCKCHAIN"
The hash rate is one of the most important concepts in the world of cryptocurrencies. This mentions the numerical value within each cryptocurrency that the Proof of Work (PoW) uses.

We all know that the hash rate is a unit of measure, well, what does it actually measure? The hash measures the processing power of the Bitcoin network. If the Bitcoin network reaches a hash rate of 5TH / s it means it can do 5 trillion calculations per second.
So we can say that a hash rate is like the speed at which a machine operates. These machines have to make thousands and thousands of possible answers to the "puzzles" that each block represents to be solved.
Each block has a heading, this heading is known as "NONCE", this nonce is hidden and is a random number.
It is revealed when the problem is solved to validate the block.
The nonce is a nonsense number that can be changed as many times as you like so you can check many different hashes and see if they pass the network difficulty check.

NONCE (32bit)
// const Block = require("./Block.js");
// const crypto = require("crypto");

// class Blockchain {
  // constructor() { ... }
  // get() { ... }
  // get latestBlock() { ... }
  // isValidHashDifficulty(hash) { ... }
  // calculateHashForBlock(block) { ... }
  // calculateHash(...) { ... }
  // mine(data) { ... }

  generateNextBlock(data) {
    const nextIndex = this.latestBlock.index + 1;
    const previousHash = this.latestBlock.hash;
    let timestamp = new Date().getTime();
    let nonce = 0;
    let nextHash = this.calculateHash(
      nextIndex,
      previousHash,
      timestamp,
      data,
      nonce
    );

    while (!this.isValidHashDifficulty(nextHash)) {
      nonce = nonce + 1;
      timestamp = new Date().getTime();
      nextHash = this.calculateHash(
        nextIndex,
        previousHash,
        timestamp,
        data,
        nonce
      );
    }

    const nextBlock = new Block(
      nextIndex,
      previousBlock.hash,
      nextTimestamp,
      data,
      nextHash,
      nonce
    );

    return nextBlock;
  }
// };

// module.exports = Blockchain;


A hash is the mathematical way of converting any data set into a random number and in the bitcoin network so that its blocks are validated, not any hash is worth, it has to be below the target. The network adjusts the difficulty with which this hash can be found, so that if there are few people mining, and few transactions, mining becomes easier and if there are many people mining it becomes more difficult. In this way, a block production rate can be maintained in an average time of 10 minutes for each block.

700aa720d3847b0ed596c36055d8e46b7b2920c0acb5835130d73d1f39e02d12.png
Properties of a hash:
Hash has a fixed length.
Same data always maps to same hash.
Different data always maps to a different hash (within practical limitations).
Is easy to compute.
Is infeasible to convert hash to data.
A small change in data leads to a large change in hash

A valid hash for a blockchain is a hash that meets a certain requirement. For this blockchain, having three zeros at the beginning of the hash is the requirement for a valid hash.The number of leading zeros required is the difficulty. SHA256 is the hash function that backs Bitcoin PoW mining.

In this graph we see how in the last year the difficulty of the network has increased
7965f521dc2cf2f24c43a07badbd25952b48885109ea65181e4b66f6bdcaccc4.png



We already know that the first block is called GENESIS, and here is the information that is stored in each block:
Index The genesis block has and index of 0, the next block will have an index 1
Timestamp It is a record of when the block was created. This helps to keep the blockchain in order 
Hash  A hash looks like a bunch of random numbers and letters. It is a alphanumeric value that uniquely identifies data, or the "digital fingerprint" of data.
Previous Hash A valid hash for a blockchain is a hash that meets a certain requirement. For this blockchain, having three zeros at the beginning of the hash is the requirement for a valid hash. The number of leading zeros required is the difficulty.
Data  Each block can store data against it. In cryptocurrencies such as Bitcoin, the data would include money transactions.
Nonce  The nonce is the number used to find a valid hash. To find a valid hash, we need to find a nonce value that will produce a valid hash when used with the rest of the information from that block.

We know that two of the main characteristics that BLOCKCHAIN has are:
It is immutable, once a transaction is validated and saved in a blockchain, IT CANNOT BE MODIFIED.
It is Distributed: The entire history of transactions from the first generated block (the “genesis block”) is replicated in all the nodes of the blockchain network and in a perpetual way (which is why it can become expensive)
And here the code of the GENESIS block.

const Block = require("./Block.js");

class Blockchain {
  constructor () {
    this.blockchain = [Block.genesis()];
  }

  get() {
    return this.blockchain;
  }

  get latestBlock() {
    return this.blockchain[this.blockchain.length - 1];
  }
};

module.exports = Blockchain;

 

A brief introduction we have seen, now we are going to see why the Bitcoin network is the safest, in part, it is the safest because it is the one that best cares for its miners or groups of miners, even having the time of 10min per hole, very far from the 2.5min of time that a litecoin block requires. In the long run, the chain becomes more secure the more confirmations that transaction has made. The first confirmation may not be the fastest in Bitcoin, but the following confirmations in other chains are much slower.


In this graph I show you the $ that the miners of the Bitcoin blockchain receive, daily the miners receive a salary that the bitcoin protocol offers, in this way the Bitcoin network is protected, in addition to the rewards that the miners will receive in the future.
16b42c7458805cddee6bbf7ec9b1b8ad2cbf743a1bdf750866be6674acfb7f05.png

What I want you to understand is that in Bitcoin, the first confirmation takes 10min, the second confirmation would be 20min, and so until the sixth confirmation is assumed that transaction is irreversible, except for a 51% attack ... thing highly difficult to occur.
Other blockchains, maybe the first confirmation is instantaneous, but the second takes 7min, the third 38min, the short one, 75min ... so that's why they are less secure, the litecoin blockchain may require 2000 confirmations to validate a transaction . The security of the chain is provided by the miners by giving robusted, and that robusted is given by the profitability obtained by the miners. In the Bitcoin blockchain, miners take a lot of money from transactions and mining.
Here I leave you a graph of the amount of money that is carried in Bitcoin, Litecoin and Ethereum.

8549771e0baa54c38ca863a99921c77e4183433268b4d43d8bf1650dc24e1d9f.png
I make the comparison only with BTC, LTC and ETH because if I added more currencies, only these three would be seen, the others do not spend money on security, although they argue that their chain is the fastest.



I hope you like the article, designed for people who are beginning to know the world of cryptos, how they work and some very basic concepts about what has already been mentioned.

Greetings, I encourage you to subscribe to the channel so as not to miss any article, I thank you for leaving a comment, I love being in contact with the people who read my publications.
If you leave a tip it will be a motivation to continue writing about the crypto world that I am so enthusiastic about.




---Klo---

How do you rate this article?

7



collaborative economy
collaborative economy

In this blog we will talk about collaborative economy, blockchain, news and crypto news

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.