Deep in the blocks — Learning Blockchain with Anders Brownworth’s Demo
This is the best place that I’ve found that explains the blockchain technology with simple concepts, a couple of videos, and with a really cool online demo.
Quoting Brownworth, the Blockchain Demo is:
A web-based demonstration of blockchain concepts.
This is a very basic visual introduction to the concepts behind a blockchain. We introduce the idea of an immutable ledger using an interactive web demo .
Here is the post (2019/06) from the personal website where he explains a little bit about the demo with the videos.
Following the video walkthrough with the demo
Here’s the demo website to play around with Hash, Block, Blockchain, Distributed Blockchain, Tokens and Coinbase.
Here, I’m going to follow Part 1 of this Blockchain 101 video to try to understand all of this stuff.
Part 1: Blockchain 101 — A Visual Demo
A digital fingerprint of the data that is written. The length of the hash is fixed no matter what information is stored.
The hash includes Block (number), Nonce (another number), and Data.
When the data is empty it has a particular hash (note the initial 4 zeros): 0000f727854b50bb95c054b39c1fe5c92e5ebcfa4bcb5dc279f56aa96a365e5a
When some data is added the hash changes to a particular number. The box turns red because the Nonce number does not match the hash (does not have the 4 zeros at the beginning), it is not a valid or not a signed block.
The Nonce number can be changed until the hash begin with 4 zeros (0000). This process could be done by manually change a number from 1, 2, 3 and so on. The number could be found by this method taking the required time or machine, but it could be just too long.
If the Mine button is pressed, the Nonce iterates until there’s a match (the hash begins with 4 zeros 0000…). In this case, the block is verified for the Nonce 1771.
Now, there could be a chain of this blocks, from Block #1 to Block #5. Each one connected with the previous one
If there’s a change in Block #4 from it’s initial empty state, the block will be invalid and the chain will be broken. The previous hash in Block #5 would not match the hash from Block #4, but not affecting the Block #3, #2 and #1.
If the Block #4 is mined, a Nonce will be found and validate the current Block but not the next one in the chain.
If the Block #5 is mined, it will valid by matching the hash of the previous block.
Now, there can be a distributed chain of this blocks with some peers with identical blocks.
If a change is made in Block #4 of Peer B, it will affect this particular Block, but won’t affect the other blocks nor peers
If Block #4 and Block #5 are mined, both blocks will be valide a the whole chain will be ok. However the hash in Block #5 in Peer B is not the same as Block #5 in Peer A nor in Peer C.
By having a distributed blockchain a change in the past can be noted and traced by examining the blocks. Next, we can do a Token on a blockchain.
If more relevant information where to be stored, for example a list of transactions like the ones below, it could be relevant to keep track of them and know if at a certain point a change has been made that breaks the chain. This is making a Token on a blockchain.
A change is made in the blockchain. This is the point of keeping track of stuff happening in the past by using a blockchain to remember tokens.
But up to this point, the system does not know if Darcy has a particular amount of something, the only thing that is known is that D has made a transaction to B.
Now a coinbase transaction is added to the blocks. An initial amount is registered to A in Block #1 and then a couple of transactions are made in the blockchain.
A block could be examined to check that a person has the amount to give to another one, since it can be traced by the hash (and peers) if something is weird and does not match.
Part 2: Blockchain Demo: Public / Private Keys & Signing
Now we play around with Public/Private Key Pairs, Signatures, Transactions and Blockchain.
Public / Private Key Pairs
The Private Key is meant to keep secure and not shared. The Public Key can be shared but can’t be used to trace back to the Private one.
A message has been added. This message has a particular private key.
If we sign it, it creates a message signature.
If we share the public key to another person, the message can be verified with the match of the public key and the signature.
We can make a transaction of $20.00 from a particular public key to another public key. The private key can be used to sign the message.
By hitting sign, we get a message signature. The signature can be checked against the public key to see if the private key behind it signed this message.
The next step is to use this in a blockchain.
Here, there are not names, just public keys sending stuff to another public key with a message signature.
If there’s a change in the transaction, in Block #5, it breaks the block and the signature, now the signature is not verified.
A miner could take this altered block and re-mine it, they are going to end up with a signed block (cool) but the signature is still invalid. This is because the miner has no access to the private key, just the public key, so the right signature can’t be made up.
In this way, the transactions can be protected with public/private keys from any interference. Makes sense, since in order to create a new address (public key) we can come back and create another random number (private key) without going to a centralized authority to create this key pair.
Its seems like this can be a somewhat efficient way to keep track of stuff or handling agreement on what has happened in the past.
Definitely what I have done here is very simplified, leaving a lot of stuff behind that I have no idea whatsoever, but it helped me to understand a little bit of what is going on with this.
I invite you to do this on your own following the highly recommend videos of Brownworth.
I hope this was helpful and thank you for reading it.