Sie sind auf Seite 1von 8

What is Blockchain?

A Decentralized computation and information sharing platform that enables multiple authoritative domains, who do
not trust each other, to co-operate, co-ordinate and collaborate in a rational decision making process.
Traditional Document Sharing Method (using word document):
 Contents are written inside word document.
 The word document is shared between users.
 One user creates the document and send it to the other person for viewing and editing.
 The second person edits the document and sends it back to the first user.
Disadvantages of the Traditional Approach:
 Editing the document simultaneously is not possible.
Next Stage (Like Google document)
 Simultaneous editing is possible.
 The document is stored in a centralized location.
Disadvantages of Central document repository
o A single point of failure.
o If you don’t have sufficient bandwidth you will not be able to edit it.
o If server crashes, no recovery.
Solution – We have to move from a centralized platform to a distributed platform.
Centralized Vs Decentralized Vs Distributed:
 Centralized – Reliance on single point.
 Decentralized – Multiple point of co-ordinateion.
 Distributed – Everyone collectively executes the job.
Blockchain –
 The internet database to support decentralization.
 A decentralized database with strong consistency support
How it Works:
 Each individual has own copy of document.
 The network or block chain will try to update both the document, so that every individual will see latest copy
of the document.
 Advantage
o No need to relay on the network
o No need to relay on server. (Even if server crashes)

A simplified Look of Blockchain:


 Every node maintains a local copy of the global datasheet.
 The system ensures consistency among the local copies
o The local copies are every node is identical.
o The local copies are updated based the global information.
 Public Ledger:
o A database of “Historical Information” available to everyone.
o The “historical information” may be utilized for future computation.
 Eg:
o Historical information are the banking transactions.
o The old transactions are used to validate the new transactions.

Following Points should be ensured in Block chain:


 Protocols for Commitment- Ensure that every valid transaction from the clients are committed and included
in the blockchain within a finite time.
 Consensus – Ensure that the local copies are consistent and updated.
 Security – The data needs to be tamper proof. Otherwise, the clients may act maliciously and can be
compromised.
 Privacy and Authenticity – Data belong to various clients. Hence, Privacy and authenticity needs to be
ensured.

Formal Blockchain Definition:


A blockchain is an OPEN, DISTRIBUTED LEDGER that can record transactions between two parties EFFICIENTLY and in
a VERIFIABLE and PERMANENT way.
OPEN – Accessible to all
DISTRIBUTED or DECENTRALIZED – no single party control
EFFICIENT – fast and scalable
VERIFIABLE – everyone can check the validity of the information
PERMANENT – the information is persistent.

Lecture 2

Cryptographically Secured Hash Functions:


Hash Function – Map any sized data to a fixed size.
Eg. H(x) = x % n. H(x) will be in the range 0 to n-1.
Cryptographically Secured:
One way, given a x, we can compute H(x), but given a H(x), no deterministic algorithm can compute x.
For two different x1 and x2, H(x1) and H(x2) should be different.

Important Property – Avalanche Effect:


A small change in the input put data results in a significant change in the output. (Even a letter change, will have
significant impact)

History of Block Chain:


1. Used to time-stamp a digital document – Whenever a client access a document, construct a block consisting
of the sequence number of access, client ID, timestamp, A HAS VALUE FROM THE PREVIOUS REQUEST .
The entire thing is hashed to connect it to the previous blocks.

Merkle Trees:

The Key point in Markle tree is that any change in any document will change the Root Note. By sharing the Markle
root, we can secure all the four documents is a single shot.

What is Bitcoin?
Bitcoin is a completely decentralized, peer-to-peer, permissionless cryptocurrency put forth in 2009 by Nakmoto,
Satoshi.
Completely decentralized – no central party for ordering or recording anything.
Peer-to-Peer : software that runs on machines of all stakeholders to form the system.
Permissionless: no identity, no need to signup anywhere to use; no access control – anyone can participate in any
role.

Bitcoin Transaction Life Cycle:


 The Bit coin wallet constructs the transactions, sign using user private key, and broadcast it to the network.
 The network nodes validates the transactions based on the existing Blockchain, and propagates the
transaction to the miners.
 The miners collect all the transactions for a time duration, say for 10 minutes.
 The Mining Process: Miners construct a new block and tries to connect it with the existing blockchain,
through a cryptographic has computation.
 Once the mining is over and the hash is obtained, the block is included in the existing blockchain.
 The updated blockchain is then propagated in the network.

Smart Contracts: An automated computerized protocol used for digitally facilitating, verifying or enforcing the
negotiation or performance of a legal contract by avoiding intermediates and directly validating the contract over a
decentralized platform – faster, cheaper and more secure.

Week 1 – Unit 1 – Lecture 3


Introduction to Blockchain – III (Architecture)
Advantages of Block Chain:
Immutable: No party will be able to change the contract once it is fixed and written to the public ledger.
Distributed: All the steps of the contract can be validated by every participating party.
 The blocks are immutable
 The information is open – everyone can check and validate.

Block in Blockchain:

What is inside the block of the blockchain? – They contain transaction that are digitally signed, encrypted and
verified by the peers. The participants can only view the transactions that they are authorized to see.

Structure of Block:
 A block is a container data structure that contains a series of transactions.
 In Bitcoin, A block can contain 500 transactions on average, the average size of the block is around 1 MB.
(Original Limit)
 Can grow update 8 Mb or more (Current scenario). The bigger the block size, higher the number of
transactions that are getting processed.

Structure of Block – Two components:


 Block Header
o Metadata about a block –
 (1) Previous block hash
 Each block contains information about the previous block. This makes the block
tamper proof.
 (2) Mining statistics used to construct the block
 Bitcoin Mining Hk = Hash(Hk-1, T, Nonce)
o Hk-1 : Previous hash
o T – Transactions
o Nonce – Random number.
o Find Nonce such that Hk has certain predefined complexity. (number of
zeros at the prefix)
 (3) Merkle Tree root.
 The transactions are organized in a Markle Tree structure. The root of the Merkle
tree is a verification of all the transactions.
o The header contains mining statistics – timestamp, nonce and difficulty.
 The complexity of the mining algorithm is the number of zeros it has at the start. It is also
defines the difficulty.
Example:

Block Identifier – the hash of the current block header (Hash algorithm : Double SHA 256)
 List of Transactions
o Arranged in the form of Markle Tree.

The Blockchain Replicas:


 Every peer in a Blockchain network maintains a local copy of the Blockchain.
Requirements:
All the replicas need to be updated with the last mined block.
All the replicas need to be consistent – the copies of the blockchain at different peers need to be exactly similar.

The Consensus Algorithm – It ensures that all the nodes are synced with each other.
 All the nodes in the network need to agree or consent on a regular basis, that the data stored by them is the
same.
 Ensure that different nodes in the network see the same data at nearly the same point of time.

Challenges in consensus algorithm:


 Can we achieve consensus even when the network is arbitrarily large, and no participant in the network
really knew all other participants.
 An open network scenario – the permission-less protocol-you do not record your identity while participating
in the consensus system.
Solution:
 User Challege-Response based system. The network would pose a challenge, and each node in the network
would attempt to solve the challenge.
Problem:
 Design of a good challenge – ensures that different nodes will win the challenge at different runs.
 This ensure that no node would be able to control the network.
 This is called Bitcoin PROOF OF WORK (PoW) algorithm – which ensures consensus over a permission-less
setting based on challenge-response.

The economics behind blockchain consensus:


 The computational effort expended by the nodes in achieving consensus would be paid by cryptocurrency
generated and managed by the network.
 Blockchain ensures that the currency is secure and tamper-proof.

www.linkedin.com/pulse/why-so-delirious-blockchain-technical-view-praveen-jayachandran/
Week 1 – Unit 1 -Lecture 04 – Introduction of Blockchain – IV (Conceptualization)
Peer Addresses (Ref:Bitcoin)
 Address in bitcoin is synonymous to an ACCOUNT in a bank.
 The wallet listens for transactions addressed to an account
o Encrypts the transactions by the public key of the target address
o Only the target node can decrypt the transaction and accept it
 However, the actual transaction amount is open to all for validation

The Permissioned (Private) Model – Blockchain 2.0:


 The concept of blockchain can be applied to closed or permissioned network.
 This will not use challenge-response algorithm but used distributed consensus algorithm. (Raft consensus,
Paxos consensus etc)

Permission algorithm Applications:


 Asset Movement and Tracking
 Provenance Tracking: Tracking the origin and movement of high-value items across a supply chain.
o When high value item is created, a corresponding digital token is issued by a trusted entity.
o Every time the physical item changes hands, the digital token is moved in parallel. (Real-world chain
is mirrored on the blockchain)
o This is harder to steal.

IPFS – Inter Planetary File System – Distributed Web: (Hypermedia protocol)


 Combines small storage available in our machines to make to large storage.

Hyperledger Fabric:
 A permissioned blockchain framework provides an enterprise-grade foundation for transactional
applications.
 Supports smart contracts – ensure security and integrity.
 Very different from BitCoin and Ethereum which does not support privacy and confidential transactions.
 Fabric supports the notion of channels, a “subnet” of peers.
o Gives restricted visibility – important for business applications.
 Fabric has no notion of mining, uses the notion of distributed consensus under a closed environment.

Week 1 – Unit – 1 – Lecture 05 – Basic Crypto Primitives – 1

Cryptographic Hash Functions:


 Takes any string as an input, Produce Fixed size output (256 bits in blockchain)
 The output H(m) is called message digest
 Efficiently computable.
Properties of Hash Functions:
 Collision-Free – If the input messages are different, then the output will be different.
 Hide Message – Avalanche effect.
 Puzzle-Friendly – Given X and Y, find out k such that Y = H(X || k). Find k such that Hash of X appended k will
be equal to Y.
 Collision Free:
o Hash Functions are one-way, given a x, it is easy to find H(x), however, given a H(x), no deterministic
algorithm can find x.
o It is difficult to find x and y, such that x (not equal to) y; however H(x) = H(y).
o How do we guarantee collision free?
 Using Birthday Paradox – Find the probability that in a set of n randomly chosen people,
some of them will have the same birthday.
 If we have 367 persons in the group, then two persons will have same birthday. The
probability reduces with no of persons chosen in the group (23 persons - .5 probability)
o If a hash function produces N bits of output, an attacker can compute only 2(n/2) has operations on
a random input to find two matching outputs with probability > 0.98
o For 256 bit hash function, he has to compute 2 power 128 hash operations.
 If he computes hash in 1 millisecond, then it takes 10 power 28 years.
 Information Hiding:
 Puzzle Friendly:
 Hash SHA256:
o Used in bitcoin mining. To construct bitcoin blockchain.
o Secure Hash Algorithm (SHA) that generates 256 bit digest.
o SHA 256 Algorithm – Pre-processing

Cryptographic Hash Pointer – Pointer to a location where some information is stored, Hash of the information is
stored.
 With the hash pointer, we can retrieve the information, Check that the information has not been modified.

Week 2 – Lecture 1
Basic Crypto Primitives – II

Digital Signature:
 A digital code, which can be included with an electronically transmitted document to verify
o The content of the document is authenticated.
o The identity of the sender
o Prevent non-repudiation – Sender will not be able to deny about the origin of the document.
 Purpose
o Only the signing authority can sign a document, but everyone can verify the signature.
o Signature is associated with a particular document. Signature of one document cannot be
transferred to another document.

Public Key cryptography:


 Also known as asymmetrical cryptography or asymmetric key cryptography
 Key: A parameter that determines the functional output of a cryptography algorithm
o Encryption: The key is used to convert a plain-text to a cypher-text
 M’ = E(M,k)
o Decryption: The key is used to convert the cypher-text to the original plain text
 M = E(M’,k)

Property of Public Key Cryptography:


 Prevent it from being guessed.
 Generate the key truly randomly so that the attacker cannot guess it.
 The key should be of sufficient length – increasing the length makes the key difficult to guess.
 The key should contain sufficient entropy, all the bits in the keys should be equally random.

Public Key Cryptography:


 Two keys are used:
o Private Key: Only one user has her private key.
o Public Key: Public to everyone.
 Steps
o 1 - Encrypt the message with Public Key
 M’ = E(M,KPublic)
o 2 – Encrypt the message with Private Key
 M= E(M’,Kprivate)

Public Key Encrypting - RSA


 Named over (Ron) Rivest – (Adi) Shamir – (Leonard) Adleman – Inventors of the public key cryptosystem
 The encryption key is public and decryption key is kept secret (private key)
o Anyone can encrypt the data
o Only the intended receiver can decrypt the data.
 Four Phases
o Key generation, Key distribution, Encryption, Decryption.

Reduce the size of the signature:


 Use the message digest to sign, instead of original message.

Digital signature in Blockchain:


 Used to validate the origin of a transaction
o Prevent non-repudiation
 Owner cannot deny her own transactions.
 No one else can claim that this is his/her own transaction.
 Bitcoin uses Elliptic curve digital signature algorithm (ECDSA)
o Based on elliptic curve cryptography
o Supports good randomness in key generation.

A cryptocurrency using Hashchain and Digital Signatures:


 Alice Generates 10 coin
 Sign the transaction using Alice private key and put it in the block chain.
 Maintain the economy
o Generate new coins with time
o Delete old coins with time.
o A central authority like bank can create and destroy coins based on economic Policies.

Week 2 – Unit 2
Bitcoin Basics – I
Bitcoin – The Beginning
 Two broad operations
o Transaction Management – Transfer of bitcoins from one user to another.
o Money Issuance – Regulate the monetary base
 Controlled Supply
o Must be limited for the currency to have value – any maliciously generated currency needs to be
rejected by the network.
o Bitcoins are generated during the mining – each time a user discovers a new block
o The number of bitcoins generated per block is set to decrease geometrically, with 50% reduction for
every 210,000 blocks or approximately 4 years.
o Theoretical limit for total bitcoins : slightly less than 21 million.
o Miners will get less reward as time progresses
 Bitcoin – Sending Payments:
o Bitcoin uses public key cryptography to make and verify digital signatures.
o Each person may have one or more addresses each with an associated pair of public and private keys
(may hold in the bitcoin wallet)
o Double Sending
 How it is avoided in Bitcoin?
 Details of the transactions are sent to all or as many as possible computers.
 To be accepted in the chain, transaction blocks must be valid and must include proof
of work – a computationally difficult hash generated by the mining procedure.
o Y = H(H || Nonce)
 Block chain ensures that, if any of the block is modified, all following blocks will have
to be recomputed.
 When multiple valid continuation to this chain appear, only the longest such branch
is accepted and it is then extended further (longest chain)
 Once a transaction is committed in the block chain, everyone in the network can
validate all the transactions by using public key.
 The validation prevents double spending in bitcoin.
o Bitcoin anonymity:
 Bitcoin is permission-less, do not need to setup any “account”, or required any email
address, user name or password to login to the wallet.
 The public and private keys do not need to be registered, the wallet can generate them for
the users.
 The bitcoin address is used for transaction, not the user name or identity.
 A bitcoin address mathematically corresponds to a public key based on ECDSA – the digital
signature algorithm used in bitcoin
 Each person can have many such addresses, each with its own balance – Difficult to know
which person owns what amount.
 Bit Coin Script:
o Along with the transaction, Signature and public key of the person is transmitted.
o A transactions is characterized by two parameters
 The output of the transaction
 The input of the transaction.
 We need to determine that a transaction input correctly claims a transaction output.
o A programming language to validate bitcoin transactions.
 A list of instructions recorded with each transaction
 Describes how the next person can gain access to the bitcoins, if that person wants to spend
them.
 FORTH –like language, stack based and processed left to right.
o How Forth Works:
 A stacked based computer programming language originally designed by Charles Moore
 A procedural programming language without type checking
 Use a stack for recursive subroutine execution.
 Uses reverse polish notation (RPN) or postfix notation. 2 + 3 is written as 2 3+.

Week2 – Lecture 3
Bitcoin Basis – II

Bitcoin Scripts:
 Simple, Compact, Stack-based and processed left to right.
o FORTH like language.
 No Turing Complete (No Loops)
Bitcoin Transactions – Input and Output

Das könnte Ihnen auch gefallen