Block Chain VII Lecture Notes PDF
Document Details
Uploaded by PositiveYellow
Symbiosis International (Deemed University)
Dr. Tamal Mondal
Tags
Summary
This document is a lecture on block chain technology and details creation of coins in Bitcoin, transaction details, and consensus to avoid double spending attacks within a digital currency context. The lecture notes introduce Bitcoin scripts and their use in transactions.
Full Transcript
Block Chain Technology Dr. Tamal Mondal Lecture VII Symbiosis International (Deemed University) Session Objectives By the end of this session, you will be able to: Creation of Coins in Bitcoin and Regulations – Figure out the limitations in the creation of this digital curr...
Block Chain Technology Dr. Tamal Mondal Lecture VII Symbiosis International (Deemed University) Session Objectives By the end of this session, you will be able to: Creation of Coins in Bitcoin and Regulations – Figure out the limitations in the creation of this digital currency and how it will affect the mining process. Bitcoin Transaction Details – Understand the concept of anonymity and Bitcoin script used to perform the transactions in Bitcoin environment. Transactions & Mining in Bitcoins – Understand how the payment procedure has been taken into consideration in Bitcoin. Bit Coin Consensus & Elimination of Double Spending Attack– Introduce Bit Coin Consensus & how the double spending can be avoided in Bitcoin. Creation of Coins & Régulations Controlled Supply: Must be limited for the currency to have value. Any maliciously generated currency needs to be rejected by the network. Bitcoins are generated during the mining i.e. when the miner discovers a new block. The rate of block creation is adjusted every 2016 blocks to aim for a constant 2 week adjustment period. The number of bitcoins generated per block is set to decrease geometrically, with a 50 % reduction for every 210,000 blocks (It takes approx. 4 years). This reduces with time, the amount of bitcoins generated per block. o Total limit of the Bitcoins: Slightly less than 21 million o Miners will get less reward. Creation of Coins & Régulations Sending Payments in Bitcoin Anyone can’t spend Bitcoin owned by others. Bitcoin uses public key cryptography to make verify digital signatures. Each person has one or more addresses each with associated pair of public and private keys (holds in bitcoin wallet). Alice wants to send Bitcoin to Bob Alice adds Bobs address and amount of Bitcoins to transfer in a transaction message. Alice signs the transaction with her private key, and announces her public key for signature verification. Alice broadcast the transaction on Bitcoin network for all to see. Bitcoin Anonymity Permissionless Public and private keys do not need to get registered. Wallet will generate then for users. Bitcoin address is used for transaction, not the user name or identity. A Bitcoin Address – mathematically corresponds to a public key based on RSA (let’s assume) – the digital signature algorithm used in Bitcoin. Bitcoin address = Hash160 (Public Key Generated for Alice) Each person can have many such addresses, each with it’s own balance and it’s difficult to guess which person owns what amount. Bitcoin Script An account based ledger with respect An account based ledger with respect to to time. (Bitcoin), Simplification: One time. (Not a Bitcoin), Simplification: One block per transaction. block per transaction. We need to do the finite scan to check for the validity. Using hash pointer to quickly refer. Bitcoin Script Merging Values Joint Transactions Bitcoin Script Bitcoin Script Bitcoin transfers scripts instead of Sig and public Key Bitcoin Script Structure of a Bitcoin Transaction Bitcoin Script Opcodes (Stack based architecture) OP_DUP (Duplicating something i.e. on top of stack) OP_Hash160(Hashes whatever on top of stack) 69e02e18….. (Public Key Hash & Recipient address) OP_EQUALVERIFY (Checks whether the top 2 items are equal or not). OP_CHECKSIG (Checks the signature of the transaction). Stack Based: Consider the an infix expression: 10 + 35 * (2 – 5) corresponding postfix expression would look like 10 35 (25 -) * +. Now, evaluate the post fix expression using a stack We shall discuss more on Bitcoin Script Later in this Course. Bitcoin Transaction Bitcoin Transaction Bitcoin Transactions The transactions to be relayed with the following properties No Conflict No Double Spending No Special Scripts – Matches While list Bitcoin Scripts. Bitcoin Transactions Bitcoin Transactions Bitcoin Transactions Blocks to be Relayed The Block to be relayed with the following properties Block contains correct hash based on existing Blockchain All transactions inside the Block are valid Check the scripts Validate with existing Blockchain The Block is included in the current longest chain – Do not relay the forks Block Propagation Latency: Mean Time: 12.6 Seconds 95% Nodes can see the block within 40 Second. Decker, Christian, and Roger Wattenhofer. "Information propagation in the bitcoin network." In IEEE P2P 2013 Proceedings, pp. 1-10. IEEE, 2013. Bitcoin Consensus Consensus Technique (Simple Logic) Bitcoin Consensus Consensus Algorithm for Bitcoin Bitcoin Consensus Double Spending Attack Bitcoin Consensus Double Spending Attack – Solution (6 Confirmations) Sending Payments in Bitcoin Prevent Double Spending: Details of the transaction are sent and forwarded to all or as many other computers as possible. Blockchain – A constantly growing chain of blocks that contains a record of all transactions. The block is maintained by all peers in the Bitcoin network – everyone has a copy of a Blockchain. To be accepted in a chain, transaction blocks must be valid and must include PoW – a computationally difficult hash generated by mining procedure. The hash of all the blocks would be recomputed if one of the block hash has been tampered. Only the longest chain is accepted among all valid continuations and extended further. After any committed transaction, the transaction further can be validated by peers using Alice’s public address. Thanks