Beginner level
1 Differentiate between Blockchain and Hyperledger. • Blockchain is a decentralized technology of immutable records called blocks, which are secured using cryptography • Hyperledger is a platform/ organization that allows people to build private Blockchain Blockchain Hyperledger
1 Differentiate between Blockchain and Hyperledger. • Blockchain is a decentralized technology of immutable records called blocks, which are secured using cryptography • Blockchain is divided into public, private and consortium Blockchain • Hyperledger is a platform/ organization that allows people to build private Blockchain • Hyperledger is a private Blockchain where the access to Blockchain data is limited to predefined users Blockchain Hyperledger
1 Differentiate between Blockchain and Hyperledger. • Blockchain is a decentralized technology of immutable records called blocks, which are secured using cryptography • Blockchain is divided into public, private and consortium Blockchain • It can be used in multiple fields like (business, governments, healthcare etc.) • Hyperledger is a platform/ organization that allows people to build private Blockchain • Hyperledger is a private Blockchain where the access to Blockchain data is limited to predefined users • Hyperledger is used in Blockchain for enterprise based solutions Blockchain Hyperledger
2 In simple terms, Blockchain technology is a distributed ledger, which stores transaction details in the form of immutable records (blocks) which are secured using cryptography How would you explain Blockchain Technology to someone who doesn't know it?
2 Consider an example of a school where Blockchain is similar to a digital report card of a student: How would you explain Blockchain Technology to someone who doesn't know it? 1 2 3 4 Each block contains students records which has a label (stating the date and time) of when the record was entered Here, neither the teacher nor the student will be able to modify the record of report cards Also, the teacher owns a private key that allows him/her to make new records and the student owns a public key that allows him/her to access the report card at anytime This method makes the data both accessible and secure X
3 What is Merkel tree? A Merkle tree is a data structure which is used for verifying a block. It is in a form of a binary trees containing cryptographic hashes. Each leaf node is a hash of a block of transaction data Merkel root Hash AA Hash BB Hash a Hash b Hash c Hash d Data Block 01 Data Block 02 Data Block 03 Data Block 04 0r0234…. 0a0234…. 002d34…. ja0234…. da0234…. da0ss4…. ffa0ss4….
3 What is Merkel tree? A Merkle tree is a data structure which is used for verifying a block. It is in a form of a binary trees containing cryptographic hashes. Each non-leaf node is a hash of its leaf node Merkel root Hash AA Hash BB Hash a Hash b Hash c Hash d Data Block 01 Data Block 02 Data Block 03 Data Block 04 0r0234…. 0a0234…. 002d34…. ja0234…. da0234…. da0ss4…. ffa0ss4….
3 What is Merkel tree? A Merkle tree is a data structure which is used for verifying a block. It is in a form of a binary trees containing cryptographic hashes. Merkel root Hash AA Hash BB Hash a Hash b Hash c Hash d Data Block 01 Data Block 02 Data Block 03 Data Block 04 Merkle root or hash root is the final hash of all the transaction hashes 0r0234…. 0a0234…. 002d34…. ja0234…. da0234…. da0ss4…. ffa0ss4….
4 What do you mean by blocks in the Blockchain technology? Blockchain is a distributed database of immutable records called blocks, which are secured using cryptography Transaction Details Nonce Target Hash value Previous Hash Block
4 What do you mean by blocks in the Blockchain technology? Recorded in chronological order Once the data is recorded, it cannot be changed A block is like a record of transactions. Each time a block is verified, it gets recorded in chronological order
5 How is Blockchain distributed ledger different from a traditional ledger? Blockchain distributed ledger Traditional ledger Available Yes Yes No Yes No Transparency Irreversible process Security Central authority Identities can be hidden Single point of failure Criteria Unavailable No No Yes No Yes
5 How is Blockchain distributed ledger different from a traditional ledger? Blockchain distributed ledger Traditional ledger No Done by the participants across the network Shared among all the participants Modifying data Validation Copy of the ledger Criteria Possible It is done by the central authority Not shared among all the participants
6 How can you identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data It holds the hash value of the previous block
6 How can you identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Contains details of several transactions
6 How can you identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Contains details of several transactions Nonce is a random value which is used to vary the value of hash
6 How can you identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Contains details of several transactions Hash is a alphanumeric value which is used to identify a block
6 How can you identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Contains details of several transactions The hash address is the unique identification of a block. It is a hex value of 64 characters that has both letters and digits. It is obtained by using the SHA - 256 algorithm
6 How can you identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Transaction data Hash (prev. block) Nonce Hash value Hashing Algorithm (SHA256) Header
7 What is cryptography? What is its role in Blockchain? Blockchain uses cryptography to secure users identities and ensures transactions are done safely with a hash function Cryptography: • Cryptography uses public and private keys to encrypt and decrypt data • In Blockchain network, public key can be shared with all the Bitcoin users • A private key is kept secret with the user Input data Cryptography Private key Public key 424242..
7 What is cryptography? What is its role in Blockchain? Blockchain uses cryptography to secure users identities and ensures transactions are done safely with a hash function SHA 256 Secure Hashing Algorithm Stands for the number of bits it takes up in memory SHA 256 Hash function takes an input data and returns an alphanumeric output of 64 characters Hashing function:
8 What are the different types of Blockchains? Public Blockchain Private Blockchain Consortium Blockchain Blockchains are of three types:
8 What are the different types of Blockchains? Public Blockchain Private Blockchain Consortium Blockchain Blockchains are of three types: Ledgers are visible to all the users on the internet and any user can verify and add a block of transactions to the Blockchain Examples: Bitcoin and Ethereum
Consortium Blockchain 8 What are the different types of Blockchains? Blockchains are of three types: Public Blockchain Private Blockchain Ledgers are visible to all the users on the internet but only specific users in the organization can verify and add transaction Example: Blockstack
8 What are the different types of Blockchains? Public Blockchain Private Blockchain Consortium Blockchain Blockchains are of three types: Here, the consensus process is controlled by only specific nodes. However, ledgers are visible to all the participants in the Consortium Blockchain Example: Ripple
9 What happens when you try to deploy a file with multiple contracts? • In Blockchain, deploying a file with multiple contracts is not possible • The compiler only deploys the last contract from the uploaded file and the remaining contracts are neglected Smart contract File
1 0 What is Genesis block? • Genesis block is the first block in the Blockchain which is also known as block 0 • In the Blockchain , it is the only block that doesn’t refer to its previous block • It defines parameters of the Blockchain such as, o level of difficulty, o consensus mechanism etc. to mine blocks Genesis block
1 0 What is Genesis block? • Genesis block is the first block in the Blockchain which is also known as block 0 • In Blockchain , it is the only block that doesn’t refer to its previous block • It defines parameters of the Blockchain such as, o level of difficulty, o consensus mechanism etc. to mine blocks Genesis block
1 0 What is Genesis block? • Genesis block is the first block in the Blockchain which is also known as block 0 • In Blockchain , it is the only block that doesn’t refer to its previous block • It defines parameters of the Blockchain such as, o level of difficulty, o consensus mechanism etc. to mine blocks Consensus mechanism Level of difficulty
Intermediate level
• In Blockchain, to generate a digital signature, transaction details are passed through a one-way hash function i.e., SHA-256 • Then, the output value is passed through a signature algorithm (like ECDSA) with the user’s private key • The encrypted hash along with other information (such as the hashing algorithm) is called as the digital signature 11 How is the hash (Block signature) generated ? Transaction details Passed through hash function (SHA256) =+ Digitally signed document Signature algorithm The output is passed through a signature algorithm with the user’s private key
List down some of the extensively used cryptographic algorithms? 1 2 3 4 5 RSA (Rivest-Shamir-Adleman) Triple DES Blowfish 1 2 SHA - 256 Ethash
What is a smart contract and list some of its applications Some of the applications are: Shipment of goods can be easily tracked using smart contracts Smart contracts can protect the ownership rights Smart contracts can identify false claims and prevent forgeries Smart contracts can be helpful to facilitate wage payments Transportation Protecting copyrighted content Insurance Employment contract 1 3 Smart contracts are self-executing contracts which contains the terms and conditions of an agreement between the peers
Ethereum is a Blockchain based distributed computing platform featuring smart contract functionality that enables users to create and deploy their decentralized applications Test network (like Ropsten, Kovan and Rinkeby) Private network  Live network (main network) There are three types of network in Ethereum:  What is Ethereum network and how many Ethereum networks are you familiar with? 1 4 What is Ethereum network and how many Ethereum networks are you familiar with?
Ethereum is a Blockchain based distributed computing platform featuring smart contract functionality that enables users to create and deploy their decentralized applications Test network (like Ropsten, Kovan and Rinkeby) Private network  Live network (main network) There are three types of network in Ethereum:  Smart contracts are deployed on main network What is Ethereum network and how many Ethereum networks are you familiar with? 1 4 What is Ethereum network and how many Ethereum networks are you familiar with?
Ethereum is a Blockchain based distributed computing platform featuring smart contract functionality that enables users to create and deploy their decentralized applications Private network  Live network (main network) There are three types of network in Ethereum:  Test networks allow users to run their smart contracts with no fees before deploying it on the main network Test network (like Ropsten, Kovan and Rinkeby) What is Ethereum network and how many Ethereum networks are you familiar with? 1 4 What is Ethereum network and how many Ethereum networks are you familiar with?
Test network (like Ropsten, Kovan and Rinkeby) Ethereum is a Blockchain based distributed computing platform featuring smart contract functionality that enables users to create and deploy their decentralized applications  Live network (main network) There are three types of network in Ethereum:  Private networks are those which are not connected to the main network Private network What is Ethereum network and how many Ethereum networks are you familiar with? 1 4 What is Ethereum network and how many Ethereum networks are you familiar with?
Where do nodes run smart contract code? Nodes run smart contracts code on Ethereum Virtual Machine (EVM). It is a virtual machine designed to operate as a runtime environment for Ethereum based smart contracts Smart contract EVM EVM is operated in a sandboxed environment (isolated from main network). This is a perfect testing environment 1 5 Note: Once a user successfully runs the code on EVM, he/she can deploy the smart contract in the main network
What is a Dapp and how is it different from a normal application? Normal App • Normal application has a back-end code which runs on a centralized server • A Dapp is a decentralized application which is deployed using smart contract Dapp Normal application 1 6
What is a Dapp and how is it different from a normal application? Normal App • Normal application has a back-end code which runs on a centralized server • It’s a computer software application that is hosted on a central server • A Dapp is a decentralized application which is deployed using smart contract • A Dapp has its back-end code (smart contract) which runs on a decentralized peer-to-peer network Front-end Smart contract Blockchain (P2P network) (Back-end code) Front-end API Database (runs on server) Process:Process: Dapp Normal application 1 6
Name some leading open source platforms for developing Blockchain applications. • Ethereum is one of the popular platforms for building Blockchain based applications • Eris is used for building enterprise-based solutions • Also, some of the widely used platforms for building Blockchain are Hyperledger Multichain OpenchainErisEthereum 1 7
What is the very first thing you must specify in a Solidity file? pragma solidity ^0.4.17; It is necessary to specify the version number of Solidity at the beginning of a code as it eliminates incompatibility errors which can arise while compiling with another version 1 8
What is the difference between Bitcoin and Ethereum ? Bitcoin Ethereum P2P Currency Proof of work SHA-256 10 Minutes (approx.) 12.5 BTC Optional 1 BTC = 6934.34 USD Concept Consensus mechanism Hashing Algorithm Time taken to mine a block Reward Transaction fee Value (8/21/18) Criteria P2P currency and smart contract Proof of work/ Proof of stake Ethash 12-15 seconds 3 ETH Fee is calculated in gas 1 ETH = 278.98 USD 1 9
What is nonce and how is it used in mining?20 Determine the nonceMining Less than target value < targetNonce Hash value 002AE4.. • In Blockchain, mining is a process to validate transactions by solving a difficult mathematical puzzle called proof of work • Proof of work is the process to determine a number (nonce) along with a cryptographic hash algorithm to produce a hash value lower than a predefined target • Nonce is a random value which is used to vary the value of hash so that the final hash value meets the hash conditions
Advanced level
Name the steps that are involved in the Blockchain project implementation. Requirement identification 1 21  Identifying the problem and goal  Identifying the most suitable consensus mechanism  Identifying the most suitable platform  Implementation and deployment costs
Name the steps that are involved in the Blockchain project implementation. Requirement identification 1 2 21 In this step, an individual evaluates all requirements and decides a suitable blockchain platform to be implemented Planning stage
Name the steps that are involved in the Blockchain project implementation. Requirement identification Planning stage Development and implementation of project 1 2 3 21  Designing the architecture  Designing the user interface  Building the APIs
Name the steps that are involved in the Blockchain project implementation. Requirement identification Planning stage Development and implementation of project Controlling and monitoring the project 1 2 3 4  Applying proof of concept (POC)  Identifying and fixing issues 21
Explain a real-life use-case where Blockchain is being used. Distributor Retailer PurchaserSupplier Raw materials Manufacturing Verify for quality assurance In supply chain management, smart contracts provide permanent transparency and validation of transactions shared by multiple supply chain partners 22
List and explain the parts of EVM memory. The memory of an EVM is divided into three types, Storage Memory Stack 23
List and explain the parts of EVM memory. The memory of an EVM is divided into three types, • Storage values are stored permanently on the Blockchain network • It is extremely expensive Storage Memory Stack 23
List and explain the parts of EVM memory. The memory of an EVM is divided into three types, • Storage values are stored permanently on the Blockchain network • It is extremely expensive Storage Memory Stack 23 • Memory is a temporary modifiable storage • It can be accessed only during contract execution. Once the execution is finished, its data is lost
1 List and explain the parts of EVM memory. The memory of an EVM is divided into three types, Note: Memory and stack are relatively much cheaper than storage • Storage values are stored permanently on the Blockchain network • It is extremely expensive • Memory is a temporary modifiable storage • It can be accessed only during contract execution. Once the execution is finished, its data is lost • Stack is a temporary and non- modifiable storage • Here, when the execution completes, the content is lost Storage Memory Stack 23
What happens if the execution of a smart contract costs more than the specified gas? • Initially, your transaction will be executed, but if the execution of a smart contract costs more than the specified gas, then the miners will stop validating your contract • The Blockchain will record the transaction as failed, also the user doesn’t get a refund 24 Transaction failed
What does the gas usage in a transaction depend on and how is transaction fee calculated? Gas usage depends upon the amount of storage and set of instructions (codes) used in a smart contract Ether = Tx Fees = Gas Limit * Gas Price The transaction fee is calculated in Ether, which is given as 25
What is fork? What are some of the types of forking? • In simple terms, updating a cryptocurrency protocol or code is called forking • Fork implies that a Blockchain splits into two branches • It can happen when the participants of the network cannot come to an agreement with regards to: o Consensus algorithm o New rules to validate transactions Types of forking Hard forks Soft forks Accidental forks 26
Differentiate between proof of work vs proof of stake. PoS is an alternate to proof of work by which the Blockchain aims to achieve distributed consensus In Blockchain, PoW is the process of solving a complex mathematical puzzle called mining Here, the probability of mining a block is based upon the amount of computational work done by a miner Miners spend a lot of computing power (with hardware) for solving the cryptographic puzzle The probability of validating a block relies upon the amount of tokens you own. The more tokens you have, the more chance you get to validate a block It was created as a solution to minimize the use of expensive resources spent in mining Proof of work - Proof of stake - 27
What is 51% attack? In Blockchain, 51% attack refers to a vulnerability where an individual or group of people can control the majority of the mining power (hash rate) This would allow the attackers to prevent new transactions from being confirmed. Further, they can double spend the coins 28 In 51% attack, smaller cryptocurrencies are being attacked 1 32
What are function modifiers in solidity and mention the most widely used modifiers.29 • In Solidity, function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are: View Pure
What are function modifiers in solidity and mention the most widely used modifiers.29 View Pure • View functions are functions that cannot modify the state of smart contract • They are read-only functions • In Solidity, function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are:
• In Solidity, function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are: 29 View Pure For example, this function returns address To simplilearn[msg.sender] without any data being modified function getsimplilearnName() view { return addressTosimplilearn[msg.sender]; } What are function modifiers in solidity and mention the most widely used modifiers.
What are function modifiers in solidity and mention the most widely used modifiers.29 View Pure • Pure functions are functions that neither read nor write the state of smart contract • They return the same result determined by its input values • In Solidity, function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are:
• In Solidity, function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are: What are function modifiers in solidity and mention the most widely used modifiers.29 View Pure For example, the above function returns the value of the operation on input variables (num1 and num2) function Calculate(int num1, int num2) pure { return (num1 + num2 * num1) * (num2 * num1); }
Write a crowd sale smart contract code in solidity programming language30 Function crowdsale( address ifSuccessfulSendTo, uint fundingGoalInEthers, uint durationInMinutes, uint etherCostOfEachToken, address addressOfTokenUsedAsReward ) public { beneficiary = ifSuccessfulSendTo; fundingGoal = fundingGoalInEthers * 1 ether; deadline = now + durationInMinutes * 1 minutes; price = etherCostOfEachToken * 1 ether; tokenReward = token(addressOfTokenUsedAsReward); } Crowd sale function
Write a crowd sale smart contract code in solidity programming language30 function () payable public { require(!crowdsaleClosed); uint amount = msg.value; balanceOf[msg.sender] += amount; amountRaised += amount; tokenReward.transfer(msg.sender, amount / price); emit FundTransfer(msg.sender, amount, true); } Default function to send Values
Write a crowd sale smart contract code in solidity programming language30 function safeWithdrawal() public afterDeadline { if (!fundingGoalReached) { uint amount = balanceOf[msg.sender]; balanceOf[msg.sender] = 0; if (amount > 0) { if (msg.sender.send(amount)) { emit FundTransfer(msg.sender, amount, false); } else { balanceOf[msg.sender] = amount; }}} Default function of funds withdrawal
Blockchain Interview Questions And Answers | Blockchain Technology Interview Questions | Simplilearn

Blockchain Interview Questions And Answers | Blockchain Technology Interview Questions | Simplilearn

  • 2.
  • 3.
    1 Differentiate betweenBlockchain and Hyperledger. • Blockchain is a decentralized technology of immutable records called blocks, which are secured using cryptography • Hyperledger is a platform/ organization that allows people to build private Blockchain Blockchain Hyperledger
  • 4.
    1 Differentiate betweenBlockchain and Hyperledger. • Blockchain is a decentralized technology of immutable records called blocks, which are secured using cryptography • Blockchain is divided into public, private and consortium Blockchain • Hyperledger is a platform/ organization that allows people to build private Blockchain • Hyperledger is a private Blockchain where the access to Blockchain data is limited to predefined users Blockchain Hyperledger
  • 5.
    1 Differentiate betweenBlockchain and Hyperledger. • Blockchain is a decentralized technology of immutable records called blocks, which are secured using cryptography • Blockchain is divided into public, private and consortium Blockchain • It can be used in multiple fields like (business, governments, healthcare etc.) • Hyperledger is a platform/ organization that allows people to build private Blockchain • Hyperledger is a private Blockchain where the access to Blockchain data is limited to predefined users • Hyperledger is used in Blockchain for enterprise based solutions Blockchain Hyperledger
  • 6.
    2 In simple terms,Blockchain technology is a distributed ledger, which stores transaction details in the form of immutable records (blocks) which are secured using cryptography How would you explain Blockchain Technology to someone who doesn't know it?
  • 7.
    2 Consider an exampleof a school where Blockchain is similar to a digital report card of a student: How would you explain Blockchain Technology to someone who doesn't know it? 1 2 3 4 Each block contains students records which has a label (stating the date and time) of when the record was entered Here, neither the teacher nor the student will be able to modify the record of report cards Also, the teacher owns a private key that allows him/her to make new records and the student owns a public key that allows him/her to access the report card at anytime This method makes the data both accessible and secure X
  • 8.
    3 What isMerkel tree? A Merkle tree is a data structure which is used for verifying a block. It is in a form of a binary trees containing cryptographic hashes. Each leaf node is a hash of a block of transaction data Merkel root Hash AA Hash BB Hash a Hash b Hash c Hash d Data Block 01 Data Block 02 Data Block 03 Data Block 04 0r0234…. 0a0234…. 002d34…. ja0234…. da0234…. da0ss4…. ffa0ss4….
  • 9.
    3 What isMerkel tree? A Merkle tree is a data structure which is used for verifying a block. It is in a form of a binary trees containing cryptographic hashes. Each non-leaf node is a hash of its leaf node Merkel root Hash AA Hash BB Hash a Hash b Hash c Hash d Data Block 01 Data Block 02 Data Block 03 Data Block 04 0r0234…. 0a0234…. 002d34…. ja0234…. da0234…. da0ss4…. ffa0ss4….
  • 10.
    3 What isMerkel tree? A Merkle tree is a data structure which is used for verifying a block. It is in a form of a binary trees containing cryptographic hashes. Merkel root Hash AA Hash BB Hash a Hash b Hash c Hash d Data Block 01 Data Block 02 Data Block 03 Data Block 04 Merkle root or hash root is the final hash of all the transaction hashes 0r0234…. 0a0234…. 002d34…. ja0234…. da0234…. da0ss4…. ffa0ss4….
  • 11.
    4 What doyou mean by blocks in the Blockchain technology? Blockchain is a distributed database of immutable records called blocks, which are secured using cryptography Transaction Details Nonce Target Hash value Previous Hash Block
  • 12.
    4 What doyou mean by blocks in the Blockchain technology? Recorded in chronological order Once the data is recorded, it cannot be changed A block is like a record of transactions. Each time a block is verified, it gets recorded in chronological order
  • 13.
    5 How isBlockchain distributed ledger different from a traditional ledger? Blockchain distributed ledger Traditional ledger Available Yes Yes No Yes No Transparency Irreversible process Security Central authority Identities can be hidden Single point of failure Criteria Unavailable No No Yes No Yes
  • 14.
    5 How isBlockchain distributed ledger different from a traditional ledger? Blockchain distributed ledger Traditional ledger No Done by the participants across the network Shared among all the participants Modifying data Validation Copy of the ledger Criteria Possible It is done by the central authority Not shared among all the participants
  • 15.
    6 How canyou identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data It holds the hash value of the previous block
  • 16.
    6 How canyou identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Contains details of several transactions
  • 17.
    6 How canyou identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Contains details of several transactions Nonce is a random value which is used to vary the value of hash
  • 18.
    6 How canyou identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Contains details of several transactions Hash is a alphanumeric value which is used to identify a block
  • 19.
    6 How canyou identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Contains details of several transactions The hash address is the unique identification of a block. It is a hex value of 64 characters that has both letters and digits. It is obtained by using the SHA - 256 algorithm
  • 20.
    6 How canyou identify a block? Every block consists of four fields Hash of previous block Nonce Hash Transaction data Transaction data Hash (prev. block) Nonce Hash value Hashing Algorithm (SHA256) Header
  • 21.
    7 What iscryptography? What is its role in Blockchain? Blockchain uses cryptography to secure users identities and ensures transactions are done safely with a hash function Cryptography: • Cryptography uses public and private keys to encrypt and decrypt data • In Blockchain network, public key can be shared with all the Bitcoin users • A private key is kept secret with the user Input data Cryptography Private key Public key 424242..
  • 22.
    7 What iscryptography? What is its role in Blockchain? Blockchain uses cryptography to secure users identities and ensures transactions are done safely with a hash function SHA 256 Secure Hashing Algorithm Stands for the number of bits it takes up in memory SHA 256 Hash function takes an input data and returns an alphanumeric output of 64 characters Hashing function:
  • 23.
    8 What arethe different types of Blockchains? Public Blockchain Private Blockchain Consortium Blockchain Blockchains are of three types:
  • 24.
    8 What arethe different types of Blockchains? Public Blockchain Private Blockchain Consortium Blockchain Blockchains are of three types: Ledgers are visible to all the users on the internet and any user can verify and add a block of transactions to the Blockchain Examples: Bitcoin and Ethereum
  • 25.
    Consortium Blockchain 8 What arethe different types of Blockchains? Blockchains are of three types: Public Blockchain Private Blockchain Ledgers are visible to all the users on the internet but only specific users in the organization can verify and add transaction Example: Blockstack
  • 26.
    8 What arethe different types of Blockchains? Public Blockchain Private Blockchain Consortium Blockchain Blockchains are of three types: Here, the consensus process is controlled by only specific nodes. However, ledgers are visible to all the participants in the Consortium Blockchain Example: Ripple
  • 27.
    9 What happenswhen you try to deploy a file with multiple contracts? • In Blockchain, deploying a file with multiple contracts is not possible • The compiler only deploys the last contract from the uploaded file and the remaining contracts are neglected Smart contract File
  • 28.
    1 0 What is Genesisblock? • Genesis block is the first block in the Blockchain which is also known as block 0 • In the Blockchain , it is the only block that doesn’t refer to its previous block • It defines parameters of the Blockchain such as, o level of difficulty, o consensus mechanism etc. to mine blocks Genesis block
  • 29.
    1 0 What is Genesisblock? • Genesis block is the first block in the Blockchain which is also known as block 0 • In Blockchain , it is the only block that doesn’t refer to its previous block • It defines parameters of the Blockchain such as, o level of difficulty, o consensus mechanism etc. to mine blocks Genesis block
  • 30.
    1 0 What is Genesisblock? • Genesis block is the first block in the Blockchain which is also known as block 0 • In Blockchain , it is the only block that doesn’t refer to its previous block • It defines parameters of the Blockchain such as, o level of difficulty, o consensus mechanism etc. to mine blocks Consensus mechanism Level of difficulty
  • 31.
  • 32.
    • In Blockchain,to generate a digital signature, transaction details are passed through a one-way hash function i.e., SHA-256 • Then, the output value is passed through a signature algorithm (like ECDSA) with the user’s private key • The encrypted hash along with other information (such as the hashing algorithm) is called as the digital signature 11 How is the hash (Block signature) generated ? Transaction details Passed through hash function (SHA256) =+ Digitally signed document Signature algorithm The output is passed through a signature algorithm with the user’s private key
  • 33.
    List down someof the extensively used cryptographic algorithms? 1 2 3 4 5 RSA (Rivest-Shamir-Adleman) Triple DES Blowfish 1 2 SHA - 256 Ethash
  • 34.
    What is asmart contract and list some of its applications Some of the applications are: Shipment of goods can be easily tracked using smart contracts Smart contracts can protect the ownership rights Smart contracts can identify false claims and prevent forgeries Smart contracts can be helpful to facilitate wage payments Transportation Protecting copyrighted content Insurance Employment contract 1 3 Smart contracts are self-executing contracts which contains the terms and conditions of an agreement between the peers
  • 35.
    Ethereum is aBlockchain based distributed computing platform featuring smart contract functionality that enables users to create and deploy their decentralized applications Test network (like Ropsten, Kovan and Rinkeby) Private network  Live network (main network) There are three types of network in Ethereum:  What is Ethereum network and how many Ethereum networks are you familiar with? 1 4 What is Ethereum network and how many Ethereum networks are you familiar with?
  • 36.
    Ethereum is aBlockchain based distributed computing platform featuring smart contract functionality that enables users to create and deploy their decentralized applications Test network (like Ropsten, Kovan and Rinkeby) Private network  Live network (main network) There are three types of network in Ethereum:  Smart contracts are deployed on main network What is Ethereum network and how many Ethereum networks are you familiar with? 1 4 What is Ethereum network and how many Ethereum networks are you familiar with?
  • 37.
    Ethereum is aBlockchain based distributed computing platform featuring smart contract functionality that enables users to create and deploy their decentralized applications Private network  Live network (main network) There are three types of network in Ethereum:  Test networks allow users to run their smart contracts with no fees before deploying it on the main network Test network (like Ropsten, Kovan and Rinkeby) What is Ethereum network and how many Ethereum networks are you familiar with? 1 4 What is Ethereum network and how many Ethereum networks are you familiar with?
  • 38.
    Test network (like Ropsten,Kovan and Rinkeby) Ethereum is a Blockchain based distributed computing platform featuring smart contract functionality that enables users to create and deploy their decentralized applications  Live network (main network) There are three types of network in Ethereum:  Private networks are those which are not connected to the main network Private network What is Ethereum network and how many Ethereum networks are you familiar with? 1 4 What is Ethereum network and how many Ethereum networks are you familiar with?
  • 39.
    Where do nodesrun smart contract code? Nodes run smart contracts code on Ethereum Virtual Machine (EVM). It is a virtual machine designed to operate as a runtime environment for Ethereum based smart contracts Smart contract EVM EVM is operated in a sandboxed environment (isolated from main network). This is a perfect testing environment 1 5 Note: Once a user successfully runs the code on EVM, he/she can deploy the smart contract in the main network
  • 40.
    What is aDapp and how is it different from a normal application? Normal App • Normal application has a back-end code which runs on a centralized server • A Dapp is a decentralized application which is deployed using smart contract Dapp Normal application 1 6
  • 41.
    What is aDapp and how is it different from a normal application? Normal App • Normal application has a back-end code which runs on a centralized server • It’s a computer software application that is hosted on a central server • A Dapp is a decentralized application which is deployed using smart contract • A Dapp has its back-end code (smart contract) which runs on a decentralized peer-to-peer network Front-end Smart contract Blockchain (P2P network) (Back-end code) Front-end API Database (runs on server) Process:Process: Dapp Normal application 1 6
  • 42.
    Name some leadingopen source platforms for developing Blockchain applications. • Ethereum is one of the popular platforms for building Blockchain based applications • Eris is used for building enterprise-based solutions • Also, some of the widely used platforms for building Blockchain are Hyperledger Multichain OpenchainErisEthereum 1 7
  • 43.
    What is thevery first thing you must specify in a Solidity file? pragma solidity ^0.4.17; It is necessary to specify the version number of Solidity at the beginning of a code as it eliminates incompatibility errors which can arise while compiling with another version 1 8
  • 44.
    What is thedifference between Bitcoin and Ethereum ? Bitcoin Ethereum P2P Currency Proof of work SHA-256 10 Minutes (approx.) 12.5 BTC Optional 1 BTC = 6934.34 USD Concept Consensus mechanism Hashing Algorithm Time taken to mine a block Reward Transaction fee Value (8/21/18) Criteria P2P currency and smart contract Proof of work/ Proof of stake Ethash 12-15 seconds 3 ETH Fee is calculated in gas 1 ETH = 278.98 USD 1 9
  • 45.
    What is nonceand how is it used in mining?20 Determine the nonceMining Less than target value < targetNonce Hash value 002AE4.. • In Blockchain, mining is a process to validate transactions by solving a difficult mathematical puzzle called proof of work • Proof of work is the process to determine a number (nonce) along with a cryptographic hash algorithm to produce a hash value lower than a predefined target • Nonce is a random value which is used to vary the value of hash so that the final hash value meets the hash conditions
  • 46.
  • 47.
    Name the stepsthat are involved in the Blockchain project implementation. Requirement identification 1 21  Identifying the problem and goal  Identifying the most suitable consensus mechanism  Identifying the most suitable platform  Implementation and deployment costs
  • 48.
    Name the stepsthat are involved in the Blockchain project implementation. Requirement identification 1 2 21 In this step, an individual evaluates all requirements and decides a suitable blockchain platform to be implemented Planning stage
  • 49.
    Name the stepsthat are involved in the Blockchain project implementation. Requirement identification Planning stage Development and implementation of project 1 2 3 21  Designing the architecture  Designing the user interface  Building the APIs
  • 50.
    Name the stepsthat are involved in the Blockchain project implementation. Requirement identification Planning stage Development and implementation of project Controlling and monitoring the project 1 2 3 4  Applying proof of concept (POC)  Identifying and fixing issues 21
  • 51.
    Explain a real-lifeuse-case where Blockchain is being used. Distributor Retailer PurchaserSupplier Raw materials Manufacturing Verify for quality assurance In supply chain management, smart contracts provide permanent transparency and validation of transactions shared by multiple supply chain partners 22
  • 52.
    List and explainthe parts of EVM memory. The memory of an EVM is divided into three types, Storage Memory Stack 23
  • 53.
    List and explainthe parts of EVM memory. The memory of an EVM is divided into three types, • Storage values are stored permanently on the Blockchain network • It is extremely expensive Storage Memory Stack 23
  • 54.
    List and explainthe parts of EVM memory. The memory of an EVM is divided into three types, • Storage values are stored permanently on the Blockchain network • It is extremely expensive Storage Memory Stack 23 • Memory is a temporary modifiable storage • It can be accessed only during contract execution. Once the execution is finished, its data is lost
  • 55.
    1 List andexplain the parts of EVM memory. The memory of an EVM is divided into three types, Note: Memory and stack are relatively much cheaper than storage • Storage values are stored permanently on the Blockchain network • It is extremely expensive • Memory is a temporary modifiable storage • It can be accessed only during contract execution. Once the execution is finished, its data is lost • Stack is a temporary and non- modifiable storage • Here, when the execution completes, the content is lost Storage Memory Stack 23
  • 56.
    What happens ifthe execution of a smart contract costs more than the specified gas? • Initially, your transaction will be executed, but if the execution of a smart contract costs more than the specified gas, then the miners will stop validating your contract • The Blockchain will record the transaction as failed, also the user doesn’t get a refund 24 Transaction failed
  • 57.
    What does thegas usage in a transaction depend on and how is transaction fee calculated? Gas usage depends upon the amount of storage and set of instructions (codes) used in a smart contract Ether = Tx Fees = Gas Limit * Gas Price The transaction fee is calculated in Ether, which is given as 25
  • 58.
    What is fork?What are some of the types of forking? • In simple terms, updating a cryptocurrency protocol or code is called forking • Fork implies that a Blockchain splits into two branches • It can happen when the participants of the network cannot come to an agreement with regards to: o Consensus algorithm o New rules to validate transactions Types of forking Hard forks Soft forks Accidental forks 26
  • 59.
    Differentiate between proofof work vs proof of stake. PoS is an alternate to proof of work by which the Blockchain aims to achieve distributed consensus In Blockchain, PoW is the process of solving a complex mathematical puzzle called mining Here, the probability of mining a block is based upon the amount of computational work done by a miner Miners spend a lot of computing power (with hardware) for solving the cryptographic puzzle The probability of validating a block relies upon the amount of tokens you own. The more tokens you have, the more chance you get to validate a block It was created as a solution to minimize the use of expensive resources spent in mining Proof of work - Proof of stake - 27
  • 60.
    What is 51%attack? In Blockchain, 51% attack refers to a vulnerability where an individual or group of people can control the majority of the mining power (hash rate) This would allow the attackers to prevent new transactions from being confirmed. Further, they can double spend the coins 28 In 51% attack, smaller cryptocurrencies are being attacked 1 32
  • 61.
    What are functionmodifiers in solidity and mention the most widely used modifiers.29 • In Solidity, function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are: View Pure
  • 62.
    What are functionmodifiers in solidity and mention the most widely used modifiers.29 View Pure • View functions are functions that cannot modify the state of smart contract • They are read-only functions • In Solidity, function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are:
  • 63.
    • In Solidity,function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are: 29 View Pure For example, this function returns address To simplilearn[msg.sender] without any data being modified function getsimplilearnName() view { return addressTosimplilearn[msg.sender]; } What are function modifiers in solidity and mention the most widely used modifiers.
  • 64.
    What are functionmodifiers in solidity and mention the most widely used modifiers.29 View Pure • Pure functions are functions that neither read nor write the state of smart contract • They return the same result determined by its input values • In Solidity, function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are:
  • 65.
    • In Solidity,function modifiers are used to easily modify behavior of your smart contract functions • In simple terms, it can build additional features or apply restrictions on the function of smart contracts • The most extensively used function modifiers in solidity are: What are function modifiers in solidity and mention the most widely used modifiers.29 View Pure For example, the above function returns the value of the operation on input variables (num1 and num2) function Calculate(int num1, int num2) pure { return (num1 + num2 * num1) * (num2 * num1); }
  • 66.
    Write a crowdsale smart contract code in solidity programming language30 Function crowdsale( address ifSuccessfulSendTo, uint fundingGoalInEthers, uint durationInMinutes, uint etherCostOfEachToken, address addressOfTokenUsedAsReward ) public { beneficiary = ifSuccessfulSendTo; fundingGoal = fundingGoalInEthers * 1 ether; deadline = now + durationInMinutes * 1 minutes; price = etherCostOfEachToken * 1 ether; tokenReward = token(addressOfTokenUsedAsReward); } Crowd sale function
  • 67.
    Write a crowdsale smart contract code in solidity programming language30 function () payable public { require(!crowdsaleClosed); uint amount = msg.value; balanceOf[msg.sender] += amount; amountRaised += amount; tokenReward.transfer(msg.sender, amount / price); emit FundTransfer(msg.sender, amount, true); } Default function to send Values
  • 68.
    Write a crowdsale smart contract code in solidity programming language30 function safeWithdrawal() public afterDeadline { if (!fundingGoalReached) { uint amount = balanceOf[msg.sender]; balanceOf[msg.sender] = 0; if (amount > 0) { if (msg.sender.send(amount)) { emit FundTransfer(msg.sender, amount, false); } else { balanceOf[msg.sender] = amount; }}} Default function of funds withdrawal

Editor's Notes

  • #8 The report card document is important for academic progress purposes
  • #36 https://medium.com/cybermiles/running-a-quick-ethereum-private-network-for-experimentation-and-testing-6b1c23605bce
  • #37 https://medium.com/cybermiles/running-a-quick-ethereum-private-network-for-experimentation-and-testing-6b1c23605bce
  • #38 https://medium.com/cybermiles/running-a-quick-ethereum-private-network-for-experimentation-and-testing-6b1c23605bce
  • #39 https://medium.com/cybermiles/running-a-quick-ethereum-private-network-for-experimentation-and-testing-6b1c23605bce
  • #40 Once u succeesuly run on evm yu can deploy in d main ntwrk http://www.doc.ic.ac.uk/~ma7614/topics_website/tech.html https://www.logicsolutions.com/5-types-Blockchain-consensus-mechanisms/
  • #41 Application deployed smart contract 2nd- where is it stored It s an app which runs a SC n is stored on a decentralized blockahin
  • #42 Application deployed smart contract 2nd- where is it stored It s an app which runs a SC n is stored on a decentralized blockahin
  • #43 Wgat r some pltf in which
  • #44 Pragmas in Solidity are used to specify certain conditions under which thesource file can or cannot run This pragma ensures that the source code is only meant for compiler versions that are not older than 0.4.17
  • #51 POC is therefore a prototype that is designed to determine feasibility, but does not represent deliverables. Proof of concept is documented evidence that a potential product or service can be successful.
  • #52 . Smart contracts can record ownership rights as items move through the supply chain, confirming who is responsible for the product at any given time. 
  • #53 . Smart contracts can record ownership rights as items move through the supply chain, confirming who is responsible for the product at any given time. 
  • #54 . Smart contracts can record ownership rights as items move through the supply chain, confirming who is responsible for the product at any given time. 
  • #55 . Smart contracts can record ownership rights as items move through the supply chain, confirming who is responsible for the product at any given time. 
  • #56 . Smart contracts can record ownership rights as items move through the supply chain, confirming who is responsible for the product at any given time. 
  • #57 . Smart contracts can record ownership rights as items move through the supply chain, confirming who is responsible for the product at any given time. 
  • #58 . Smart contracts can record ownership rights as items move through the supply chain, confirming who is responsible for the product at any given time. 
  • #59 . Smart contracts can record ownership rights as items move through the supply chain, confirming who is responsible for the product at any given time. 
  • #60 In pow is a process of solving a complex mathematical puzzle.. Which is called mining In pos the same process is called minting
  • #66 Note: As view and pure function modifiers do not modify the state of smart contracts doesn’t consume any amount of gas, as