In this video, we are going to explain what a blockchain is in very basic terms. By the end, you’ll be able to explain this life-changing technology to those you love, saving them from authoritative dictatorships that never cease to control your every move. Nevertheless, we don’t really discuss politics on this channel, mostly just ideas, so let’s get into it.
What is a block?
In terms of cryptocurrency, a block is just a bunch of data. In fact, the data could be almost anything, but it’s just a collection of records. For the numero uno crypto, bitcoin, this data is just a list of transactions. For example, it might look like this:
X pays Y $50
A pays U $80
Y pays H $15
If we’re dealing with ethereum, it’s mostly transactions, but it can be a few other things, like smart contracts, which are really neat but we explain them in another video. For other alt-coins they can be the usage of your wifi, or files, or documents. Nonetheless, a block is just a collection of records.
For this example, to explain what a blockchain is, we are going to stick with a record of transactions, like in bitcoin. Specifically, we call this a ledger, because it’s a record of value exchanging hands.
These blocks have limits, and they can only have so many transactions, so we have to keep adding them. For our example, bitcoin has an average of around 1500 transactions right now. This number changes, but you don’t really need to know why. Just know that these blocks fill up and then we have to do something with them.
What do we do with these blocks once they are full? We add them to the network. How do we do that? Well, we mine them, and since Bitcoin is a “Proof-of-work” model, we have to prove that we mined them. This brings us to something called a hash.
What is a hashing function?
A hashing function is a system where you can put something into it, and it’ll output a hash. There’s a ton of math happening inside this “magical black box”, but essentially you give it something and it gives you something. In this case, bitcoin uses SHA-256 hashing function. SHA stands for “Secure Hashing Algorithm” and 256 refers to the amount of 0 and 1s that it has in whatever it puts out. Whether you put it your name or the entire dictionary, it’ll always be 256 1s and 0s. Our computers are smart and so they convert those 0 and 1s to letters and numbers. It’s complicated and could be its own video, but essentially you need to know 3 main things about a hashing function.
Mostly that you can’t just find it… you HAVE to guess and check.
So if you give it A, it’ll give you D.
Then you give it AA, and it’ll give you J.
Then you give it AAA, and it’ll give you U.
Imagine if you wanted to find out what gave you an F… you’d have to just keep giving it more “A”s until you found it.
Also, that changing the input just a tiny bit, changes the output a lot.
So basically if you do SHA-256 of this “subscribe to our channel”... you get this as the output:
However, if you do “please subscribe to our channel”... you get this:
And lastly, calculating the hash takes some time. It might only take milliseconds for one tiny string of text, but if you have an entire book and you want to check a few million variations of it, it starts to rack up time.
And so what bitcoin is doing, when you mine it, is we are trying to add random numbers to whatever the block is to get a special ending. For example, let’s say we are trying to mine this:
“X pays Y $50, A pays B $80, Y pays H $15” - you get
As the output.
What number do we have to add to the end of that list… to get a zero at the end of that hash?
Well, if we start with 0, and we use my little python program, we figure out that it takes 3 different checks to get to the first one, which is when you put a 2 at the end of it.
“X pays Y $50, A pays U $80, Y pays H $15 - 2”
And you get “2E5DFC3631DD77A93D8A55E2521E7AACF4B3B1BCB39D640B4BEE44B978FAA3B0”
Now, let’s make it a little harder, let’s try two zeros. After running my little python miner, we figure out it takes 438 tries until you hit the first hash that ends with 00.
“X pays Y $50, A pays U $80, Y pays H $15 - 438”
And you get “12CC5B881590E7F549A030119C5011A990D6F280D442B1A066C1FF9EFA091A00”
Just to drive the topic home that this takes a lot more time, let’s look for how many times we have to guess for it to get 5 zeros.
“X pays Y $50, A pays U $80, Y pays H $15 - 1323696”
And you get “61DBD91907AFBACEE5D891ECAE6007A4245946EF0DFA3558A1CCD4D25CE00000”
So as we look for more zeros, it takes a lot more time to check it. Essentially, bitcoin is looking for a lot of zeros and computers and mining farms all around the world are all “mining” away to find the right number. When they do, we say that the block is “solved” and “verified”. But we will get to that in a little bit.
Something important about any blockchain is that it is also decentralized. This doesn’t have to be confusing, so think about it like this. Centralized means one person controls it. For example, your grades in high school… only your teacher had access to add in your grades and change it. They could flunk you if they didn’t like you, and nothing personal here, but maybe you just didn’t understand what they were teaching because they sucked at teaching. Anyways, decentralized means more than one person can have access to your grades.
Imagine if all of your classmates were allowed to look at your answers and give you a grade based on your papers and tests. Imagine if they could vote on what grade you got, instead of your teacher. This is essentially what decentralized means. Instead of one person having a list of all the bitcoin transactions… literally anyone who wants to have them can have them and look at them. Not only that, and this is the important part, but anyone can mine and actually vote on the blockchain. This means they can say “Bill really did pay John $50”. Or, they could make fake transactions and say “John paid Bill all of his money”. That problem is solved by using cryptocurrency wallets, which we just finished a video on, you should check it out!
But that begs the question, why would a group of teenagers want to look at your papers and tests? Even more so, why would they want to spend a lot of time looking at them and then grade them? Well, in this analogy, they would be paid to - in almost every blockchain, you get a reward for participating and putting in good votes. In bitcoin, you get paid in bitcoin… and so on.
So far, we’ve been over what a block is, what a hashing function is, and what decentralized means, so if you’re still with us, please consider clicking that like button, it gives us fuzzy feelings inside and promotes our hard work. Next up, let’s learn why it’s called a blockCHAIN.
So with bitcoin, there are two extra things you need to know about.
One, whoever solves the block and finds the magical hash, they add “[my account] received 2 bitcoins for mining” at the top of the block. This is their mining reward. This is how more bitcoins are created.
Second, they also add the hash of the last block to it.
This makes it a chain, since each block refers to the last one. This is where the magic of the blockchain works. If you try to go back and edit an old block, the newer ones all changed because you messed up the hash that all of those pointed to. Remember when we talked about the hashing function and SHA-256, changing it just a bit changes the whole thing? That’s how we can make sure someone doesn’t go back and add in more money to their account. In a sense, whatever gets added to the blockchain is written down in history forever, because it can’t be changed. This is good for things like transactions, but bad for things like copyrighted material or embarrassing things. Tis the nature of the internet though.
So in conclusion, we have blocks that consist of data, and in the case of cryptocurrencies, it’s usually a list of transactions.
Next, after we have a block, we have to find the “password” to it, or the hash that solves the block. Miners do this buy guessing and checking until they hit the jackpot.
After they find the solution to the block, they make sure that it’s linked to the last block, so each block actually has the history of every transaction on it.
Since each block is connected to the last block - it makes a chain. That’s a blockchain.
Thanks for watching this video, if you enjoyed it, please give us a like to reward our hard work and subscribe for more amazing videos just like this one. We hope to see you in the next video!