Sunday, 17 December 2017

Basics of Blockchain, Bitcoin, Cryptocurrency, Mining. Security in Blockchain and possible attacks against Blockchain? Use of Blockchain in Real life?



·       Blockchain

What is Blockchain?

Definitionà  Blockchain is a consensus based secure Decentralized Public Database which stores information in the form of Transaction (immutably) over peer-to-peer network.
*Highly Secure - more secure than traditional storage.
*Data gets recorded via Consensus based Algorithms.

Real life example of Blockchain

*Bank account statement or a large size book.
Imagine it as a book, where
Book = Blockchain, Page = Block, an entry in page = blockchain transaction
*In Blockchain each block is built on top of the recent block and use its previous block’s content/signature + Nonce (random string).

Real life usage of Blockchain

*Blockchain can be used when you want to store something immutably. When things keep adding but older one does not change. For e.g. Health Records, Court Judgments etc.
*When decentralize control needed for e.g. User identity management system.


·       Bitcoin

*Bitcoin is the cryptocurrency built on top of Blockchain technology.
*Bitcoin remove the dependency on trusted third party to execute the transaction (this is the nature of a blockchain).
*Transaction gets executed by peers based on consensus based algorithm & recorded in the Blocks by the miners.


·        Mining

*Is the process to solve a very complex computation problem to identify that next block in the Blockchain. (in simple words "Miners identify and adds the next block to the existing Blockchain." or "Mining is the process of recording the transactions as a block into the Blockchain of that currency.")
*It takes time and computational power (distributed globally) to add a Block in the Blockchain. Hence there is a reward (12.5 BTC in case of Bitcoin Blockchain, 5 ETH in Ethereum)

What exactly the miners do?

*They identify a random number through which they can create the digest of the next block in such a way that the new digest is less that the most recent digest and this is very difficult to identify. (They do so many hit and trial and most of the time 100% CPU gets utilized in this process, that’s why they need very powerful CPU's.)

·        Consensus Algorithm

*Consensus Algorithm is some set of rules to avoid conflicts. In more formal way "Computation methodology of resolving conflicts in Blockchain."

·        Blockchain: a brief summary

*It is decentralized data structure where data is being stored inside blocks in the form of transactions.
*In Public Blockchains more complex algorithms are required to avoid malicious activities. (because each block is built on top of the previous Block, the immutability has been achieved.)
*Every participant of the Blockchain contains same copy of the Blockchain.


Security in Blockchain and Cryptocurrency

*In public Blockchain it is made computationally difficult to add a block to prevent attacks against it.
*Nodes follow “Longest chain rule” (to avoid conflicts and to make it more secure).
*For e.g. a chain currently have 100 Blocks and node 23 decides to alter the Block number 23. Changes will be made locally at that computer and all the node after 23 will be invalid at that computer.
*Broadcasting that node will not help because other nodes are following longest chain rule and will reject the smaller chain 0-23, and will chose 0-100.

What if the attacker creates remaining blocks from 24 till 101 and make everyone accept that fake chain?

*In public Blockchain networks it is computationally very very expensive and time consuming to create a Block. In case you want to fake that you should be having thousands of super computers and tons of money.
*There are many honest nodes in the network and faking a transaction will not help, as it will be rejected by honest nodes.
*Now let’s say even if you can afford to fake a block, the new block will have no effect as the transaction in that fake block will be rejected by other honest blocks in upcoming Blocks.


Possible Attack against the public Blockchain

·        51% Attack

*If an attacker can contribute the majority (51% or more) of the network’s mining hashrate, then the attacker would have power to manipulate the public ledger. (Often considered a very large Flaw in public Blockchain)
*It is theoretically possible because Blockchain is publically open, but it will be a very very costly attack.

·        Eclipse Attack

*If the attacker can place a node in such a way that it cannot talk to other nodes in the network, in that case less %tage owner of network hashrate can launch the attack.
*Let’s say there are (03) three nodes with 40%, 30% and 30% network hashrate power. If the node 2 is placed in such a way that it cannot talk to node 1 and node 3 can control the Blockchain’s public ledger.

Basics of Blockchain, Bitcoin, Cryptocurrency, Mining. Security in Blockchain and possible attacks against Blockchain? Use of Blockchain in Real life?

·        Blockchain What is Blockchain? Definition à   Blockchain is a consensus based secure Decentralized Public Database ...