The concept of proof-of-work (PoW) refers to a system that requires a considerable amount of work but is also feasible, such as sending spam emails or launching denial-of-service assaults. The idea of reusablenreusable proof of work using the SHA-256 hashing algorithm was later adapted by Hal Finney in 2004 to secure digital cash utilizing the notion of “reproducible proof of work.”
Finney’s PoW idea (which was also the recipient of the first bitcoin transaction) became widely adopted in 2009 when Bitcoin was introduced.
Proof of work is what allows different cryptocurrency networks to agree on transaction histories, ensuring that no one party canector tamper with the records.
This section will cover the basics of how proof of work works in the bitcoin network. Bitcoin is a virtual currency that is based on a decentralized ledger known as a “blockchain.” This ledger records all bitcoin transactions, which are organized into sequential “blocks,” making it impossible for any user to spend their money twice. To prevent tampering,
In practice, users detect tampering through hashes– long strings of numbers that serve as proof of work. When data is put through a hash function (bitcoin uses SHA-256), it will only ever generate one hash. However, due to the “avalanche effect,” even a tiny change to any portion of the original data will result in a totally unrecognizable hash. The hash generated by a given function is always the same length, regardless of the original data set’s size. The hash is a one-way conversion: it can only be used to verify that the data that produced the hash matches the actual data.
To make it more difficult to add a new block onto the blockchain, the bitcoin network founders set a “difficulty.” This setting is continuously adjusted so that only one block can be added every 10 minutes. By making it harder to generate hashes, they ensure that only legitimate transactions are recorded on the blockchain.
By establishing a “target” for the hash, you may change its difficulty: the lower the target, the smaller the set of valid hashes and the more difficult it is to produce one. This implies a hash that starts with a lengthy string of zeros in practice.
How can miners ensure that they produce a hash less than the target when a specific set of data can only generate one hash? They modify the input by appending an integer, known as a nonce, to it. When a genuine hash is discovered, it is broadcast to the network and added to the blockchain.
The mining process is random, but on average someone will create valid proof of work every ten minutes.
Miners come together to improve their odds of mining blocks, which creates transaction fees and a temporary reward of newly-created bitcoins.
The proof of work system makes it very difficult to change any part of the blockchain, because doing so would require re-mining all subsequent blocks. It also makes it hard for a single user or group of users to control the network’s computing power, since the equipment and energy needed to complete the hash functions are expensive.
Work proof requires a computer to finish hashing functions at random until the minimum number of zeroes appears at the start of the output. For example, on December 4th, 2020, block #660000’s hash was 00000000000000000008eddcaf078f12c69a439dde30dbb5aac3d9d94e9c18f6. That successful hash earned its creator 6.25 BTC.
The “block” will always have 745 transactions with a little over 1,666 bitcoins, as well as the header from the previous block. If somebody tried to change a transaction by even 0.000001 bitcoin amount-wise, the hash that would result would be unidentifiable and rejected by the network.