Working Mechanism of Blockchain
According to the
Satoshi Nakamoto, this kind of networks works as follow4:
All new transactions are broadcasted to all
All broadcasted transactions are collected in a
block by the nodes.
Every node try to figure out the proof-of-work
for the block.
The node who figured out the proof-of-work
broadcast the block to all the nodes.
All the nodes accepts the block if the
transactions are valid.
The hash of the accepted block is used as the
previous hash to create a next block in the chain.
network use consensus mechanism called PoW (Proof-of-Work). In Proof-of-work,
miners can choose the transactions which needs to be included on the basis of
the commission or value given to them. All the nodes in blockchain compete to
solve the computational problem to mine a block. The first node who solve the
problem gets an authority or right to mine a block. Proof-of-Work algorithm is
used to solve the computational problem. It can have number of implementations
e.g. Bitcoin uses the Hashcash variation of Proof-of-Work4.
All the miners
compete with each other to find a hash value from the block’s header and nonce
value in order to form a block. Current target value should be higher than that
of the resulting hash value. A target is of 256 bit value which is known to all
nodes. The creation of new blocks are controlled by the value. Initial value of
nonce set to 0 when hashing process starts by each node. If the resulting hash
value is lower than the target, the nonce value is increased and the process is
repeated. The process of hashing is like a lottery where any node in a network
can win and get an authority to mine a block. And the other nodes have to
verify that if this particular node has correctly generated the hash or not. So
the verification of hash provides the Proof-of-Work done by this node4.
Proof-of-Work, to validate the transactions and to create new blocks, users
have to do computational work which needs a lot of energy or power. Whereas in
Proof-of-Stake, users have to show ownership of certain amount of
cryptocurrency. PoS (Proof-of-Stake) is an energy-saving alternative to PoW. In
PoS, a large group of distributed users are continuously verifying the hashes
of transactions through the mining process. In order to update the current
status of the blockchain assets, PoS requires users to repeatedly prove
ownership of their own share in the underlying currency. The selection based on
account balance is quite unfair because the one with more stake could dominate
the network. Ethereum is planning to move from EthHash (close to PoW)37 to Casper(close to PoS) 36.
3.3 Ethereum Blockchain
another implementation of blockchain technology, with support of Smart Contracts.
The cryptocurrency for the ethereum is known as Ether. The idea of gas is used
in ethereum for the execution of transactions. The execution stops when it runs
out of gas. The gas can be purchased with ether, but it is quite low because it
can be purchased in Wei where 1 Ether=
Wei. A transaction can be anything from
execution of Smart Contracts to transfer of funds between the accounts. So, if
user X is transferring E amount of Ether to user Y then it is actually
transferring “E+default gas price” (where default gas price is calculated by
the actions involved to execute the transaction i.e. SHA3 and amount of data
present in the transaction). 6 gas unit is needed to hash 256 bit of data. This
transaction cost is the inclusion price for this transaction to be included in
a block which is being mined by a miner. The extra gas after the transaction is
given to the miner in addition to the mining reward. A miner has a liberty of
choosing, which particular transaction he wants to include in a block. Hence, extra
gas means there is higher chances of transaction to be mined early. Not sending
enough gas with the transaction means the long transaction time.