Important Question and Answers
Important Question and Answers
Utility Tokens
• Utility tokens are user tokens that provide access to the products or services offered by the
company.
• They can help in driving the internal economy within a blockchain project.
• They can be used to provide advantages to the holders of the utility tokens.
For example, Golem Network Token (GNT) provides the holders access to the Golem ecosystem
Security Tokens
• Security tokens are tokens that represent legal ownership of a physical or digital asset.
• They are generally tied to the company’s profit and loss valuation.
• These tokens are heavily regulated, and failing to comply with the regulations shall have serious
consequences which can be even lead to the shutdown of the complete blockchain project.
Some examples of security tokens are
• Siacoin token,
• Blockstack STX token, etc.
ERC Tokens
• Token management attributes are irrespective of domains where these are used.
• The Ethereum community has taken a lead on this and EIPs standardized definition for
developers to code and deploy.
• ERC tokens define rules that will enable the tokens to be handled and exchanged between
various DApps and wallets.
Examples
• ERC20 TOKENS.
• ERC721 TOKENS.
Cryptocurrency as well as other asset trading can be done using blockchain technology and
solutions can be provided to end user using existing public blockchain networks.
Cryptocurrencies and tokens are example of these applications.
Simple blockchain solutions refer to simple and independent blockchain solutions that help
realization of certain business processes.
Many times, these solutions are done as experimentation to evaluate or build confidence of
stakeholders.
• Enterprise Solutions.
Once simple solutions build confidence among stakeholders and proof-of-value is established,
enterprise systems get integrated with the blockchain solution that has been built.
This helps automate significant work as existing enterprise assets supporting business processes
get utilized to initiate transactions and respond to events coming from blockchain.
• With the success of blockchain solutions, more stakeholders start joining the network to realize
their business value.
• It reaches a critical mass to create enterprise ecosystem using blockchain to deliver value to end
customers and create value for stakeholders.
Ans)
• To solve enterprise problems using blockchain, it is important to capture use case or list of
potential use cases that can be solved using blockchain.
• These use cases need collaboration or information sharing.
Documentation of use cases needs to be done to an extent that it is possible to evaluate the
relevance of use case for blockchain and articulate benefits that use the blockchain would
provide.
Identification of Actors
• Like every other software solution, the key is to identify actors in the given problem
statement.
• In the case of blockchain, some of the actors might be enterprise systems or devices.
• These should also be explicitly captured so that subsequent design happens in good amount
of details.
Activity Diagram:
• Activity diagrams will document all the interactions actors will have with the system and with
each other.
It will be good if these activities are captured, in order to mention activities that would be
automated and those that would not be automated
Sequence Diagram
• Sequence diagrams list details of sequences for each of the transactions.
• These diagrams should be detailed in iterative fashion to capture the detailed technical
interactions and their sequences.
• These help in identification of methods class objects will need to have as well as orchestration
of these methods in the solution.
State Diagram
• State diagrams help identify workflow or workflows that need to be taken care of during
implementation of the blockchain solution.
• These will also identify state database that needs to be maintained at node, and the
conditions and events that a smart contract will need to have in an eventual solution.
Solution Architecture:
• Solution architecture lays down components and their interaction in the overall network. This
will help understand building blocks of the solutions and will have different views so as to
interact with relevant stakeholders.
Unit-4
• Bamboo,
• Vyper,
Solidity is the most popular and widely used language for Ethereum smart contract programming
Pram directive
• A Solidity source code should mandatorily begin with a pragma directive, followed by optional
import directives and one or more contract definitions.
• The pragma enables certain compiler features or checks.
• since it is local to a source file, it has to be added separately in each file if the solution has
multiple Solidity files.
• The most commonly used pragma directive is version pragma, which would look like pragrna
solidity 0.5.2. the compile will happen only on Solidity version 0.5.2.
• The following usage of pragma solidity A0.5.2 means compile on version starting from 0.5.2 up
to 0.6
• . Another way of specifying version pragma is pragma solidity >=0.4.0 < 0. 7 .0. This signifies
that the target compiler version for source code can start from 0.4.0 up to but not including
0.7.0.
import directive
• The next directive after pragma is an optional import directive.
• It can be defined to include symbols from the code present in another file.
• The syntax is import "filepath".
For example,
import globalcontracts.sol
• The import statement treats all file they begin with (current directory) or .. (paren1 directory).
Contract
• Inside this definition is all the variables and functions parts of that contract.
• Although multiple contracts can be defined in the same source file, it is recommended to limit
to one contract per file for the sake of modularity.
• Similar to constructors for a class in most other object-oriented languages Solidity allows
defining constructor inside a contract.
• A contract can also be instantiated from other contracts and the instance variable can be used
to invoke the functions of the contract to where it points
• if,
• else,
• while,
• do,
• for,
• Break
• continue,
• return.
• Inside C, the first line creates an instance of contract D and stores that instance in a variable
named D.
• It is also possible to send ether while creating the instance of D using .value() option.
Functions
• Functions within a contract can be called directly as shown below. Here, function g is called
from function
• functions of other contracts to have to be called externally.
• The second contract c2 instantiates an object of c1 and then calls funC1 through it
2) Write a short notes on , . Ganache ii. Unit testing iii. Ethereum accounts iv. Truffle
framework
i. Ganache
ii. Unit testing
• Running truffle test command and from VS Code terminal or simply test inside truffle
develop interactive console will execute the unit test cases.
• After unit testing on local blockchain network, the smart contract can be migrated to
other networks.
• when using Ganache to work locally, Ethereum accounts with some Ethers that are
needed to migrate and perform transactions were automatically generated.
• The address is obtained by computing keccak-256 hash of the public key and taking
rightmost 20 bytes of that hash.
• Mist wallet, or
• an account is a public-private key pair whereas a wallet hosts account and also provides
• transaction log,
• During account creation, along with public-private key pair, another phrase gets created
known as mnemonic.
• While performing any transaction that changes the state of an event on ethereum
block chain
• This can be done using the key or mnemonic associated with that account.
• 2. Contract accounts.
My Ether Wallet
• MEW is an easy-to-use,
• open-source platform that allows generation of Ethereum wallet address data about the
generated wallet address gets stored on their platform and account owners have
complete control of the addresses they own.
• it aims to perform a lot of heavy lifting and make Ethereum development easier.
Features of truffle frame work
Unit-5
• IPFS stores data in chunks of size 256 kB known as IPFS Objects (Figure 7.1). This object mainly
contains two fields:
• If the file size is more than 256 KB IPFS creats multiple objects till the entire file is
accommodates. In the end, it. creates an empty object which contains just links to all other
objects.
• IPFS stores file contents in an immutable fashion which means when a file is published,
• it is not possible to alter the contents of that file as it changes the hash or content ID of that file.
• The version updates to a file are handled in IPFS using commit objects.
• Whenever a file is added to the network, a commit object is created and when the file is
updated, a new commit object gets created which points to the previous commit object
• In this way, the entire history of a file is available on the network. All these tasks are handled
automatically by the IPFS software.
IPFS Setup and Usage
1. Download dependencies.
2. Install IPFS.
3. Initialize IPFS -navigate to ipfs binary from a terminal window and run ipfs init command.
Adding a file
• Navigate co the directory where this file is located and run the command
• it displays a confirmation message with the content id or hash value of the file
To view contents of a