0% found this document useful (0 votes)
93 views7 pages

Block Chain: WEEK:1: Perspective

The document provides an overview of blockchain technology and smart contracts. It discusses that blockchain enables peer-to-peer transactions in a decentralized network through validation, verification, consensus and immutable recording. It also describes that smart contracts add computation and logic to blockchains by allowing code execution, with the code running on an Ethereum Virtual Machine. Accounts in Ethereum include externally owned accounts and contract accounts, and transactions can include messages to invoke smart contracts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views7 pages

Block Chain: WEEK:1: Perspective

The document provides an overview of blockchain technology and smart contracts. It discusses that blockchain enables peer-to-peer transactions in a decentralized network through validation, verification, consensus and immutable recording. It also describes that smart contracts add computation and logic to blockchains by allowing code execution, with the code running on an Ethereum Virtual Machine. Accounts in Ethereum include externally owned accounts and contract accounts, and transactions can include messages to invoke smart contracts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

~: BLOCK CHAIN :~

WEEK:1
Perspective:-
ConsenSys is a company that operates in many countries where the largest
blockchain company right now in the world by many accounts, and one of the
fastest growing software companies in the world, and by many accounts, the
largest blockchain company in the world.

Definition:-
What is a blockchain?
Blockchain is about enabling peer to peer transaction in a decentralized
network.
Validation, verification, consensus, and immutable recording lead to the trust
and security of the blockchain.
It was a technology originally created to support the famous
cryptocurrency, BitCoin.

Structure:-
The set of all UTXOs in a bitcoin network collectively defined the state of the
Bitcoin blockchain. UTXO's are referenced as inputs in a transaction. UTXO's
those are also outputs generated by a transaction. All of that UTXO's is in a
system, are stored by the participant nodes in a database.

The role of the UTXO's in a Bitcoin Blockchain.


The transaction uses the amount specified by one or more UTXOs and transmits
it to one or more newly created output UTXOs, according to the request
initiated by the sender. The structure of a given UTXO is very simple. It
includes a unique identifier of the transaction that created this UTXO, an index
or the position of the UTXO in the transaction output list, a value or the amount
it is good for. And an optional script, the condition under which the output can
be spent. The transaction itself includes a reference number of the current
transaction, references to one no more input UTXOs, references to one or more
output UTXOs newly generated by the current transaction, and the total input
amount and output amount. Participants can validate the transaction contents.
The basic operations in a blockchain.
Operations in the decentralized network are the responsibility of the peer
participants and their respective computational nodes.

Transaction validation is carried out independently by all miners. The process


involves validation of more than 20 criteria, including size, syntax, et
cetera. Some of these criteria are: Referenced Input Unspent Transaction
Output, UTXOs are valid, reference output UTXOs are correct, reference input
amount and output amount matched sufficiently, invalid transactions are
rejected and will not be broadcast. All the valid transactions are added to a pool
of transactions. Miners select a set of transaction from this pool to create a
block. If every miner adds the block to the chain, there will be many branches to
the chain, resulting in inconsistent state. As defined earlier, the blockchain is a
single consistent linked chain of flux. We need a system to overcome this
challenge. Miners compete to solving a puzzle to determine who earn the right
to create the next block. In the case of bitcoin blockchain, this parcel is a
computation of parcel and the central processing unit or CPU intensive. The
announcement is broadcast to the network and the block is also broadcast to the
network.
Participants reach a consensus to add a new block to the chain. This new block
is added to their local copy of the blockchain.
The algorithm for consensus is called proof-of -work protocol, since it
involves work a computational power to solve the puzzle and to claim the right
to form the next block.
Transaction zero, index zero of the confirmed block is created by the miner of
the block. It has a special UTXO and does not have any input UTXO. It is
called the coinbase transaction that generates a minor's fees for the block
creation. Currently, the minor's fees is 12.5 BTC for a bitcoin.

BEYOND BITCOIN:-
Bitcoin blockchain is open-source and the entire code is available on the
GitHub.
Among all the cryptocurrencies Bitcoin supports an optional and special
feature called scripts for conditional transfer of values.
Bitcoin supports an optional and special feature called scripts for conditional
transfer of values.
Ethereum Blockchain extended the scripting feature into a full-blown code
execution framework called smart contract.
A smart contract provide the very powerful capability of code execution for
embedding business logic on the blockchain.
Three major types of blockchains emerge from Bitcoin foundation.
1. Type one deals with the coins in cryptocurrency currency chain.
Example, Bitcoin.
2. Type two supports cryptocurrency and a business logic layer supported
by code execution.
Example, ethereum.
3. Type three involves no currency but supports software execution for
business logic.
Example, The Linux Foundation's Hyperledger.

Public blockchain: Thus Bitcoin is a fantastic example of a public blockchain


class. Transaction blocks and the blockchain are publicly observable even
though participants are anonymous.
Private blockchain: This restriction helps in simplifying the normal operations
such as block creation and contingence model. In a private blockchain, access to
the blockchain is limited to selected participants for example, those participants
within an organization.
Permissioned blockchain: has the benefits of a public blockchain with
allowing only users with permission to collaborate and transact. Permissioned
blockchain, also called consortium blockchain.

Private and permissioned blockchain allow for controlled access to the


blockchain enabling many diverse business models.

WEEK: 2
Smart Contracts:
Bitcoin blockchain is the mother of all blockchains
Around 2013, a framework for code execution was introduced by Ethereum
Founders. The centerpiece and thrust of this Ethereum blockchain is a smart
contract.
A smart contract is a piece of code deployed in the blockchain node.
Execution of a smart contract is initiated by a message embedded in the
transaction.
An auction bidding smart contract could execute this logic. If the age of a
bidder is greater than 18 and the bid is greater than the minimum bid, then,
accept the bid, or else reject the bid.
Structurally, a smart contract resembles a class definition in an object oriented
design. It has data, functions or methods with modifiers public or private, along
with getter and set of functions. Specific programming languages have been
designed for coding smart contracts. Solidity is one such language.
Where does the code in the smart contract get executed? Where is it located in a
node? 
We need a computational infrastructure to execute any arbitrary code. Every
node in Ethereum network should be able to execute the code irrespective of
that underlying type of hardware or operating system.
A smart contract written a high level programming language is translated into
EVM byte code, and then, deployed on the Ethereum Virtual Machine, EVM.

First line with pragma indicates the version of the solidity language. The
contract's name is in the first line. This particular contract is for one integer
storage. The data for the integer is defined with type a name, uint
StoredData. Two functions are defined for writing and reading the data. 
Set and get. Code execution. 

Summarizing, smart contracts add a layer of logic and computation to the trust
infrastructure supported by the blockchain. Smart contracts allow for execution
of code. Enhancing the basic value transfer capability of the Bitcoin blockchain.
The code for this smart contract is written in a high level language like Solidity
and compiled into byte code. The code for the smart contracts is executed on a
special structure known as Ethereum Virtual Machine.

Ethereum structure:
Ethereum formally introduce the concept of an account as a part of the protocol. 
The account is the originator and the target of a transaction. 
There are two types of accounts, Externally Owned Accounts and Contract Accounts.
Externally Owned Accounts or EOA are controlled by private keys.
 
Contract Accounts or CA are controlled by the code and can be activated only by an EOA. 
An externally owned account is needed to participate in the Ethereum network. 
It interacts with the blockchain using transactions. 
A Contract Account represents a smart contract. 
Every account has a coin balance.

An account must have sufficient balance to meet 


the fees needed for the transactions activated. 
Fees are paid in Wei. 
Wei is a lower denomination of Ether. 
One Ether 10 to the power of 18 Weis.
an optional data field or payload that contains a message to a contract, 
STARTGAS which is a value representing 
the maximum number of computational steps the transaction is allowed. 
Gas price a value representing the fee sender is willing to pay for the computations.
Ethereum block structure has a header, 
transaction, and runner-up block headers.

Summarizing, accounts are basic units of Ethereum protocol. 


Externally Owned Accounts and Smart Contract Accounts. 
An Ethereum transaction includes not only fields what transfer of Ethers but 
also messages for invoking Smart contract. 
An Ethereum block contains the usual previous block hash, nonce, 
transaction details but also details about gas or fees limits, 
the state of the Smart Contracts and Runner-Up headers, 
that we'll discuss later.

Ethereum operations
he input needed for this execution 
is extracted from the payload field of the transaction. 
Current state of the smart contract is the values of the variables defined in it. 
The state of the smart contract may be updated by this execution. 
Results of this execution is told in the receipts. 
A blockchain maintains both the state hash and the receipt hash. 
All the transactions generated are validated. 
Transaction validation involves checking the time-stamp and 
the nonce combination to be valid and the availability of sufficient fees for execution. 
Miner nodes in the network receive, 
verify, gather and execute transactions. 
The in-work smart contract code are executed by all miners. 
Validated transactions are broadcast and gathered for block creation. 
The consensus protocol used is a memory-based rather than a CPU-based proof of work. 

WEEK-3
Since the same key is used for encryption and decryption, it is a symmetric key
Example, Ceasar encryption is the simplest one with alphabets of a message
are shifted by a fixed number, and this number is called the Key. In this
example F is a function defined by shift by three in alphabet. Consider, "Meet
me at the cinema." You shift by three the S key value of every letter to encrypt
it, and your receiver decrypts it using the same three as the key. Shift the other
way every character to view the original message. Three is the key in this trivial
example.

Note that symmetric key encryption has issues:-


 
1. it is easy to derive the secret key from the encrypted data.
 
2. the key distribution, how do you pass the key to the participant
transacting? These issues are further exasperated in a block chain
decentralized network where participants are unknown to each other.
 
Public-key cryptography addresses these issues. Instead of a single secret key,
it employs two different keys that take care of both the issues of symmetric key
encryption
 
The public-key private key pair has the unique quality that even though a data is
encrypted with the private key, it can be decrypted with the corresponding
public-key and vice versa.
 
A popular implementation of public key, private key is the Rivest Shamir
Adleman (RSA) algorithm. Common application of RSA is the passwordless
user authentication, for example for accessing a virtual machine on Amazon
cloud. 
Though RSA is very commonly used in many applications, block chains need a
more efficient and stronger algorithm
 
Elliptic Curve Cryptography, ECC family of algorithms is used in the bitcoin as
well as an Ethereum block chain for generating the key pair., marked from 0
hours 6 minutes 22 seconds until 0 hours 6 minutes 35 secondslliptic Curve
Cryptography, ECC family of algorithms is used in the bitcoin as well as an
Ethereum block chain for generating the key pair.
 
Why ECC not RSA?
ECC is stronger than RSA for a given number of bits.
 
256 bit ECC key pair is equal in strength to about 3072 bits of RSA key pair.,
marked from 0 hours 6 minutes 45 seconds until 0 hours 6 minutes 56
seconds256 bit ECC key pair is equal in strength to about 3072 bits of RSA key
pair.

NOTE (FROM ARTICLE)


Public-key cryptography, or asymmetric cryptography, is an encryption scheme
that uses two mathematically related, but not identical, keys - a public key and a
private key. Unlike symmetric key algorithms that rely on one key to both
encrypt and decrypt, each key performs a unique function.
The public key is used to encrypt and the private key is used to decrypt.

You might also like