Take our survey for a chance to win $50 Take our survey for a chance to win $50

Introduction to NEO. Part 3.

What You Need To Know About Proof-of-Work Before You Learn About Byzantine Tolerance Protocol

 

One of the biggest benefits of any blockchain is that the blockchain technology makes it impossible or not economically viable to tamper with past transactions or records. This is why financial transactions become irreversible on the Bitcoin network, emails in Onchain’s application for Alibaba become impossible to tamper with and so on.

All of this happens because most blockchain networks, including Bitcoin and Ethereum, use the concept known as proof-of-work.

Miners on blockchain networks compile information into blocks of blockchain. Compilation of information, no matter what information it is, financial, textual or some other kind, is a trivial task for modern computers. This means that a hacker could also compile information easily. Proof-of-work solves this issue.

Proof-of-work is a function that introduces an economic measure to prevent service abuses of online platforms and systems. One of the simplest examples of an online service abuse is spam. Spammers scan various websites for email addresses and then use the addresses to send unwanted and potentially fraudulent advertising. An example of a system similar to proof-of-work would be a CAPTCHA, which is a test that requires a person to manually enter letters from a distorted image into an online form to complete an action such as log into a website, send an email or submit an online form. Many people argue that CAPTCHA can be hard to complete and slows down the flow of work significantly. While some of these claims are true, it is impossible to argue with the fact that CAPTCHA does work as a mechanism that prevents service abuses.

The difference between proof-of-work and CAPTCHA is that CAPTCHA is performed by humans and proof-of-work schemes are performed strictly by machines with no human participation.

 

Short history of proof of work algorithm

Cynthia Dwork, an American computer scientist who works for Harvard University, and Moni Naor, an Israeli computer scientist, invented the concept of proof-of-work without calling it this way in 1993. Markus Jakobsson invented the actual term “proof-of-work” in 1999. A key feature of computer proof-of-work algorithm is that coming with a proof should be hard, but possible. The proof of work should also be easy for the service provider to verify.

Hal Finney, an American computer scientist, applied the concept of proof-of-work to electronic financial transactions. In 2004, Finney introduced the concept of reusable proof of work or PROW. PROW was a major step that later led to the invention of Bitcoin. Finney himself was on the receiving end of the first-ever bitcoin transaction that has occurred in 2009. In the transaction, Finney received funds in bitcoins from the creator of bitcoin Satoshi Nakamoto.

 

Hashes and security algorithms in plain language

Both the Bitcoin network and the Ethereum network use proof-of-work schemes to create tamper-proof blockchains. To work, a scheme uses hashes and cryptography algorithms. A cryptography algorithm turns a large set of data into a hash, which is a short string of data. Bitcoin uses algorithm called SHA-256 and Ethereum uses Ethash.

Let’s say you have a set of numbers 1,3,4,5,6,6,7.  After you apply a cryptography algorithm, you will get just one string, which will be the hash for this set of data under the cryptography algorithm. For example, some cryptography algorithm, let’s call it SomeCryptAlg could return a hash of 00xx5 for the set of data (1, 3, 4, 5, 6, 6, 7).

An important feature of all working cryptography algorithms is that a set of data can only have one hash. This means that no matter who runs the data through the algorithm, they would always receive the same resulting hash.

Another important feature of cryptography algorithms that modern cryptocurrencies use is that hashes for very similar sets of data are not just different but very different. For example, if the set of data (1, 3, 4, 5, 6, 6, 7) had a hash of 00xx5 under the imaginary algorithm SomeCryptAlg, the set (0, 3, 4, 5, 6, 6, 7), which is identical for to the previous set except for the fact that 1 has been replaced with a 0, would have a hash of 99er2. With Bitcoin and Ethereum, miners create hashes for sets of transactions that have all kinds of data, such as receiving address, amount and so on. The principle, however, stays the same: a large set of data returns a much shorter hash. For example, block #505562 of the Bitcoin blockchain had 1852 transactions included in it. You can see all the information about all the transactions in this block on the Bitcoin blockchain explorer here: https://blockchain.info/block/0000000000000000005a699e426082b4b9047dd6963c79c1361b8cc6d8c71711

The hash for all these transactions was just one string, which was 0000000000000000005a699e426082b4b9047dd6963c79c1361b8cc6d8c71711. You can see the hash on the same page as the information about the transactions for the block.

Hashes have three more very important properties. The first property is that they are easy to verify. This means that if you have a set of data and you send a set of data to a friend, both you and your friend can run the set of data through the same cryptography algorithm and get the same hash if the data did not get corrupted during the transmission. The second important property of hashes is that they are easy to compare. You can send a very large set of data to a friend, yet to verify the validity of data later on all you’ll have to do is compare much shorter hashes, the one that you obtain after running the data through an algorithm to the one that your friend obtains running through the same algorithm. Finally, it is important to note that reconstructing the data if you only have a cryptographic hash from a secure cryptography algorithm is impossible, meaning that looking at 99er2 and 00xx5,  you will be able to tell that the sets of data you and your friend have are different, but you will not be able to reconstruct (0, 3, 4, 5, 6, 6, 7) or (1, 3, 4, 5, 6, 6, 7) just by looking at their hashes.