- it is important to ensure that miners spend money (on electricity) while mining to ensure that the miners are incentivised to secure the network. This means that miners are incentivised to play by the rules set out by the blockchain and protects against situations such as double spending or miners adding anything malicious or incorrect data to the chain. Miners FIRST pay for the electricity consumption used by the processing power of their mining hardware in advance to receiving the financial benefit of a block that they have newly created which in addition has also been validated and accepted by all other nodes on the network. This is what creates the incentive to secure the network as they will lose money in overheads if their block is not deemed valid by the nodes on the network.
The network is made secure by the combined hashing power of all miners on the network defined as the hash rate therefore incentivising participation is key.
- It would be difficult for someone to go back and change a previously added block because of 2 main factors
Firstly it is important to understand that each block has a unique hash which is calculated using the hash of the previous block, the data within that block and a nonce, blocks are connected via a link which is generated using a proof of work algorithm and the properties of this link are dependent on the data within the previous block.
As the hash of any given block is calculated using the hash of the previous block, if the data in a previous block is edited, the hash of that block will change drastically and this as a direct result will edit the imformation in the subsequent block which contains the now editted blocks hash. This will cause the link between the two blocks to break meaning all links between all subsequent blocks from this point on in the chain will be broken as the data of one block leads into anothers and so on and so forth.
This is the first factor.
The second factor is the POW algorithm. In order for a new block to be created a nonce is used as a key component of a cryptographic puzzle miners compete to solve, in order to successfully create a new block that is added to a chain. The nonce is hashed into the data of a block and therefore if a blocks data is changed the block will need to be re-mined. this therefore means that all subsequent blocks will need to be re-mined as well, re-establishing the links between each block. This mining process is expensive because of the difficulty. On top of this the new chain that is being created will need to catch up to the current chain which is still creating newly mined valid blocks - because the nodes will continue to use the longest chain as the valid blockchain - and until the size of the altered chain is greater than the size of the current chain it will not be accepted by the network.
- The network regulates the mining difficulty using the proof of work algorithm. Because of a use of a nonce in the data of a block, miners have to solve a cryptographic puzzle whereby a string of numbers is randomly selected and added onto the end of (combined or brought together with) the data of transactions and the hash of the previous block on the current block. The hash of these is then compared to a target set by the POW algorithm, and if the hash is lower than the target, the block is created and added onto the chain. If the hash is higher than the target, a new nonce is selected randomly and the hash function is recalculated. this process is repeated again and again until the hash is lower than the target.
Therefore the mining difficulty is regulated by how low or high of a number the target is set as. What determines this target is the hash rate of the network which is to say the total computing power of all of the miners combined. This means that as the number of miners competing in solving the cryptographic puzzle increases, the target is lowered and subsequently the difficulty goes up. The reverse is also true in that as the number of competing miners decreases the target goes up and resulting in the difficulty decreasing.