IS4302_lecture 3_Fall 2024
IS4302_lecture 3_Fall 2024
IS4302
Blockchain and Distributed
Ledger Technologies
Lecture 3
• Smart Contracts
• Tokenization
• NFTs
• Important standards of Ethereum
2
Smart Contracts
3
How does a smart contract work?
• 📇📇 A listing site to hold the information on all the cars you’d like
to see
• 📯📯 A way of communicating with sellers
• 💰💰 A payment system to allow you to exchange money once
you’ve found your car
• 💳💳 Some capacity to get a refund if the car turns out to be a dud
• � A way to register the change of car ownership with the
authorities
4
• 📇📇 A listing site to hold the information on all the cars you’d like to see
• 📯📯 A way of communicating with sellers
• 💰💰 A payment system to allow you to exchange money once you’ve found
your car
• 💳💳 Some capacity to get a refund if the car turns out to be a dud
• � A way to register the change of car ownership with the authorities
Each of these components requires a level of trust between you and the site or
service in question. In addition, each part of that process is typically controlled by
a different company or individual.
It wouldn’t take much for a sneaky person or organization to meddle with any of
the above elements, spoiling or voiding the whole process.
5
How does a smart contract work?
8
Who is using smart contracts?
9
Who is using smart contracts?
They’ve also been adopted by corporations and some governments. Some of the
most prominent examples include:
• Smart Contracts
• Tokenization
• NFTs
• Important standards of Ethereum
11
What are Crypto Tokens?
12
What are Crypto Tokens?
13
Coins vs. Tokens
16
Benefits of Tokenization
Fewer Intermediaries:
• Traditional financial industry intermediaries not needed for
holding or trading crypto
Automation:
• In stark contrast to the traditional financial sector, most of the
bureaucratic procedures on a blockchain can be automated
using smart contracts.
• These algorithms can handle processes involving the exchange
of valuables, such as fiat money for stocks, tokens, or real
estate.
17
Some Types of Tokens
18
Utility Tokens
19
Governance Tokens
20
Security Tokens
What is a “Security”
• Any representation of an ownership position in a publicly-
traded corporation, or the ownership rights represented by an
option. In simpler terms, a security is any financial asset that
can be traded with a promise of returns.
• When a security has been issued to digitally to represent a real
tradable asset, it becomes a security token. These tokens serve
as a reference to the original asset/data.
21
Overview
• Smart Contracts
• Tokenization
• NFTs
• Important standards of Ethereum
22
NFTs: What Are Non-Fungible Tokens?
In brief
• Cryptographically unique tokens that are linked to digital (and
sometimes physical) content, providing proof of ownership.
25
Early Use Case: Collectables
CryptoPunks
• A series of 10,000 24x24 pixel art images depicting "punks" with
randomized attributes, including gender, headgear and eyewear.
• They're chiefly used for "flexing"—demonstrating membership
of an exclusive fraternity
26
Early Use Case: Collectables
27
Uses: Collectables
• Both the tokenURI and image of this NFT are stored off chain
on IPFS
• InterPlanetary File System (IPFS) a protocol and file
sharing peer-to-peer network for storing and sharing data in
a distributed file system.
28
Overview
• Smart Contracts
• Tokenization
• NFTs
• Important standards of Ethereum
29
How Tokens Work in Ethereum
32
Ethereum standards ensure that
Importance of Ethereum all tokens on the network follow
Standards a set of rules and guidelines
33
Standard interfaces simplify user interactions
with tokens
Benefits of Ethereum
Standards
34
Overview of Ethereum The most widely used standard is
ERC-20, which defines a common
Token Standards interface for fungible tokens.
35
Important standards
• ERC165 – method introspection
• ERC820#/1820 – contract registry
• Token standards:
• ERC20
• ERC721 – Non-fungible token
• ERC777 – improved ERC20
• ERC998 – composable NFT
• EIP1155/EIP1178*/EIP1203* – Multi-class token (FT or NFT
class)
• ERC137/181 – ethereum domain name service
• EIP1078* – universal login
• ERC1776** – meta transactions
• ERC1337** – subscription payment 36
ERC20
37
What are ERC-20 Tokens?
38
What are ERC-20 Tokens?
• Smart contracts
• Create tokens: To get tokens, you send ETH to the smart
contract, which gives you tokens in return
• Handle Token Transactions
• Keep track of balances of each token holder
39
What are ERC-20 Tokens?
40
ERC20 Methods
41
ERC20 Methods
• totalSupply()
• Defines the maximum tokens in circulation. When this is
reached, no more tokens will be created.
• balanceOf(address _owner)
• This function returns the balance of tokens owned by a specific
address (_owner).
• transfer(address _to, uint256 _value)
• Sends tokens from the total supply to the user
• transferFrom(address _from, address _to,
uint256 _value)
• Transfers tokens between any two users who have them
42
ERC20 Methods
43
Example of how to implement an ERC-20 token
in Solidity:
44
ERC721 (Non-fungible token)
45
ERC721 (Non-fungible token)
46
ERC721 (Non-fungible token)
47
ERC721, Main differences to ERC-20
safeTransferFrom()
checks validity, then transfers
token only if checks pass.
Otherwise, transfer reverts.`
49
ERC721 (Non-fungible
token)
Safe version of transfer
performs a
supportsInterface()
check before transfer
(ERC-165)
50
Example Implementation
Implementing ERC721
with the OpenZeppelin
Library.
51
Example Implementation
53
ERC998 (Composable NFTs)
• ERC721 as a ‘tree’
• Allow for child → parent, parent → child
• Transferring asset as a tree/subtree
• Use case:
• Bundle physically connected assets
• Game players can own NFTs that contain other NFTs
representing characters, items, and locations.
• Complex financial instruments based on NFTs, such as
collateralized debt obligations (CDOs) or tokenized funds that
contain a variety of different NFTs.
54
ERC998 (Composable NFTs)
55
ERC998 (Composable NFTs)
56
ERC1155/1178*/1203*(Multi-class token)
57
ERC1155/1178*/1203*(Multi-class token)
• ERC1155/1178/1203 offers:
• Create and trade multiple fungible & non-fungible tokens
within a single contract
• Simpler token management & lower gas costs
• On-chain royalty payments for token creators to share in
revenues generated.
61
ERC1155/1178*/1203*(Multi-class token)
62
ERC1078 - Universal Login
63
Generate a unique Ethereum address
associated with a public key using
ERC1078 identity.
How ERC1078 Works
64
ERC1078*(Universal login)
66
Subscription payment (ERC1337**)
67
How ERC1337 Works
68
Conclusion
69
Thank you!
70