Directly everybody was becoming aware of Blockchain and having a question mark? What’s going on here? How can it work? That is cool. Presently let us get it. On the first so as to comprehend the taking a shot at it, we should realize what is it ?. Tell us about it…
Blockchain innovation is characterized by its qualities. So as to comprehend Blockchain, one needs to comprehend the key highlights of the innovation and how they are interrelated.
Introduction to Blockchain:
Where Blockchain was before presented in 1991. Be that as it may, it appeared in the year 2008 by “SATOSHI NAKAMOTO”
What is Blockchain?
- A blockchain is a decentralized dispersed open record of all exchanges over a distributed system. (general definition)
- “A Blockchain is an advanced, changeless, circulated record that sequentially records exchanges in close to continuous. The essential for each consequent exchange to be added to the record is the separate accord of the system members (called hubs), along these lines making a persistent instrument of control with respect to control, mistakes, and information quality”
Presently we got comprehended of what is a blockchain. To comprehend the working let us think about key highlights.
- Hashing is generating a value or values from a string of text using a mathematical function.
- Hashing is a method to alter security throughout the method of message transmission once the message is meant for a selected recipient solely. A formula generates the hash, that helps to safeguard the protection of the transmission against a change of state.
How about we envision there a couple of companions who chose to make different cash. They intend to keep the record of it with the one individual how about we name him as “Mass”- he kept a journal to record the activities.
1. Kan gave 3 coins to spider
2. Spider gave 4 coins to wolf
3. Wolf gave 5 coins to spy
4. Spy gave 7 coins to bam
Let’s think SPY-decided to steal money. To hide this, he changed the entries in the dairy
1. Kan gave 3 coins to spider
2. Spider gave 4 coins to wolf
3. Wolf gave 5 coins to spy
4. Spy spider gave 7 coins to bam
HULK noticed that somebody interfered with his dairy. He decided to stop it not to happen again.
- He found a program called a HASH FUNCTION that implies taking an information string of any length and giving out a yield of a fixed length. With regards to digital forms of money like Bitcoin, the exchanges are taken as information and go through a hashing calculation (Bitcoin utilizes SHA-256) which gives a yield of a fixed length. Indeed, even a little change in a string makes a totally new hash.
- How about we perceive how the hashing procedure functions. We are going placed in specific sources of info. For this activity, we are going to utilize the SHA-256 (Secure Hashing Algorithm 256).
- Short for Secure Has Algorithm, the Sha work is a calculation that hashes information, for example, a book document into a fixed-length variable known as a hash. This figured hash esteem is then used to check duplicates of the first information. You can’t reproduce the first from the hash esteem. The SHA capacities incorporate overviews for 224, 256, 384, or 512 bits. Hash keying is otherwise called united encryption. This keying and encryption is a cryptosystem that delivers a ciphertext from plain content.
Now the new dairy as follows
6. Spider gave 10 coins to spy
Again spy planned to change the entries by changing the record and generating a new hash.
6. Spider gave 10 15 coins to spy
HULK noticed that somebody shifted through the dairy again. He decided to complicate it so After each record, he inserted a hash generated from the record+last hash. So each entry depends on the previous.
In the event that Spy attempts to change the record, he should change the hash in every past section. Be that as it may, Jack truly needed more cash, and he spent the entire evening tallying every one of the hashes.
Be that as it may, HULK would not like to surrender. He chose to include a number before each record. To the hash esteem, it will include four zeros and gives the hash estimation of the predefined information. This number is classified as “Nonce”. A nonce is a truncation for “number just utilized once,” which is a number added to a hashed—or encoded—obstruct in a blockchain that, when reiterated, meets the trouble level confinements. The nonce is the number that blockchain diggers are tackling. At the point when the arrangement is discovered, the blockchain excavators are offered digital money in return.
- Nonce or a “number just utilized once,” alludes to the main number a blockchain digger needs to find before unraveling for a square in the blockchain.
- Once the mathematical computations are solved by the miner, they are the gifted cryptocurrency for their time and skill.
- The nonce is difficult to find and is considered a way to weed out the less talented crypto miners.
- The universe of crypto mining is testing, and one regularly needs the superb computational capacity to try and start to attempt to illuminate the nonce
It is mainly used while updating the block into the blockchain. If you need to change the one block then the remaining blocks attached next to it are also be changed and to update each block it takes 10 minutes of time.
In general, the nonce looks like above now let’s add some data on block 2 and will check what will happen
As we change little data in block 2 rest of the blocks also get changed even though there are no changes in block 3 and 4 we can see the hash value gets changed. So it’s difficult to change.
- The hash depends not only on the transaction but on the previous transaction’s hash.
- Indeed, even a little change in exchange makes a totally new hash.
>Now, to forge records, the spy would have to spend hours and hours choosing Nonce for each line.
>More importantly, not only people but computers can’t figure out the Nonce quickly.
1. Afterward, HULK understood that there were such a large number of records and that he couldn’t keep the journal like this eternity. So when he composed 5,000 exchanges, he changed over them to a one-page spreadsheet. KAN watched that all exchanges were correct.
2. HULK spread his spreadsheet journal more than 5,000 PCs, which were everywhere throughout the world. These PCs are called hubs. Each time an exchange happens it needs to be approved by the hubs, every one of whom checks its legitimacy. When each hub has checked an exchange there is a kind of electronic vote, as certain hubs may think the exchange is substantial and others think it is a cheat.
3. The nodes alluded to above are PCs. Every hub has a duplicate of the advanced ledger or Blockchain. Every hub checks the legitimacy of every exchange. In the event that a lion’s share of hubs states that an exchange is substantial, at that point it is composed into a square.
4. Now, if SPYchange one entry, all the other computers will have the original hash. They would not allow the change to occur.
- The nodes check to ensure an exchange has not been changed by investigating the hash.
- On the off chance that an exchange is affirmed by a lion’s share of the hubs, at that point it is composed into a square.
- Each square alludes to the past square and together make the Blockchain.
- A Blockchain is successful as it is spread over numerous PCs, every one of which has a duplicate of the Blockchain.
- This one spreadsheet is known as a square. The entire group of squares is the Blockchain. Each hub has a duplicate of the Blockchain. When a square arrives at a specific number of affirmed exchanges then another square is shaped.
- The Blockchain refreshes itself like clockwork. It does so naturally. No ace or focal PC train PCs to do this.
- When the spreadsheet or record or library is refreshed, it can never again be changed. Hence, it’s difficult to manufacture it. You can just add new sections to it. The library is refreshed on all PCs on the system simultaneously.
HOW BLOCKCHAIN WORKS:
While working with the peer-to-peer network we don’t need a central server. Presently we are using a server in between for example: if we need to transfer money to someone then we will use Phonpe, Tez. Which is a central server that keep a record all of our transactions? Now it’s very easy to hack the central server are we can’t believe a third party because we are giving our details to the third party. So we are using a new technology named BLOCKCHAIN. It’s a peer-to-peer network(p2p) that is not new it was already in use, for example, NAPSTER which works on the p2p network.
While working with the peer-to-peer network we have 4 concerns
Suppose a person A needs to send a message to B to let it be a normal message. So the message is confidential like bank details in the server he is sharing. A third person C says that A is sending a message to B and he will read it from the server. That the thing we don’t want it to happen no one should read our message. Our data should be confidential.
If A sends a message to B let it be “hi let have dinner at 8 pm”. If C comes in middle and if read the message then no problem but if he changes the message like “hi let have dinner at 7.30 pm”. Now B doesn’t know that C actually changed it he thinks actually A sent the message. Here we lose integrity.
If A sends a message to B let it be “hi let have dinner at 8 pm”. If B is not stood up later if A says I didn’t send any message. There we should have proof that A actually sends a message to B.
If A sends a message to B let it be “hi let have dinner at 8 pm”. What is the proof that actually A has sent the message either C can send the message in place of A there is a guaranty who sends a message?
In order to overcome these concerns we use cryptography
It means that writing something in a non-readable format so only the receiver should able to read the message. So we are using this cryptography
It is done with encryption and decryption. Encryption means converting a text into a non-readable format or ciphertext Decryption means converting non-readable format to readable format by using a key.
For example: If A wants to send a message to B then A will encrypt the message and the encrypted message is shared to read that the receiver needs to decrypt the message. If C tries to read he can only able to read the encrypted message because he won’t have the key to decrypt the message.
While working with encryption and decryption we have two types of cryptography
- Symmetric key cryptography
- Asymmetric key cryptography
SYMMETRIC KEY CRYPTOGRAPHY
If A wants to send a message to B then A will encrypt the message with key K1 and to read it B will decrypt the message with the same key K1. Now if again A wants to send a message to C the A uses another key to encrypt the message let it be K2 and then to decrypt message C uses the same key K2. If C needs to send a message to B then C will encrypt the message with key K3 and B decrypt the message with the same key K3. As the nodes or persons get increased then the keys also get increased.
That’s the drawback of symmetric key cryptography. So we will move to Asymmetric key cryptography
ASYMMETRIC KEY CRYPTOGRAPHY
Here for everyone, there will have two keys one is PUBLIC KEY and another one is PRIVATE KEY.
- Suppose if A want sends message to B then A will encrypt the message with B public key and B will decrypt will B’s private key. A public key means everyone will be known where the private key means only the person will be known.
- So here, we can achieve security how means we will encrypt the message with the public key and decrypt it with its own private key.
- Here we can also achieve the 4 concerns of the p2p network. How means we are encrypting the message so the third person can’t able to read and modify the message we can achieve confidentiality and integrity. To achieve authentication we will use DIGITAL SIGNATURE.
Here to achieve authentication we will encrypt the message with the private key of the sender and again we will encrypt the encrypted message with the receiver public key.
- Because for example if A send a message to B. Now at 1st A will encrypt the message with his private key in order to show identification that actually A sends a message as A private key is a personal one. Now A’s public was known to everyone so others can decrypt it to not be done it again the encrypted message is encrypted with B’s public key so B has his own private key to decrypt.
- Now while decrypting at 1st B decrypt with his private key and again he will decrypt it with A’s public key.
- If the third person tries to do any modifications it will not be done.
- So now we achieved all the concerns and provided security. Whenever the transactions are done it will be done in this method.
- Accord conventions are one of the most significant and progressive parts of blockchain innovation.
- These conventions make a verifiable arrangement of understanding between different gadgets over a circulated system while counteracting abuse of the framework. Here we will investigate how these frameworks work and how different conventions vary from each other.
- Blockchain consensus protocols are what keep all the nodes on a network synchronized with each other while providing an answer to the question: how do we all make sure that we agree on what the truth is?
- After all, anyone can submit information to be stored onto a blockchain and therefore it is important that there are review and confirmation, in the form of a consensus about whether to add that information.
What is the protocol?
A set of rules describing how the communication and transmitting of data between electronic devices, such as nodes, should work. These rules need to be defined before any data is sent, detailing how the information will be structured and how each device will send or receive it.
- As a term, ‘consensus’ means that the nodes on the network agree on the same state of a blockchain, in a sense making it a self-auditing ecosystem. This is an absolutely crucial aspect of the technology, carrying out two key functions. Firstly, consensus protocols allow a blockchain to be updated, while ensuring that every block in the chain is true as well as keeping participants incentivized. Secondly, it prevents any single entity from controlling or derailing the whole blockchain system. The aim of consensus rules is to guarantee a single chain is used and followed.
Consensus Protocol Rules
- Consensus rules are a specific set of rules that nodes on the network will ensure a block follows when validating that block and the transactions within it. The key requirement to achieve a consensus is a unanimous acceptance between nodes on the network for a single data value, even in the event of some of the nodes failing or being unreliable in any way.
- Every cryptocurrency must have a way of securing its blockchain against attacks. For example, an attacker may attempt to spend some money and then reverse the transaction by broadcasting their own version of that blockchain, not including the transaction. This is known as a double spend. As blockchain technology does not rely on a central authority for security, users have no prior knowledge which version of the record is valid.
- Consensus protocols also provide participants on the network who are maintaining a blockchain with rewards and incentives to continue doing so. These rewards come in the form of cryptocurrencies or tokens, which can be extremely lucrative, so much so that competition to confirm the next block in a chain is extremely fierce.
Now lets see the architecture how block is added in the blockchain
1. Greater transparency
Transaction histories are becoming more transparent through the use of blockchain technology. Because blockchain is a type of distributed ledger, all network participants share the same documentation as opposed to individual copies. That shared version can only be updated through consensus, which means everyone must agree on it. To change a single transaction record would require the alteration of all subsequent records and the collusion of the entire network. Thus, data on a blockchain is more accurate, consistent and transparent than when it is pushed through paper-heavy processes. It is also available to all participants who have permission access. To change a single transaction record would require the alteration of all subsequent records and the collusion of the entire network. Which can be, you know, a headache.
2. Enhanced security
There are several ways blockchain is more secure than other record-keeping systems. Transactions must be agreed upon before they are recorded. After a transaction is approved, it is encrypted and linked to the previous transaction. This, along with the fact that information is stored across a network of computers instead of on a single server, makes it very difficult for hackers to compromise the transaction data. In any industry where protecting sensitive data is crucial — financial services, government, healthcare — blockchain has an opportunity to really change how critical information is shared by helping to prevent fraud and unauthorized activity.
3. Improved traceability
If your company deals with products that are traded through a complex supply chain, you’re familiar with how hard it can be to trace an item back to its origin. When exchanges of goods are recorded on a blockchain, you end up with an audit trail that shows where an asset came from and every stop it made on its journey. This historical transaction data can help to verify the authenticity of assets and prevent fraud.
4. Increased efficiency and speed
When you use traditional, paper-heavy processes, trading anything is a time-consuming process that is prone to human error and often requires third-party mediation. By streamlining and automating these processes with blockchain, transactions can be completed faster and more efficiently. Since record-keeping is performed using a single digital ledger that is shared among participants, you don’t have to reconcile multiple ledgers and you end up with less clutter. And when everyone has access to the same information, it becomes easier to trust each other without the need for numerous intermediaries. Thus, clearing and settlement can occur much quicker.
5. Reduced costs
For most businesses, reducing costs is a priority. With blockchain, you don’t need as many third parties or middlemen to make guarantees because it doesn’t matter if you can trust your trading partner. Instead, you just have to trust the data on the blockchain. You also won’t have to review so much documentation to complete a trade because everyone will have permission access to a single, immutable version.