Season 3 | Week 6 | Crypto academy | Homework task for professor @stream4u
What is Blockchain and how does it work?
Basically, Blockchain is the technology that enables the existence of cryptocurrency . Bitcoin is powered by Blockchain technology which makes is much more valuable and powerful.
You can even understand by its name which contains words "Block" And "Chain", means blocks Are created and connected with the next block in a "Chain" sequence, by validating previous blocks,alternatively a Chain made up on blocks.
The data recorded is transparent which provides more trust and the data is "Immutable" which provides more security to the chain.
So now you understand that blockchain is decentralized in nature, it's a peer to peer distributed ledger, it records the data of transactions in an encrypted way so that it can't be changed which definitely reduces risks.
Blockchain technology is an open distributed ledger that can record transactions of two parties securely and efficiently
Components included
(a). Block - Blocks are the intangible Digital files. Block has all data of recent transaction as well. Basically block is a file of permanently recorded data means it can't be undo once written because of its decentralized nature.
In bitcoin a new block is mined approximately every 10 minutes, the Data From the block is added to ledger and to help validate the transaction easily all the nodes on the network gets a copy of the Ledger, This helps the miners to validate the transaction.
In the "Chain" many blocks can be found but each "block" has these things -
Data Which Available in the block in the form of ledger, which once written then can't be change.
A 32 - Bit number which is known as "Nonce" (A number which is only used once to keep it unique) it's randomly generated along with the new block, then with the input data it generates a unique encrypted text called "Hash"
And finally a 256 - bit protected Hash which is encrypted from the input data of the block, and a valid hash always starts with some zeroes(000).
(b). Nodes - In the simple language the nodes Are the computers that are connected to the chain which helps in running the network smoothly, Because of decentralized nature it's not stored just a one place but at different locations because it's public so anyone with a internet and a heavy computer can join the network and became a node, nodes also helps in maintain a copy of the data sent to them when a new block is mined.
(c). Miners - Miners are the people who validates (mine) blocks and their transaction through a process called Mining. These days mining has became complex since it require a heavy software the miner has to solve a mathematical computation for finding a Nonce Which helps to validate the hash of the block but it's not so easy since current hash is connected with the previous hash.
What are the types of Blockchains / Explain in detail the types of Blockchain?
There are four main types of Blockchain networks :-
(a). Public blockchains - Public blockchains also known as "permissionless" blockchain networks, The main advantage of public blockchain is that they aren't controlled by organizations or government authorities. It is decentralized in nature so it provides transparency to its users since the source code is open source.
But there's a disadvantage as well that sometime the public network can be slowed down as many users joining the network and because its decentralized in nature you can't restrict the access of other current users or new users wanting to join.
(b). Private Blockchain - Private blockchain also knows as "Permissioned" blockchains. This type of Blockchain network is used by private organizations which restricts the access to the selected level of authorities, usually it's used on a small scale with limited number of users have access to it.
Private blockchain networks are directly controlled By a single entity or a top level authority of an organization and they can choose whether to share the access or not.
Private blockchain Are very fast in comparison to the public blockchain network since Private network has limited number of users and can easily process transaction real faster than in the public blockchain networks.
(c). Hybrid Blockchain - A hybrid blockchain is a network that have a combination of the private and public Blockchain. In simple words a hybrid blockchain uses the advantages and features of both the Blockchains.
You can have a Public (Permissionless) based network as well as a private (Permissioned) based network. Since its a combination of both you can control whether you want to make entire data public or just a selected part by keeping the sensitive information in the private network.
For example - Xinfin is a Hybrid blockchain which is built on Ethererum (An open source) Public blockchain and "Quorum" which is a private blockchain.
(d). Consortium Blockchain - consortium blockchain also known as "Federated blockchain". This type of Blockchain is similar to a joint venture, this is mostly used by banks or payment systems etc. In this type of Blockchain multiple organization members or organizations make collaboration in a decentralized network and can choose Which information is to be exchange between selected peoples.
For example Three banks A, B and C can have a consortium blockchain, it has selected group participant and no further group can join it and its still decentralized between group A, B and C.
So basically cosortium blockchain is still decentralized but limited to a group of enties which are A, B and C.
What are the benefits of blockchain?
Blockchain technology has many benefits which I'll explain below in :-
Transparency - Transparency one of the comman and biggest concern. Its true that a Decentralized system has more transparency than any centralized network with the help of Blockchain Technology an organization can easily go for a complete decentralized network because they won't need any centralized authority to improve transparency.
As we know blockchain data is a type of distributed ledger means the all the nodes in the network get a copy of the document contain the relevant information. Even if a minor change happens everyone in the network (all the nodes) can see the change and the recorded will be updated so totally transparent.
Security - Along with Transparency blockchain technology also provides high Security, For example in a Centralized data your data is always at a risk since its stored in one place and can be hacked anytime and your sensitive information can be compromised but in Blockchain technology there's no involvement of a third party to store your data since data is stored in a distributed ledger thus provides more security.
Immutability - In the Centralized system You have to trust the owner/authorities that they will not change the data and keep your information secure but like i said centralized network can never be transparent as much ad decentralized network so your information is always at risk but in the Blockchain technology the data once recorded in the network and shared with all the nodes then it's not possible to delete or Reverse and undo a transaction or data.
Fast speed - Blockchain technology is decentralized in nature so there's no involvement of any intermediary to carry out a transaction. Transactions can be easily process by the two parties easily so it speeds up all the process and also eliminates all the paper work unlike the traditional payment methods also no hidden fees at any step and funds are simply transferred to your given address.
Increase efficiency - Implementing blockchain technology can be very helpful, Suppose you run a big organization many transaction happening every hour then you will need to hire more individuals at different levels to manage and keep the track of all the data and the human management can also commit mistake while in the blockchain technology you just to have to trust the algorithm which provides more accurate results and saves all of your money that you will spend in hiring people to audit.
Privacy - In today's generation we are always worried about privacy, people often try to hide their identity. Another benefit of Blockchain technology is that you can hide your identity and make transaction easily being an anonymous because with the block or hash number people can only check the address and the amount of crypto sent not the identity of location from where the transaction was made.
Explain Blockchain Distributed ledger.
Distributed ledgers in blockchain aren't just stored at one place , they are stored at different locations known as "Nodes". If we compare a centralized ledger is more prone to cyber attacks and fraud since it has a single point of failure while manipulating a distributed ledger is almost impossible.
When a transaction is successfully confirmed in the block the detail of the transaction is updated for all the nodes in the real - time and once it's updated then it became immutable to reverse or edit the data so basically once saved it's stored permanently.
It provides more accurate data and has no single point of failure like any centralized ledger, in the blockchain the hash of new block is connected with the previous hash so even with a minor change in the put it will instantly change the hash data. When a transaction is broadcasted the copy of transaction is sent to all the nodes and miners easily validate the block with the given copy of the transaction details.
What Is Blockchain Double Spending and how Bitcoin handles this problem?
Blockchain double spending is one of the main concern in current times, it means spending the same amount of crypto twice, you can also consider it as an attack on the blockchain.
Practically it is not possible in terms of FIAT currency, for example - I went to a grocery store, i purchase some stuff then i paid the bill say 50$, And the owner confirmed the receipt of my payment and handed over me the goods i purchased, but there's a possibility that double spending can occur in the digital currency like bitcoin etc.
How bitcoin prevent double spending
It is possible in blockchain if an attacker is able to take control at least 51% of the total power of the network then they can attempt double spending,after gaining 51% control they could reverse a transaction and create a separate blockchain but today the network has grown so much the nodes are available in all over the world in different locations so 51% is impossible to happen in current time.
Blockchain proof of work mechanism helps in detecting such malicious attempts of double spending of same crypto twice,because bitcoin use SHA - 256 and it every time it generates a unique hash number even a minor change in the input would result in the change of the hash which is connected with a NONCE once a nonce finds a valid hash (starting with many zeroes) then the block is added to the blockchain.
Let's just suppose one want attempt to spend 15 BTC twice by manipulation, he sent same amount of crypto (15btc each) to two Separate bitcoin wallets, now what will happen is both of the processed transaction will go to the pool of unconfirmed transactions (Known as mempool).
Status of both the transaction will remain unconfirmed and the one which gets picked first by the miners will change to confirmed status while the other transaction will be rejected.
however if both transaction are picked at the same time the transaction having highest number of confirmations on the blockchain will be confirmed first. Bitcoin has 6 Network confirmation before its sent and added to the block that's why merchants wait for 6 network confirmations to confirm the receipt of the payment.
Miners uses the hash to confirm the transaction whenever a transaction is broadcast each nodes shares a copy of the transaction data connected with the nonce so it helps the miners validating the transaction.
Practical + Theory, Visit Blockchain Demo and check section Blockchain, then explain in detail how Blocks Hashes Work in Blockchain, what will happen when any middle of the block gets changed, try to give screenshot for each possible details
To illustrate this point i went to the blockchain demo link and then i selected "Hash" and below you can find the screenshot.
Screenshot From the "Hash" Section of Blockchain demo page,showing a randomly generated hash and has no input inside and we received the hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", now we will try to make a change in the input and see what happens next
Now in the next step i have put an input as "Hello, Steemit" and now we received a newly generated hash as "2334315cdad7eb5fd4382d5df9c0815451d02bed2b9b663b77bd981988320065"
In the next step i have tried add more input to see what changes occur in the hash, as you can see even with a huge change in the input the "Length" of the hash is almost the same just changed numbers. I have written input as"Hello, Steemit, Now lets test this with a large text to see the new changes occurred in the data when we added additional data." And then we received a new generated hash "c4bba5d735630da51144aced30f192529241a01ad1c8a5979e8b8ab363130e08".
We observed that every time we make any minor or huge change in the input the hash is changed everytime, now lets explore the "Blockchain" page of the blockchain demo
This is page you will see when you go to the "Blockchain" Tab. There you can see that Block 2 has the hash of the previous block and a newly generated hash for block 2 itself you can also obverse that both blocks have different "Nonce"
You can also see the The previous hash in the block 1 is "0000000000000000000000000000000000000000000000000000000000000000" it's because the first block ever mined in the blockchain is termed as Genesis block and also has a Hash for Block 1 As "000015783b764259d382017d91a36d206d0600e2cbb3567748f46a33fe9297cf".
In the Block 2 You can see it has the Previous hash of Block 1 Which was "000015783b764259d382017d91a36d206d0600e2cbb3567748f46a33fe9297cf" And a new generated hash for block 2 itself "000012fa9b916eb9078f8d98a7864e697ae83ed54f5146bd84452cdafd043c19".
Now you can see the same things just like Block 1 and 2, Block 3 Has the Previous hash Of Block 2, and Block 4 Has the Previous hash Of Block3, so you can see how the block are linked with the chain with previous hash of earlier mined blocks.
Let's see in more details Block 3 has a previous hash of Block 2 Which was "000012fa9b916eb9078f8d98a7864e697ae83ed54f5146bd84452cdafd043c19", and a hash for Block 3 Itself as "0000b9015ce2a08b61216ba5a0778545bf4ddd7ceb7bbd85dd8062b29a9140bf"
Similarly Block 4 Has a previous hash of Block 3 Which was "0000b9015ce2a08b61216ba5a0778545bf4ddd7ceb7bbd85dd8062b29a9140bf" and a newly generated hash for Block 4 Itself which is "0000ae8bbc96cf89c68be6e10a865cc47c6c48a9ebec3c6cad729646cefaef83" , you can clearly see how the blocks are interlinked with the previous blocks.
Now i have tried to change the input of block 1 and 2, and you can see The hash for both Blocks has now changed but algorithm still the same that block 2 using the previous hash of block 1.
I have added a input "Lets Try it." in the Block 1 And i received a new generated has which is "1c50b2374668ecc500bb37b1b60b9376856f295ad644aedc81e6a65619079f1c". Which is an invalid Hash since a valid hash always starts with Zeroes.
I have added a input "Once again." In the Block 2 And i received a new generated hash for block 2 which is also an invalid hash "0aa103bf706e30863af13f1ec50b9e79971b3f953220d3d87efa72d4bacfbb2a" But you can see that block 2 also has the Hash of the block 1 As previous hash which was" 1c50b2374668ecc500bb37b1b60b9376856f295ad644aedc81e6a65619079f1c".
As you can observe i only changed the input data "Nonce" Is still the same in the block which means all the information should be correct to mine a block. It indicates A Nonce gets connected with unique hash number so even with a correct hash you will still need correct Nonce in order to mine the block.
Now i have tried to Change the Nonce Of the Block 1 & 2, and this time A new hash is generated for both blocks although the Input data is still the same.
In the block 1 I have changed the Nonce to 11100 And a new hash generated which is "5e93fe6057a05610cf50b1e070fdef62677fdf35d831bec0ff30faa45974c187".
In the block 2 i have changed the Nonce to 14500 And a new hash generated for this Nonce as "611d679bee928e70897dd162211da2593c8978a0415796b9cc67bf22274dff9d",.
you can observe that both hash are invalid since none of them is starting with many Zeroes(000)
Now i attempted to Try to change the Nonce Myself but i still got invalid hash in result.
In the Block 1 i Changed the Nonce to "143543" And got a new generated hash which is "0cdc43a93d9066687279cd5501ad920b685c3682f201e220e691c9dff4bc76f5".
In the Block 2 i Changed the Nonce to "321123" And got a new generated hash "a5b7224333eebf08833031e4e823010210052972e153c62610f3fbfc8cfccfbb" Which is still invalid.
Now when i clicked on "Mine" It automatically generated a new Nonce and Hash for Block 1 and Block 2.This time we got valid hash for both blocks.
For Block 1 I got a new Nonce "203777" And a newly generated hash "00008bfce8d2d857d55fe5fe0119dab640642d978ea419aecc9489cc5786e202", which is a valid Hash since it's starting with many Zeroes.
For Block 2 I got a new Nonce "349847" And and a new generated hash "000058f1a44e426b634d13c9336e2a1fc92879195422cb52df09ca8297a72360" Which is also a valid hash starting with many Zeroes(0000).
If any middle block gets changed, then it will have to be re-mined, Fundamentally a Blockchain follows the correct order and sequence of Blocks and each of them is interlinked with the previous block, containing the hash of the previous block. When you alter the data of any block it will change the hash as well, so in other words, blockchain has to be re-mined
What Is Race Attack in blockchain? OR What Is Finney Attack in blockchain? OR What Is Vector76 Attack in blockchain?
For this I'll explain the race attack, according to my research races attack is pretty much similar to the double spending in digital currency. In the race attack a person sends two transactions of same crypto amount to different address with the intention of Double spending.
Let's understand this with an example, suppose i want to buy some goods worth 1 BTC from a merchant so I'll broadcast two transaction of same amount (1 BTC Each) at the same time with two different nodes, now the merchant believes me so he will send the goods to me without waiting for the network for all confirmations of the transactions since bitcoin transaction requires 6 Network confirmations.
Now whichever transaction gets picked first by the miners will be validated first while another transaction will be considered invalid.
So to avoid being scammed like this we should always wait for all the network confirmation then only release the goods or service you are trading.
Limitations/disadvantages of Blockchain.
Less Scalability - Scalability is also an issue in the blockchain, some blockchains aren't scalable as they are supposed to be, Since it's public network so anyone with internet access and a machine can join the network and became a node so the chances of slowing down the network is high here hence makes it lesson scalable.
Energy consumption - As we all know mining of digital assets like bitcoin consumes an extreme amount of energy, This has been an issue for a long time now. The overall consumption of bitcoin mining energy is sometime more than the total energy consumption of some small countries.
For example - Recently CEO of Tesla "Elon musk" Stopped payments of bitcoin to purchase tesla because it consume too much energy. So this is another main disadvantage here that not everyone will be able to generate that much energy to spend on mining bitcoin.
Irreversible - Yeah this could also be an disadvantage, sometime in rush you may enter or paste a wrong address This will result in funds sent to a wrong address, since the data once recorded in the system is immutable no solo entity can make any change in the data so you may lose all your funds.
But if we compare it with the traditional systems like banks there you could file a charge back and get your funds back in case you sent them to a wrong address.
High fees - In chains like Ethererum you have to pay high gas fees to make the ERC-20 payments, even if the amount is small you will still have to pay huge fees, and if you pay less gas fees your transaction may get failed, hence another disadvantage to the blockchain.
Conclusion(Overall understanding of Blockchain.)
In my conclusion i understood that blockchain Is totally decentralized and the data recorded in the blockchain is immutable Once written can't be changed so ads an extra layer of security in comparison to the traditional payment methods.
Blockchain is going to be very useful in the upcoming days, still in many countries Cryptocurrency is declared illegal but they don't know they can use Private blockchains to manage their data that will save all the time and will even get more accurate data.
Indeed blockchain has both advantages and disadvantages but almost everything has both merits and demerits, Blockchain is good for future considering all its advantages.
Thanks @stream4u professor for this lecture, hope to learn more from you in the upcoming days.
yamgo You can earn rewards by completing simple tasks like watching videos or playing games, doing your online shopping or browsing the web. It’s free and easy!
Register here: https://yamgo.com/
#yamgo #yamgotv #paid #airdrop #blockchain #cryptocurrency #platform #reward #crypto #assets #HBAR
#digitalassets #consumer #AdsDax #freemoney
Hi @rishabh99946
Thank you for joining The Steemit Crypto Academy Courses and participated in the Homework Task.
Total | 10/10
Your Homework Task verification has been done by @Stream4u, hope you have enjoyed and learned something new.
Thank You.
@stream4u
Crypto Professors : Steemit Crypto Academy
#affable