A Blockchain, initially Block chain, is a developing rundown of records called blocks, which are connected utilizing cryptography.
Blockchains which are decipherable by people in general are broadly utilized by cryptocurencies. Private blockchains have been proposed for business utilize.
Here, is a short story which will make you comfortable with the Blockchain Technology.
Mario and Luigi
Mario needs to send $100 to his brother, Luigi, because Luigi being Luigi, he got into some debts at the other end of the world.
Mario walks into the bank and says “I’d like to send $100 to Luigi”. The Cashier says “Account card please”, “ID please”, ”signature” and “done”.
In this centralized situation, the bank is the *central* expert over Mario's and Luigi's cash. Both Mario and Luigi trust the bank to exchange the sum, and trust the numbers appeared on their bank account statements. They trust the bank in-spite of the way that all the bank needs to do is change a number in a database. It's all advanced, all things considered.
Be that as it may, when we're reliant on such a central authority, that authority poses a certain threat. It can cheat us and disappear with our money, it can be evil and not increase Luigi’s value while decreasing Mario’s value, consequently keeping the distinction, or it can simply be ungainly and commit an error. Our accounts depend specifically on their ability.
One method for anticipating such situations is removing the bank altogether and having our own system of tracking value and the travel of value from one location to the next location.
Imagine a piece of paper on which we're taking note of down the status of our financial balance. If only Mario and Luigi are using that system, it’s hard to keep it fair. If one of them becomes greedy, the system is already compromised. On the off chance that one of them ends up ravenous, the framework is now traded off. Thus, such a distributed (non-centralized) framework needs enough members to make it suitable — at least three.
Inclusion of Papers
Let’s assume we have five participants: Yoshi, Mario, Luigi, Wario, and Bowser, and that every one of them has their own particular piece of paper.
Mario wants to send $100 to Luigi. To do this, he lets everyone know (by loudly proclaiming): “I’m sending $100 to Luigi! Please take note, everyone!”
At that moment, every participant checks Mario’s account to make sure he’s got enough value on it to send to Luigi (yes, every account’s status is public) and if so, writes this transaction down on their piece of paper. Transactions of this type are written down onto the participants’ pieces of paper until they run out of room. In other words, every transaction between any two people is logged on every participant’s paper.
Before we file the filled-up paper away into a folder or filing cabinet and grab a new, blank one, we need to seal the filled one with a special code.
Role of Seals and Mining
This “seal” guarantees that the contents of the paper are true.
How do we get this seal?
With a special algorithm (mathematical operation) which, when we feed it some input data, always produces the same output if the input data is the same.
Let’s take the following as an example:
- X1 + X2 + … Xn = Z
In other words, a simple sum.
Let’s assume that our paper’s values are true and valid (i.e. all the transactions are confirmed) if and only if a given summation operation produces the number 10000.
- 1000 + 6000 + 3000 = 10000
In this case, the input data is 1000, 6000, and 3000, while the seal is 10000.
Okay, so let’s assume that our participants above came to the following agreement: if, when you sum up all the numbers on the paper and a specificcombination of other numbers, you get 10000, then the transactions on that paper are valid and can be considered confirmed.
For example, if the paper contains the following five transactions:
- Mario -> Luigi = 100
- Bowser -> Yoshi = 200
- Yoshi -> Luigi = 100
- Mario -> Yoshi = 500
- Luigi -> Wario = 100
The sum is 1000, so we’re looking for a number that gives 10000 when added to 1000. This remaining 9000 can be achieved with many combinations:
- 5000 + 4000
- 1000 + 1000 + 1000 + 1000 + 1000 + 1000 + 1000 + 1000 + 1000
- 2000 + 3000 + 2000 + 2000
A computer can’t intuitively tell which numbers will produce the desired number. To get to this result, a computer has to randomly guess between different combinations of numbers under 10000 until it gets one combination that produces 10000. Thus, the first among our participants to correctly guess a combination of numbers that produces 10000 when summed with all the transaction values on the paper will be the one to tell everyone else the result.
Suppose that Yoshi found the combination 4000 + 5000. He tells everyone: “I’ve got a 10000!. Try 4000 and 5000!”
Given that it’s very easy to verify the correctness of Yoshi’s numbers by simply inputting them into the algorithm, the other participants verify this. All the other participants’ papers that, during this check, now also produce 10000 when summed with 4000 and 5000 effectively validate the list of transactions in front of them. By doing this, a consensus is reached that the papers are all valid.
If someone’s paper doesn’t produce 10000 when summed with 4000 and 5000, we have a problem.
If, for example, Bowser either purposely or accidentally logged a different transaction — say, that Mario gave Luigi $200, and not $100 — then the sum will not match the requirements.
Bowser’s paper is thereby considered invalid, and if he wants to continue participating in this system, he’ll have to discard his paper, copy someone else’s valid paper, and promise to be more careful in the future. On the other hand, Yoshi, who was the one who found the winning combination, gets a reward of, for example, $5 from the system. The system produces the $5 out of thin air as a reward for the lucky participant.
This production of money out of thin air is called mining in the cryptocurrency world.
While this was a dramatically simplified example, the only real difference from the real blockchain (beside the fact that in reality it’s all digital and automatic) is the fact that the algorithm being used to produce the seal is different — a more complex one that can accept both numbers and letters, and outputs code like
The seals are called hashes, and the algorithms producing them — like SHA256 which produced the above code — are called hashing functions.
Try openingand inputting any amount of text into the field.
Whether you put in a single word or the entire Bible, it’ll always produce a hash of exactly 64 characters.
Hence, to get the hash that seals our paper, we enter into the algorithm all the transactions present on the paper. They become a hash. Since there’s an infinite number of combinations of characters we can provide as input for the algorithm, guessing the original input set of data based purely on the output data is a mathematical impossibility.
Specifically, in the Bitcoin blockchain, the consensus of the network and all its participants is that as long as a produced hash (which we get from combining the last paper’s hash and all the transactions of the current paper, plus a random bit of numbers and letters) starts with a given number of zeroes, it’s valid.
For example, if paper 1 has the hashof
paper 2’s valid hash will be the one which (when the current paper’s transactions and some random data are added to the last paper’s hash) contains an equal number or more zeroes at the front.
To get this combination of random characters needed for producing a new valid hash, a computer must make guesses. Modern computers are very fast and easily try out thousands of combinations per second, but this still isn’t fast enough given that the number of possible combinations is near infinite. As an aside, the aforementioned hash shows us that the difficulty of guessing a new one is ranked 17, because there are 17 zeroes at the front of it. In time, the difficulty will increase and a new valid hash will need more and more zeroes at the front.
When the paper of each participant is marked as valid with the hash, it’s put away into a folder — a ledger of sorts — and a new blank one is pulled out.
In Blockchain Dictionary
- One paper is a block.
- One block contains many transactions.
- One block always follows a previous block, forming a chain — a blockchain. Validated blocks are put away into a ledger (synonymous with blockchain).
- Computers guessing the combinations are called nodes. A node that guesses the hash combination gets a reward in the form of the blockchain’s tokens — in our particular example, a few Bitcoins.
- The guessing for combinations is called mining, because we’re diggingfor new value in a big pile of random guesses. Instead of muscles for effort and pickaxes for tools, we use electricity, time, and a computer’s calculating power.
Hope the above story helps you to make you more comfortable with the Blockchain Technology.
Have a good day