Professional Documents
Culture Documents
Dr John T. H.Yuen
CYC 306, thyuen@cs.hku.hk 1
OVERVIEW
Ø NFT
2
BLOCKCHAIN: REVOLUTION OF VALUE TRANSFER
Disruptive new business model with no intermediate Cost cutting for existing business model
• e.g. sharing economy • e.g. finance Figure from: SAP
CONSORTIUM BLOCKCHAIN ECOSYSTEM
6
PROOF OF OWNERSHIP
¢ One of the first application of blockchain is to use the
immutable and integrity properties of blockchain
§ Once it is written, it cannot be changed
https://etherscan.io/tx/0x2d6a7b0f6adeff38423d4c62cd8b6ccb708ddad85da5d3d06756ad4d8a04a6a2
8
FROM BLOCKCHAIN TO SMART CONTRACT
TOWARDS BLOCKCHAIN 2.0
9
FROM BLOCKCHAIN TO SMART CONTRACT
11
SMART CONTRACT
¢ Contract ¢ Smart contract (Distributed applications DAPP):
• The code stored and synchronized in blockchain, which
is triggered by user initialized special transaction, and
executed concurrently by consensus nodes.
• It can update the data stored in blockchain and the
modified data remains synchronized among all nodes.
!"#": % → '
An option contract A triggering event like an Smart
between parties is written expiration date and strike contract
DAPP
as code into the price is hit and the contract
blockchain. The contract is executes itself according to !"#": % → ' !"#": % → '
in the public ledger. the coded terms. Smart
Smart
contract contract
DAPP DAPP
!"#": % → '
12
Smart
contract
DAPP
ETHEREUM
THE FIRST SMART CONTRACT PLATFORM
13
ETHEREUM SMART CONTRACT
¢ History
• Late 2013: Ethereum described in whitepaper by Vitalik Buterin
• July 2015: Ethereum blockchain launched
• March 2017, various blockchain start-ups, research groups, and Fortune 500 companies announced the creation of
the Enterprise Ethereum Alliance (EEA).
§ It has >150 members now, including Microsoft, Intel, JP Morgan, Deloitte, CME, DTCC, Mastercard, Cisco.
Demo: https://ethfiddle.com/
BITCOIN VS ETHEREUM
17
ETHEREUM SMART CONTRACTS
19
ETHEREUM VIRTUAL MACHINE
Solidity Contract
contract Bidding { Solidity
/* ... */ EVM Code
Compiler
}
PUSH1 0x60 PUSH1 0x40
MSTORE CALLDATASIZE
ISZERO
...
PUSH2 0x1b4c POP
JUMP
Vyper Contract
def register(key, value): Vyper
/* … */ Compiler
20
ETHEREUM VIRTUAL MACHINE
¡ The EVM (Ethereum Virtual Machine) is a “mini computer” that runs contract code
¡ Contract code that actually gets executed on every node is EVM code
§ EVM code: low-level, stack based bytecode language (i.e. JVM bytecode)
¡ Every Ethereum node runs EVM
21
SMART CONTRACT PROBLEMS
¢ What if our contract has an infinite loop?
¢ Every node on the network will get stuck executing the loop forever!
§ It is impossible to determine ahead of time whether the contract will ever terminate
§ ⇒ Denial of Service Attack!
Ethereum’s solution:
¢ Every contract requires “gas”, which “fuels” contract execution
¢ Every op-code requires some gas in order to execute
¢ If the contract successfully executes, the remaining gas is refunded to the sender
¢ If the contract execution runs out of gas before it finishes, the execution reverts and the gas are not refunded
¢ Purchasing gas == purchasing distributed, trustless computational power
22
¢ An attacker looking to launch a DoS attack will need to supply enough ether to fund the attack
QUESTION
24
BLOCKCHAIN 2.0 ECOSYSTEM
25
ICO
Source: https://blockchainhub.net/ico-initial-coin-offerings/
ICO
27
ICO
Finance
Supply chain
management, Supply Personal health record,
Health health management
food traceability Chain
Blockchain
Applications
IoT
30
Device management and
authentication, data exchange
CENTRAL BANK DIGITAL CURRENCY (CDBC)
• A currency established as money by government regulation, monetary authority or law)
Ø Firstly discussed by the Bank of England in 2015. Major countries with testing: Sweden, China
• Potential advantages:
Ø Technological efficiency: Faster clearing and settlement
Ø Financial inclusion
Ø Prevent crimes such as tax evasion or money laundering
Ø Monetary policy transmission: a new channel for monetary policy transmission (helicopter money)
Ø Prototype of CBDC cross-border payments with Bank of Thailand and ten participating banks from HK and Thailand
35
https://www.hkma.gov.hk/media/eng/doc/key-functions/financial-infrastructure/Report_on_Project_Inthanon-LionRock.pdf
36
NFT
NON-FUNGIBLE TOKEN
38
NON-FUNGIBLE TOKEN (NFT)
Idea/ concept:
It is a way to represent ownership of
anything that is unique.
39
NFT
For instance:
¡ Fungible: Banksnotes, Cryptocurrency (Bitcoin)
¡ “100HKD” Banknote can be exchanged with 2 “50HKD” Banknotes and they worth the same
40
PROOF-OF-OWNERSHIP
41
CURRENT ADOPTIONS
¡ Example:
¡ You bought an in-game item say a new skin, a weapon in
Minecraft
¡ This game is owned by a company - Microsoft.
¡ If one day the publisher stops supporting the game, the
items you bought vanish along with the game. Gone.
¡ But because NFTs are minted on a blockchain, they
confirm real ownership, no one actually owns your NFT
but you.
44
NFT DIGITAL ARTWORK AND COLLECTIBLES
Visa acquired CryptoPunk for USD Adidas and Prada announced they JPMorgan opens a virtual lounge in
$150,000 as they believe “NFTs will will be collaborating to release a metaverse saying that it has an
play an important role in the future of NFT project “estimated at over $1 trillion” market
retail, social media, entertainment, opportunity
and commerce 48
• Compare different types of blockchain
Smart Contract
• Analyse blockchain and smart contract
applications, e.g. NFT
49
“
¡ Reference:
¡ ********
¡ Run the smart contract demo code in: https://blog.zeppelin.solutions/the-hitchhikers-guide-to-
smart-contracts-in-ethereum-848f08001f05
¡ Test it in: https://ethfiddle.com/
50