Showing posts with label protocol. Show all posts
Showing posts with label protocol. Show all posts

Tuesday, 6 November 2018

Trust Trail in blockchain

  1. Validate Transaction -->
  2. Verify Gas and Resources -->
  3. Select set of transactions to create a block -->
  4. Execute transaction to get a new state -->
  5. Form a new block -->
  6. Work toward consensus -->
  7. New block added to chain and confirmed (finalize the block by the winner)


Consensus Protocol
At step 5 i.e. forming a new block, A PoW is computed. PoW stands for Proof of Work, and it uses hashing as well.
PoW is a puzzle to be solved by the miners.
PoW is used as consensus protocol by Bitcoin and Ethereum Byzantium Metropolis Blockchain.




Exceptions in the blockchain:
  1. More than one miner solves the consensus puzzle - Fork
They are asked to form further blocks. It is a very low probability that both will form another block at the same time. So this breaks the tie and the chain of new blocks are added to the original chain.
Ethereum gives runner-up incentives to the miners who built the block. Runners-up are called Ommers.

  1. More than one transaction references as input, the same digital asset - Double Spending.
In Bitcoin, the transaction referring to the asset first is considered valid transaction and rest of the transactions referencing the asset are rejected.
In Ethereum, a combination of account number and global nonce is used to address the double spending issue.
Every time a transaction is initiated by the account, a global nonce is included in the transaction. After that nonce is incremented. Timestamp and nonce in the transaction should be unique and verified to prevent the double spending problem.

Fork

Well managed forks help build credibility in the blockchain by providing approaches to manage unexpected faults and planned improvements.

Soft fork is like the release of software patches to existing software
Hard fork is like the release of a new version of the operating systems

Recent hard fork in Ethereum which was a change from Homestead to Metropolis Byzantium version. Oct 17, 2017.
PoW protocol still stays, except that, every 100 blocks, PoS consensus protocol is applied for evaluating the latter.
And Miner incentive was reduced from 5 Ethers to 3 Ethers for block creation.

After a hard fork, the emerging two chains are incompatible with each other.

Unplanned hard fork in Ethereum protocol -  Ethereum Core and Ethereum Classic split to address critical software issue in DAO application that resulted in a 150 Million dollar heist.



Sunday, 9 September 2018

Blockchain basics

→ Blockchain is a decentralized, incorruptible digital ledger that can record transactions (like, but not limited to, financial transactions) directly among peers without having involvement of a third party or centralized system. 

As an analogy, it can be thought of as a distributed database that maintains a shared list of records. These records are called blocks. Each encrypted block holds the history of blocks that came before it, with timestamped transaction data which chain the blocks together and hence termed as blockchain.

The blockchain is also called public ledger because it is openly available for everyone to read.

Its main characteristics are:

  1. Decentralized peer to peer network
  2. Establishing trust among unknown peers
  3. Recording the transaction in immutable, distributed ledger
How is trust achieved?
  1. Validate, Verify and confirm transactions
  2. Record the transactions in a distributed ledger of blocks
  3. Create a tamper-proof chain of blocks
  4. Implement a consensus protocol for agreement on the block to be added in the chain


Distributed Ledger

In its simplest form, a distributed ledger is a database held and updated independently by each participant (or node) in a large network. The distribution is unique: records are not communicated to various nodes by a central authority but are instead independently constructed and held by every node. That is, every single node on the network processes every transaction, coming to its own conclusions and then voting on those conclusions to make certain the majority agree with the conclusions.
Once there is this consensus, the distributed ledger has been updated, and all nodes maintain their own identical copy of the ledger. This architecture allows for a new dexterity as a system of record that goes beyond being a simple database.


From <https://www.coindesk.com/information/what-is-a-distributed-ledger/