Bitcoin
$12,892.16
+463.29
Ethereum
$334.85
+0.92
Litecoin
$129.36
-5.96
DigitalCash
$169.38
-10.38
Monero
$101.92
-5.37
Nxt
$0.04
0
Ethereum Classic
$8.89
-0.56
Dogecoin
$0.00
0

What is Blockchain and Bitcoin? A Conversation Between Friends.

The setting is pretty straightforward. Let’s introduce ourselves to our characters.

Alex: He is an early investor in Bitcoin and has educated himself about the blockchain technology over the years.

Fred: Fred is Alex’s close friend who has no clue about the blockchain technology.

Fred: “So your investments have gone down quite a bit haven’t they?”

Alex: “Well… yes”

Fred: “Have you sold out any of your cryptos?”

Alex: “No…why should I do that?”

Fred: “So what have you done with them? Kept them in a bank or something?”

Alex: “…..”

Fred: “What?”

Alex: “You know that Bitcoins aren’t actual coins right? You don’t actually keep them in a bank. In fact, the whole reason why Bitcoin was created was so that you no longer had to deal with banks.”

Fred: “Oh..ok. So then that whole decentralization angle I guess. I have heard about that one. But, how does it actually happen? People keep on throwing these terms.”

Alex: “Well, the decentralization happens because of the blockchain technology”

Fred: “Remember when I told you about people just randomly throwing terms around?”

Alex: “Urgh..ok. So I guess you want to know what the blockchain technology is?”

Fred: “That’s correct.”

Alex: “Ok, so..close your eyes”

Fred: “Err..”

Alex: “Just do it!”

Fred: “Fine” *closes eyes”

Alex: “Now imagine a series of blocks. All these blocks are full of time-stamped data. These blocks also happen to be cryptographically linked to one another. The interesting part is that no single person or entity owns all the data that is inside the blockchain.”

Fred: “So…what does that mean?”

Alex: “Well no one entity owns the data, but the data is shared by everyone.”

Fred: “Wait what… what is the point of that?”

Alex: “Well think about it like this, which one is safer. The data that is kept in one spot or the data that is distributed among a huge network?”

Fred: “The data is distributed among a huge network, right?”

Alex: “Correct…can you guess why?”

Fred: “Well, if the data is concentrated in just one small centralized location, then it will be easy for someone to hack into it and get everything right?”

Alex: “Absolutely. But, on the other hand, if the data is distributed and owned by a huge group of people, guess what happens? There is no single point of attack, so it is impossible to get all the data.”

Fred: “That doesn’t sound right, what about the crypto hacks that I hear about all the time?”

Alex: “Well..believe it or not, those hacks have never happened by directly attacking the blockchain. DO you know what exchanges are?”

Fred: “Are those the places where you get to buy crypto?”

Alex: “Yup! Unfortunately, these exchanges happen to be centralized”

Fred: “Oh…..so basically, the hacks happen on these exchanges and not on the blockchain?”

Alex: “Correct!”

Fred: “Got it, so what does the blockchain do? Surely it must do more than just decentralization?”

Alex: “Correct again! You are on fire today aren’t you?”

Fred: “Ah well..”

Alex: “So, the blockchain apart from being decentralized has two more interesting properties. They are immutability and transparency”

Fred: “What the what now?”

Alex: ” Well, transparency means that all the data that is kept inside the blockchain is open for anyone to see. Guess what that does?”

Fred: “Well, it makes all the available for anyone to see. So I guess it will stop people from messing around in the system, right?”

Alex: “Bingo. Immutability, on the other hand, means that any data that goes inside the blockchain cannot be tampered by anyone.”

Fred: “Interesting, so how does that happen?”

Alex: ” Well…through clever cryptographic functions.”

Fred: “Care to expand more.”

Alex: “Well..do you know what hash functions are?”

Fred: “What do you think?”

Alex: “Sigh..ok. So when you pass some data through the hash function, you get an output called hash. So no matter what you do, what you pass through the function. Be it a single word or an entire book, the output hash will always be of the same length no matter what.”

Fred: “That sounds like some magic stuff.”

Alex: “Oh you don’t even know the half of it yet.”

Fred: “Enlighten me”

Alex: “Well, there are certain properties that a hash function fulfills. Firstly, more often than not, a unique input always generates a unique hash. It will also generate the same hash no matter how many times it is passed through the function.”

Fred: “Got it, so it’s a lot like addition. Like 1+2 will always be 3 no matter what”

Alex: “Correct. Now there is one more property that hash functions have. Its called the snowball property.”

Fred: “I liked snowballs!”

Alex: “Yes…yes you do Fred. Anyway, in the context of hash functions, snowballing means that even if the input data changes by a small amount, the output drastically changes.”

Fred: “Show me.”

Alex: “Ok, check this out, I am going to use the SHA 256 hash function. This is actually the same hash function used by Bitcoin. The output will be a 256-byte hash.”

Fred: “Cool, let’s find the hash of my name.”

Alex: “Well, let’s pass “Fred” through the hash function and look at what we have here.”

Fred: “Show me! Show me!”

Alex: ” Here is the hash of your name: 401F1721A42A814961323C460DD7D2036231DDF590B5D898C9CD086A46526BDB”

Fred: “Oh interesting. Now let’s snowball.”

Alex: “Instead of Fred, let’s see what happens if we just pass “fred” through it. All that we are doing is changing the first alphabet from uppercase to lowercase, right?”

Fred: “Right..show me”

Alex: “Well…will you look at this: D0CFC2E5319B82CDC71A33873E826C93D7EE11363F8AC91C4FA3A2CFCD2286E5”

Fred: “Whoah, that looks nothing like the old one!”

Alex: “Exactly, that is exactly what snowballing means”

Fred: “Interesting, but what does this have to do immutability”

Alex: “It has everything to do with immutability. Remember how I told you earlier that in a blockchain the blocks are cryptographically linked to one another?

What happens is, every block contains the hash of the previous block in the blockchain. Now, what if we tamper with the data in a particular block? Remember the snowball property? What do you think happens when they change the data in a block, what happens to its hash that is in the next block?”

Fred: “Well, it changes a lot right?”

Alex: “That is right. In fact, since the hash of the previous block kept in the chain changes, it changes the overall hash of the block which is kept in the next block and so on and so forth.”

Fred: “So what does that do?”

Alex: “Well it should theoretically freeze up the entire blockchain. But that is an impossibility, so it never happens. As simple as that.”

Fred: “Ok, so are there unlimited bitcoins present?”

Alex: “Oh no, far from that. There will only be 21 billion Bitcoin tokens in existence.”

Fred: “A fixed supply eh? So how do people get there hand on these tokens?”

Alex: “Ah, so this is where mining comes in”

Fred: “Wait..so you have miners mining for coins? Wasn’t this supposed to be a digital coin? What the hell are miners doing here all of a sudden?”

Alex: “Ah but these are not your everyday miners. You see, these happen to be digital miners.”

Fred: “Digital miners? Tell me more.”

Alex: ” So, what happens is that we have a bunch guys, who use their computational power to solve really hard puzzles. Whoever gets to solve the puzzle first, will get their block added to the blockchain.”

Fred: “Oooh so is it like a game or something?”

Alex: “It is kinda like a game. The reward is that you will get to append a block to the blockchain and you will get some block reward in return. Plus, that’s not even the end of it. Along with that, whoever mines the successful block will get to become a temporary dictator of the block.”

Fred: “Temporary dictator? That sounds insidious”

Alex: “Oh, far from it. You see, when miners become temporary dictators of their blocks, they have the right and authority to put transactions inside the blocks. In turn, for putting these transactions inside the blocks, the miners can charge transaction fees.”

Fred: “Interesting, but there are only 21 billion bitcoins right?”

Alex: “Right.”

Fred: “So, won’t more and more miners simply pump out all the Bitcoin that is inside the system?”

Alex: “Well…no. Its good that you are thinking like that, however, that’s not going to happen.”

Fred: “Ok, then what does happen?”

Alex: “Well, mining has a feature called “difficulty”. Difficulty basically increases the level of difficulty of the mining process”

Fred: “How does that work? And, come to think of it, you haven’t even told me about how mining actually works.”

Alex: “Patience grasshopper!”

Fred: “1970’s called…they want their memes back.”

Alex: “So, the miners will group all the transactions that are waiting in the mempool inside the block. After that, the contents of the block is hashed and a nonce is added at the beginning of the hash.”

Fred: “Wait, what? Nonce? What is a nonce?”

Alex: “Nonce is a random string that is added in front of the hash”

Fred: “Why do we do that?”

Alex: “I will get to it. So, when you add the nonce to the hash, you hash the resulting the string again. Now you compare the hash to the difficulty.”

Fred: “What is the difficulty?”

Alex: “Difficulty is something that is agreed upon beforehand by the entire network. It is a string or a number. The hash that we get after hashing the nonce and string combination should be less than the difficulty.”

Fred: “So, if it isn’t less than the difficulty then what happens? Didn’t you tell me that hashes are deterministic? So no matter what happens, the hash that you will get will always be the same right?”

Alex: “True, but this is where the nonce comes in. You can keep on changing the nonce until the overall hash is lesser than the difficulty. When that happens you can add the block to the blockchain!”

Fred: “Interesting. So the nonce keeps on changing until you get the hash?”

Alex: “Correct. Speaking of the difficulty again, if the hashrate of the entire system is low and the block production is slow, the difficulty of the system goes down. Similarly, if the hashrate of the system is high and block production goes up, the difficulty goes up. Meaning, mining becomes more difficult or easy depending upon the situation.”

Fred: “Got it, so how does the transaction actually happen?”

Alex: “Before I do that, you need to understand what public address and private keys mean.”

Fred: “Go on then.”

Alex: ” So, when you buy all your coins, you need a place to keep it right?”

Fred: “Mhmm”

Alex: “Well, that place is a called a cryptocurrency wallet.”

Fred: “So, it basically is a wallet that stores your coins right”

Alex: “That is correct, however, instead of storing coins, it actually stores your public address and private key.”

Fred: “An address and a key?”

Alex: “Yes sir. So, look at it like this, the public address is sort of like your bank account. You can reveal it to the world and have people send money to the account. The private key, on the other hand, is like your ATM pin. You don’t really share that with anyone now do you, also you will need to know your ATM pin to access your funds.

One important thing to remember, the private key is mathematically derived from the public address.”

Fred: “Got it. Now, how do all these come together?”

Alex: “Well, if you were to send somebody money, then you will be sending it to their public addresses, signed along with your signature. Think about how you send a cheque to someone. The miners will then check your signature to see if it is a valid one or not.”

Fred: “Alright, so the miners are responsible for the validation of the signature in Bitcoin transactions as well?”

Alex: “Yup.. so after they are done validating, they will put the transactions inside the block to show that you have indeed finished the transaction on your part. Now, Bob will have to unlock the transaction using his private key. Once he does so, he will get the Bitcoins.”

Fred: “Alright understood. So, whenever we think of the blockchain, we automatically think of Bitcoin, but that is obviously wrong, right?”

Alex: “Yup, the blockchain has seen tremendous applications in tons of other fields.”

Fred: “Interesting, tell me about these fields?”

Alex: “Ah, that’s a conversation for another time, my friend. Till now just understand what all I have told you so far.”

 

Leave A Reply

Your email address will not be published.