Tech Junkie Blog - Real World Tutorials, Happy Coding!: What is a Blockchain?

Wednesday, September 16, 2020

What is a Blockchain?

 A Blockchain is a distributed network of containers with data, a hash, and a pointer to the previous hash.  A hash is a text that consists of an input of all the parts of the block, and it will generate the same hash every time the input is the same.  So if the block has been tampered with the hash will be different. On top of this there's a global record of the transaction that's distributed to everyone in the ecosystem.  Making it almost impossible to to tamper with because if a hash has been tampered with there needs to be a consensus of the change before it is deemed valid.  A consensus consists of 50% of the users.



If the hash, data, or anything of block 1 changes, the block 2 becomes invalid because block 1 will have a new hash and block 2 will be pointing to the wrong previous hash, making everything after it invalid, therefore it is in everybody's interest that changes are made very difficult because it would greatly impact the integrity of the blockchain.  There are many checks and balances that must be met before a new block is accepted in the blockchain. Obviously there needs to be something that will correct a bad new block chain, else if a new block chain is bad then nobody can add a new chain to the blockchain anymore.

 

Proof Of Work

So let's say you have a supercomputer and you can pump out a new chain really quickly and recalculate the hash of all the blockchains and make a million bucks in a few seconds, wouldn't that be cool?  Well not so fast, that's where the concept of "Proof of Work" comes in. What it basically means is that there's a difficulty set for each blockchain.  For example for Bitcoin let's say there needs to be a certain number of zeros in front of the hash of a new block, since you can't influence the way a hash is created you need to create a lot of hashes to come up with a new block.  As computing the power increases the bar will be set higher.  That is why it's so hard to create a new Bitcoin.  Proof of work means you put in the work, that's what people call mining. Since you cannot tamper with the block, how do you create a new hash if it doesn't meet the difficulty requirements? Well blockchain provides a nonce value that is random, that acts like a seed for a new hash because you need to change the block the create a new hash.




What does cryptocurrency have to do with blockchain?

Cryptocurrency are basically a list of transactions stored in a block that specifies who its from and where its going, and the coins are either subtracted or added to your balance (digital wallet).  However. it is not that easy to calculate your balance.  You have to loop through the whole chain and figure out what you sent "from" your wallet and who's wallet you sent the block "to", it's very inefficient.  Cryptocurrency is not real money, it's the value you put in it that makes it valuable. You can't exchange it for an x amount of money.  It is what it is, you could say hey Mikcy give $1000 and I will transfer 1 Bitcoin to you, it's a digital transaction basically and the transfer is the reward.  Without transactions and reward (mined coins) there's no cryptocurrency. 





.

No comments:

Post a Comment

Search This Blog