Introduction To Blockchains
Introduction To Blockchains
• For beginners
• To get enlightened about consensus and the need for consensus in a blockchain
• Comprises of 3 components
• Code
• State
• Data
— Naval Ravikant
• Crypto-economy
3 basic components
Forged by consensus
• Trust
• Accountability
• Transparency
According to Hyperledger
Smart contracts are computer programs that execute predefined actions when certain
conditions within the system are met.
Consensus refers to a system of ensuring that parties agree to a certain state of the
system as the true state.
Subset of DLT
Block - set of transactions that are bundled together and added to the chain at the same time
• Timestamp
• If the data is tampered with anywhere in the chain, the links will break
• Record of an event, cryptographically secured with a digital signature, that is verified, ordered,
and bundled together into blocks
• Cryptography has a key role to play both in the security, as well as in the immutability of the
transactions recorded on blockchains.
Blockchains Databases
Consensus
and Verify
Reference Number
Input Output
UTXO1 UTXO1
UTXO2 UTXO2
UTXO3 UTXO3
UTXOn UTXOm
• Value
• References to one or more output UTXOs newly generated by the current transaction
Input UTXO
Output UTXO
Total amount spent
USER MINER
• Transfer of values by
creating transactions • Verify transactions
• Broadcast transactions
• Compete to create a block
• Reach consensus by validating block
• Broadcasting new block
• Confirm transactions
Transaction
added Verify new Solved block
block broadcast
Rejected
Transaction New block
added to
chain and
confirmed
Blockchains (based
on application)
Blockchains
Hardware
• Data
• Both the blockchains use Elliptic-Curve Cryptography rather than using RSA
• 256 bits ECC key pair 3072 bits RSA key pair
Account Addresses
Digital Signature
Transaction Hash
Receipt Hash
Block Header Hash
• Authorized
• Non-repudiable
• Unmodifiable
• Timestamp
• Nonce
• Account Balances
• Sufficiency of Fees
60
41 19
10 31
10 21
4 6
• Ensures that the data on the ledger is the same for all the nodes in the network
• Proof of Work
• Proof of Stake
• Proof of Authority
• Requires a huge amount of energy to be expended, given the computationally heavy algorithm
Proof-of-work (PoW) is the outcome of a successful mining process and, although the proof is hard to create, [it] is easy to
verify.
Block Header
Element Nonce
(BHash)
Change
H=Hash(Bhash, Nonce) Variable
Nonce
Solved winner
adds block to the
H<F(Difficulty)
blockchain
Broadcasts Block
• Nodes are known as the 'validators‘ that validate the transactions to earn a transaction fee
• PoS algorithm saves expensive computational resources that are spent in mining under a
PoW consensus
• Developed by Intel
• The validator with the shortest wait time for a particular transaction block is elected the
leader.
• Uses a set of 'authorities', which are designated nodes that are allowed to create new blocks
and secure the ledger
Decentralization
UTXO
Smart Contract
EVM
Merkle Tree
Proof of Work
http://hyperledger.org/about
https://github.com/hyperledger-archives/education/tree/master/LFS171x
https://hbr.org/2017/02/a-brief-history-of-blockchain
https://www.investopedia.com/terms/m/merkle-root-cryptocurrency.asp
http://chimera.labs.oreilly.com/books/1234000001802/ch07.html
#_structure_of_a_block