Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

BLOCKCHAIN & ETHEREUM SMART CONTRACTS

A Technical Seminar Report

BACHELOR OF TECHNOLOGY

In

COMPUTER SCIENCE AND ENGINEERING

By

MEESALA PAVAN KALYAN(18005A0505)


mail-m.pa1chinna@gmail.com

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY
ANANTAPUR COLLEGE OF ENGINEERING
(Autonomous)
ANANTAPUR-515002
ANDHRA PRADESH
2020-2021

1
TABLE OF CONTENTS
List of figures 3

Executive Summary 4

Chapter-1 Introduction 5
1.1 Introduction 5
1.2 History 6

Chapter-2 About 7
2.1 Blockchain 7
2.2 Ethereum Smart contracts 8
2.3 Working of ethereum smart contracts 10

Chapter-3 Observation And Analysis 12


3.1 Advantages 12
3.2 Limitations 12
3.3 Applications 13
Chapter-4 Conclusion 14

References 15

2
List of figures

Figure 1. History of smart contracts

Figure 2.1 Decentralised ledger system(Blockchain)

Figure 2.2.1 Smart contract system

Figure 2.2.1 Ethereum popularity compare to other smart contract systems

Figure 2.3.1 Working of ethereum smart contracts

3
Executive Summary

A smart contract runs on top of the blockchain to facilitate, execute and enforce an
agreement between untrusted parties without the involvement of a trusted third party built by
using ethereum.
A smart contract for short, is a computer program intended to digitally facilitate the
negotiation or contractual terms directly between users when certain conditions are met. With the
advance in blockchain technology, smart contracts are being used to serve a wide range of
purposes ranging from self managed identities on public blockchains to automating business
collaboration on permissioned blockchains.In this report we’ll discuss how ethereum blockchain
works to build smart contracts.

4
CHAPTER -1

INTRODUCTION
1.1 Introduction:

To understand the Ethereum Smart Contracts’ fundamental concept, one must understand
the basics of blockchain technology. A blockchain is a database containing the transactions or
digital events distributed and shared between the parties. This implies that once the information
has been entered into the system, it cannot be erased, creating a verifiable record. The transactions
between two people are hence unregulated by any third party.

Ethereum is claimed to be a programmable blockchain globally, the technology enables


one to transfer cryptocurrency to any individual for a specific amount. Ethereum is a platform that
provides access to the users, to digitized money, along with services that are data-friendly,
irrespective of their background and location.

Smart Contracts imply a program that operates completely on the Ethereum Blockchain.
Both code and data reside in a special address on the blockchain. Hence, Smart Contracts are
composed of Ethereum Accounts, which have a specific amount and can transact through the
network.

1.2 History:

The history of smart contracts can be traced back to the 1990s when Wei Dai, a computer
engineer created a post on anonymous credits, which described an anonymous loan scheme with
redeemable bonds and lump-sum taxes to be collected at maturity ,later discussed the potential
form of smart contracts and proposed to use cryptographic mechanisms to enhance security.

Nowadays, with the development of blockchain technology, smart contracts are being
constructed as computer programs running on blockchain nodes and can be issued among
untrusted, anonymous parties without the involvement of any third party. The first successful
implementation of a blockchain-based smart contract was Bitcoin Script , a purposely
not-turing-complete language with a set of simple, pre-defined commands. As simple forms of

5
smart contract, standard types of Bitcoin transactions, such as pay-to-public-key-hash (P2PKH)
and pay-to-script-hash (P2SH), are all defined with Bitcoin Script . In addition, there also exist
platforms that enable more complex contractual functionalities and flexibilities, ex., Ethereum ,
which adopts a turing-complete language for smart contracts.

Figure 1. History of smart contracts

6
CHAPTER -2

ABOUT
2.1 Blockchain:

Blockchain is a shared, immutable ledger that facilitates the process of recording


transactions and tracking assets in a business network. An asset can be tangible (a house, car,
cash, land) or intangible (intellectual property, patents, copyrights, branding). Virtually anything
of value can be tracked and traded on a blockchain network, reducing risk and cutting costs for
all involved.

Business runs on information. The faster it’s received and the more accurate it is, the
better. Blockchain is ideal for delivering that information because it provides immediate, shared
and completely transparent information stored on an immutable ledger that can be accessed only
by permissioned network members. A blockchain network can track orders, payments, accounts,
production and much more. And because members share a single view of the truth, you can see
all details of a transaction end-to-end, giving you greater confidence, as well as new efficiencies
and opportunities.

Figure 2.1 Decentralised ledger system(Blockchain)

7
2.2 Ethereum Smart contracts:

A Smart contract is a reusable snippet of code (a program) which a developer publishes


into EVM memory. Anyone can request that the smart contract code be executed by making a
transaction request. Because developers can write arbitrary executable applications into the EVM
(games, marketplaces, financial instruments, etc.) by publishing smart contracts, these are often
also called dapps or Decentralized apps.

Smart contracts are a type of Ethereum account. This means they have a balance and they
can send transactions over the network. However they're not controlled by a user, instead they are
deployed to the network and run as programmed. User accounts can then interact with a smart
contract by submitting transactions that execute a function defined on the smart contract. Smart
contracts can define rules, like a regular contract, and automatically enforce them via the code.

What Ethereum does is by constructing an abstract foundational layer. It is a blockchain


made ‘Turing completeness’ programming language and allows anyone to write smart contracts
for decentralized apps where there are arbitrary regulations for ownership.

Figure 2.2.1 Smart contract system

8
Public blockchains set no requirement for peers to participate, hence all peers have the
right to deploy smart contracts. In order to prevent spamming, when instantiating or invoking
smart contracts on a public blockchain, one is often required to pay a certain amount of fee.
Limited by its functionality, the scripting language used in Bitcoin–Scripts is hardly used in
constructing complex contractual terms. While the general-purpose Solidity language in
Ethereum can be used for a much wider variety of applications.

According to Etherscan , among the one million Ethereum accounts that altogether hold
105.6 million Ethers,1 half of them are contract accounts with a total balance of 12 million Ether.
Competitors such as Neo and EOS , are also independent blockchains facilitating peer consensus
and smart contracts. As illustrated in Figure below Ethereum is the most popular platform among
the 7 blockchain instances on a survey basis.

Figure 2.2.1 Ethereum popularity compare to other smart contract systems

9
2.3Working of ethereum smart contracts:

Ethereum uses proof-of-work (PoW) mining protocol for network consensus. Ethereum
smart contracts reside in Ethereum Virtual Machines (EVMs), which isolates them from the
blockchain network to prevent the code running inside from interfering with other processes.
Once deployed, the smart contract obtains a unique address that is linked to a balance, similar to
an externally controlled account (EOA) owned by a user. A smart contract can send transactions
to an EOA or another contract.

Figure 2.3.2 illustrates the working of Ethereum smart contracts, where the mining
process is omitted for simplification. In Step 1, Client 1 creates a smart contract for voting in a
high-level language, e.g. Solidity . This smart contract is compiled into machine-level byte code
where each byte represents an operation, and then uploaded to the blockchain in the form of a
transaction by EVM 1.

Figure 2.3.1 Working of ethereum smart contracts

10
A miner picks it up and confirms it in Block #i+1. Once a voter has submitted his vote
via the web interface, the EVM 2 queries the data from the web and embeds it into Transaction tx
and deploy it to the blockchain. State of the voting contract is updated in Block #i+2 with the
confirmation of transaction tx. If Client 3, the coordinator, later wants to check the states stored in
the contract, s/he has to synchronize up to at least Block #i+2 to see the changes caused by tx.

11
CHAPTER-3

OBSERVATION AND ANALYSIS


3.1 Advantages:

➔ Smart contracts do not need brokers or other intermediaries to confirm the agreement;
thus, they eliminate the risk of manipulation by third parties. Moreover, the absence of
intermediaries in smart contracts results in cost savings.
➔ All the documents stored on blockchain are duplicated multiple times; thus, originals can
be restored in the event of any data loss
➔ Smart contracts are encrypted, and cryptography keeps all the documents safe from
infiltration.
➔ Smart contracts automate tasks by using computer protocols, saving hours of various
business processes.
➔ Using smart contracts results in the elimination of errors that occur due to manual filling
of numerous forms.

3.2 Limitations:

➔ Changing smart contract processes is almost impossible, any error in the code can be
time-consuming and expensive to correct.
➔ According to the concept of good faith, parties will deal fairly and not get benefits
unethically from a contract. However, using smart contracts makes it difficult to ensure
that the terms are met according to what was agreed upon.
➔ Although smart contracts seek to eliminate third-party involvement, it is not possible to
eliminate them. Third parties assume different roles from the ones they take in traditional
contracts. For example, lawyers will not be needed to prepare individual contracts;
however, they will be needed by developers to understand the terms to create codes for
smart contracts
➔ Since contracts include terms that are not always understood, smart contracts are not
always able to handle terms and conditions that are vague.

12
3.3 Applications:

➔ Government voting system.


➔ Health care.
➔ Supply chain.
➔ Financial services
➔ Decentralized apps

13
CHAPTER -4

CONCLUSION
Ethereum is hence a decentralized platform, running smart contracts. They run on the
Ethereum Virtual Machines. Therefore, it is one of the most common blockchain platforms for
the development of smart contracts. Ethereum, a public blockchain, proves viable since the
language supports the ‘Turing Completeness’ feature, allowing it to create advanced and
custom-made contracts.

Smart contracts are gaining an increasing popularity in both public and private domains
as they enable peer-to-peer operation on public blockchains and have the potential to improve
efficiency and transparency in business collaborations. However, the current form of smart
contracts are still limited in their ability to fulfill all expectations. We believe the future
development should mainly focus on improving semantics of smart contracts, their integration
with existing procedures, as well as their usability, acceptance and legality. If smart contracts can
be made to work with enhanced security, legality and flexibility, we can foresee a wider adoption
of smart contracts.

14
REFERENCES

[1]Introduction to smart contracts | ethereum.org

[2]What is Ethereum Smart Contract in Blockchain Technology? An Overview | upGrad blog

[3]What is Blockchain Technology? - IBM Blockchain - India | IBM

[4]Smart Contracts - Overview, Uses, Benefits, Limitations (corporatefinanceinstitute.com)

[5] Ethereum 101 - CoinDesk

15

You might also like