It has quickly become a buzz word in the public consciousness. However, many people having strong opinions about it despite being hesitant to put in the time to learn how it works. Luckily, it takes less than ten minutes to have a competent, working knowledge of the technology that everyone’s talking about. So, you finally decided to learn why blockchain is such a big deal.Ultimately, a blockchain is a decentralized ledger, run on a distributed network. In simpler terms, it is a database with no single owner, sending its information to many computers. This way each computer involved has a record of information and can be referenced against thousands of other ledgers. The power of then comes from its complete democratization of trust: there is no higher authority to oversee the network, just the power of mathematics, intelligent design, and the users themselves.
It may seem daunting to get into math right away, but it’ll spare some of the awkward detours later. A crucial part of guaranteeing the security of blockchain technology is the mighty hash function. These take an input of any size, typically a text document, and return code of some fixed length. Another important feature of hash functions is their deterministic nature. If you change a single character in the input text, it will change the output code.Blockchain uses public-key cryptography (PKC) as a way to create digital signatures with which to sign off on transactions. In this model, every user has a public and a private key, both short strings of text.
It will be useful to build our conception of a blockchain from the ground up, so let’s start with a transaction. Just like any other, the amount, time, and participants involved in the exchange must be recorded in addition to the digital signature of the sender, guaranteeing security between the parties involved.
Once enough transactions have been recorded, a large number of them are bundled together in a block. Next, contents of the entire block are passed through a hash function (typically SHA-216), and this code is used as its index.When a block has been verified as legitimate (we will get to how this is done shortly) it is added to the chain, a public record. The key here is that the hash output of the previous block is also included in the text of the current block, meaning its new hash contains a link back to its neighbor; this will prove to be very important for security.
Here’s the problem: if the chain is completely public, who’s to say someone can’t alter a block? What is stopping hackers from changing the amounts in transactions? This is where miners come in: a person who works to approve transactions and build the blocks to be put on the chain. This action is often tied to some sort of proof of good faith and is sometimes awarded upon completion.
Miners act as nodes in the network, all receiving the data from new transactions and competing with each other to be the first to add them in block-form to the chain. So now, what if one of the miners themselves decided to alter a transaction, splitting the blockchain into multiple chains and leaving other miners unsure of the correct one?
Well, there’s a very simple solution to this: take whichever chain is longest as the real one. This is due to the massive amount of computing power it would take to keep up this hack. Since the blocks are linked by their embedded hash codes, the rogue miner would have to continue being the first to push new blocks to the chain in line with the altered data, or otherwise be overtaken by a different chain.
So now for these “proofs of good faith” described earlier to assure miners are submitting correctly-assembled blocks. These are called consensus mechanisms, since they create a consensus among the miners, and though many have been proposed, there are two major ones currently in use.
The first is proof of work. Basically, it requires a miner to solve a computationally complex problem in order to finalize a block. This puzzle typically involves cryptography: for example, asking for a code to be generated that when hashed will contain a certain string of characters at a certain position, which is very costly power-wise. This means that verifying a block implies that the puzzle has been solved, often with relatively random odds, assuring the network that the block is legitimate.
Proof of stake on the other hand allows “buy-in” of a certain token, with staking significant amounts of the token as proof that the miner is monetarily invested in the network and wants to see its success. Some other proposals of this kind of consensus use age as the stake, the length of time a miner has been in the network.
Both of these consensus mechanisms have their downsides: proof of work is very wasteful by draining so much energy in the form of electricity, and proof of stake can present barriers to newcomers or those with fewer funds to push towards tokens.