Summary of Blockchain
Summary of Blockchain
Blockchains are important because they provide a safe and secure way for people to
make any type of transaction without having to trust anyone.
When blocks fill up with data, transactions are hashed into what is known as a
Merkle tree. Merkle trees provide for an easy way to find any specific transaction
in a blockchain.
A hash function is a one way function that takes any type of data and converts it
into a unique character code. Merkle trees use hashing to convert every transaction
in a block into a 20-digit character code known as the Merkle root. Hashes are also
useful when comparing large amounts of data.
A block header is a hash of many things determined by the blockchain, but most
frequently consists of the previous block header hash, the Merkle root of the
current block, and the timestamp.
By including the previous block's header hash, blocks are “chained” together.
Chaining is important because blockchains are kept on millions of nodes across the
network.
Chaining allows blockchains to easily check and see if any data was altered just by
comparing the hash of the current header. If the hash is the same on every node,
then the blockchain is the same. If the header hash is different in any way, then
the different hash’s blockchain is updated to match the majority of blockchains.
This is what makes blockchains fault tolerant and immutable.
Blockchains are fault tolerant because if any one node loses track, it will be
updated to match the majority of nodes running the current blockchain.
Blockchains are immutable because the data on a block can never be changed or
deleted.
Anonymity is achieved through public key/private key cryptography. Your private key
is for your eyes only. Your public key can be shared with the public. Your public
key is the address you receive and send transactions from. To prove that your
public key is associated with your private key, a digital signature is used. A
digital signature uses math to show a relation to your public key from your private
key, without revealing your private key.
Anonymity poses a problem when it comes to trust. How can we be 100 percent certain
that anonymous users are being honest when adding transactions to a ledger that
once added, cannot be changed or deleted. The answer is to validate every
transaction before adding them to the chain. This problem of validation is often
referred to as the byzantine general’s problem, and the solution is found with
consensus algorithms like Proof of Work and Proof of Stake. These consensus
algorithms take advantage of the fact that the majority of users on a blockchain
have a common interest to keep the blockchain honest. We will go further into some
consensus methods in chapter 2.
Not all blockchains use anonymity however. Private blockchains allow for the use of
permissions to control who can read and write onto a blockchain. Private
blockchains often require trust, but are much more efficient due to the lack of
need for a consensus algorithm like Proof of Stake. A private blockchain would be
useful when you want an extra layer of transparency and higher level of security
than a traditional database might be able to offer.