Module_02
Module_02
2
Introduction to Smart Contracts
3
Introduction to Smart Contracts
Smart contracts acts as the bridge
which connects blockchain to the
real world.
Smart contracts contain business
logic attached to transactions.
A smart contract is a self-
executing contract embedded in
computer code managed by a
blockchain.
The code contains a set of rules
under which the parties of that
smart contract agree to interact
with each other.
4
Smart Contracts on Ethereum
Smartcontracts are coded in a language such as Solidity, and compiled
into a bytecode, that every node on the Ethereum network can run
(Dannen, 2017).
5
An Example of an Ethereum Solidity
Smart Contract
6
Smart Contracts on Ethereum
Above Figure is an example smart contract on Ethereum
written using Solidity – a contract is similar to a class in an
object-oriented language like C++ or Java (Solidity, nd).
7
Applications of a Smart Contract
There are several places where smart Insurance Claim
contracts can be applied. Some of the Government Voting Service
application areas can be stated as
Healthcare Services
follows:
Internet of Things Network
Records Storing
Trading Activities
10
Dimensions of Smart Contracts
12
Platforms for Smart Contract
Ethereum (Buterin et al., 2014): is the first
blockchain platform for developing smart
contracts.
It supports advanced and customized smart contracts
with the help of a Turing-complete virtual machine,
called the Ethereum virtual machine (EVM).
Ethereum is currently the most popular development
platform for smart contracts and can be used to design
various kinds of decentralized applications (DApps) in
several domains.
Ethereum or Ether or ERC-20 is considered as one of
the leading smart contract platform that most
developers choice.
13
Platforms for Smart Contract
14
Overview of Hyperledger Fabric (Vyas et al. 2019)
15
Platforms for Smart Contract
Nem: This Nem platform for smart contract is launched on
March 31, 2015 and is written in Java that is favored by some
developers.
Stellar:Stellar is considered as one of the oldest smart
contract platforms that was founded in 2014 and is
maintained by the Stellar Development Foundation. It is
nowadays used by various large companies into their existing
infrastructure.
Waves: Waves was launched in June 2016 and is an open-
source platform for smart contracts. The goal of this platform
is to address many of the existing barriers to implement
blockchain, namely speed and scalability.
16
Considerations for Choosing a Smart
Contract Platform
Beforeconsidering any smart contract platform, several issues and questions
are needed to in mind such as:
The reputation and need of the smart contract platform.
For instance, if you need to create a cryptographic token, then you can use a blockchain
platform like the Ethereum blockchain network.
If you want security via decentralization, then Ethereum is certainly a good choice.
Depending of the needs of a use case
For instance, if the use case needs a cryptographic token or not.
The use cases that require a permissioned blockchain or not to develop a supply chain
assurance system or other enterprise blockchain applications.
17
Advantage of Smart Contracts
Total transparency
No miscommunication
Efficient performance
No paperwork
Backup
Trustworthy
Guaranteed outcomes
Cost effective
(Source: 101 blockchain.com)
18
Disadvantage of Smart Contracts
Confidentiality
Hyperledger provides its users with the private smart contract.
But smart contracts examples like Ethereum doesn’t offer that privacy to its users.
Error
If the coders make some mistakes in the code and its users will be in loopholes
unintentionally, then there will be a question of accuracy.
Unreliable Information
At the very beginning, there’s a slight possibility to store wrong information. In that
case, the whole process will be an error with that false information.
Rogue Contracts
If a hacker hacked the system by chance, s/he would be able to conduct any illegal activities which will also
execute itself.
(Source: 101 blockchain.com)
19
Role of Smart Contracts in SC&L
Smart
contracts can make supply chain
management simpler and more transparent.
Forthe supply chain industry, smart contracts
provide a fool-proof way of honoring contracts
between parties while meeting the conditions of
the contract.
Sincethe data cannot tamper in a blockchain
transaction, no one can change delivery and
expiry dates and other such important details.
Asinventory will be better managed, the stocks
will have minimum wastage.
20
Security Challenges and Measures
in Smart Contracts
As an emerging technology,
smart contracts currently face
many challenges, such as (Khan
et al., 2021)
legal,
reliance on “off-chain” resources,
immutability,
scalability, and
consensus mechanism issues
21
Security Challenges and Measures
in Smart Contracts
Legal issues: The legal issue of smart contracts is another crucial
aspect of smart contract challenges. For example, GDPR.
Reliance on “off-chain” Resources: Several smart contracts require
receiving information or parameters from resources that are not on the
blockchain itself, so-called off-chain resources.
Immutability issue: The dark side of the immutability concept in
smart contracts lies mainly in the fact that in the event of any errors
made in the code, the immutability feature of a smart contract prevents
it from being rectified.
22
Security Challenges and Measures
in Smart Contracts
Scalability issue: It is the primary concern for many blockchain networks.
For instance, the Ethereum blockchain can verify 14 transactions per second, which is slow as
compared with Visa that can handle up to 24,000 transactions per second.
Indeed, the scalability issue leads to network congestion, increased commission fees for
transactions, and an increase in the time required to confirm the transactions.
Consensus mechanism issue: The consensus mechanism plays the leading role to maintain security,
scalability, and decentralization in the blockchain networks at the same time.
There are several existing consensus algorithms, including Proof-of-Work (PoW), Proof-of-Stake
(PoS), etc.
Although the PoW algorithm enables security in the blockchain, it wastes resources.
Thus, many organizations switch from the PoW algorithm to new consensus mechanisms that
promise lower fees for transactions as well as lower energy costs for the block production process.
23
Conclusions
24
References
https://www.pinsentmasons.com/out-law/analysis/smart-contracts-better-supply-chains
https://www.adaptideations.com/how-are-smart-contracts-transforming-supply-chain-
today#:~:text=Smart%20contracts%20can%20make%20supply,verified%20thereby%20making%20it%20smart.
https://www.signitysolutions.com/blog/role-smart-contracts-reducing-supply-chain-wastage/
https://101blockchains.com/smart-contracts/#5
Androulaki E, Barger A, Bortnikov V, Cachin C, Christidis K, De Caro A, Enyeart D, Ferris C, Laventman G, Manevich Y et al
(2018) Hyperledger fabric: A distributed operating system for permissioned blockchains. In: Proceedings of the Thirteenth EuroSys
Conference, ACM, pp 30
Buterin V et al (2014) A next-generation smart contract and decentralized application platform. White paper
Nxt community: Nxt whitepaper. Available online at https://nxtdocs.jelurida.com/Nxt_Whitepaper (2016). Last accessed: 2020-10-
07
Nakamoto S Bitcoin: A peer-to-peer electronic cash system. Available online at https://bitcoin.org/bitcoin.pdf (2008). Last accessed:
2020-10-20
Khan, S.N., Loukil, F., Ghedira-Guegan, C. et al. Blockchain smart contracts: Applications, challenges, and future trends. Peer-to-
Peer Netw. Appl. (2021). https://doi.org/10.1007/s12083-021-01127-0
Subramanian, Nachiappan, et al. Blockchain and Supply Chain Logistics : Evolutionary Case Studies, Springer International
Publishing AG, 2020.
Vyas, Nick, et al. Blockchain and the Supply Chain : Concepts, Strategies and Practical Applications, Kogan Page, Limited, 2019.
25
THANKS A LOT!
AHSH@UVA. FI