Upgrade to Pro — share decks privately, control downloads, hide ads and more …

FinTech Lecture 11 : Further Smart Contracts

FinTech Lecture 11 : Further Smart Contracts

Slides I used for FinTech - Financial Innovation and the Internet 2022 Fall at Graduate School of Business and Finance, Waseda University on December 16, 2022.

Kenji Saito
PRO

December 16, 2022
Tweet

More Decks by Kenji Saito

Other Decks in Technology

Transcript

  1. Sending money — generated by Stable Diffusion.
    FinTech — Financial Innovation and the Internet 2022 Fall
    Lecture 11 : Further Smart Contracts
    Kenji Saito, Graduate School of Business and Finance, Waseda University
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.1/25

    View Slide

  2. This class is recorded
    7 out of 15 lectures will be online only. When online,
    Camera ON is recommended, but not required
    You do need to speak often anyway (we are going to have a lot of dialogue)
    We will use breakout rooms a lot, but those won’t be recorded unless you do it yourselves (need to be allowed)
    Keep your Zoom client updated!
    We might use latest features
    The recordings could be used for research on (online) learning
    Transcribed for use and anonymized
    Will let you know when the necessity arises
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.2/25

    View Slide

  3. The lecture slides can be found at :
    https://speakerdeck.com/ks91
    Recording and chat text will be posted at Moodle and Discord
    Trial automatic transcriptions will be posted at Discord
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.3/25

    View Slide

  4. Schedule (provisional)
    Lecture 1 9/30 Overview of FinTech (1) •
    Lecture 2 10/7 Overview of FinTech (2) •
    Lecture 3 10/14 Internet Technology and Governance (1) — online •
    Lecture 4 10/21 Internet Technology and Governance (2) •
    Lecture 5 10/28 The World of Apps (1) — online (close enough to Halloween) •
    Lecture 6 11/11 The World of Apps (2) — online •
    Lecture 7 11/18 Basics of Cryptography and Blockchain — online •
    Lecture 8 11/25 Blockchain •
    Lecture 9 12/2 Blockchain and Smart Contracts — online •
    Lecture 10 12/9 Smart Contracts — online •
    Lecture 11 12/16 Further Smart Contracts •
    Lecture 12 12/23 Cyber-Physical Society and Future of Finance
    Lecture 13 1/13 FinTech Ideathon (1) — online
    Lecture 14 1/20 FinTech Ideathon (2)
    Lecture 15 1/27 Presentations and Conclusions
    Online presence is possible but not recommended for non-online lectures for interactivity reasons
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.4/25

    View Slide

  5. Last Time, We Did
    . . .
    Assignment Review — Science Fiction Prototyping
    Smart Contracts and Ethereum — Brief Introduction
    Demonstration of Smart Contracts
    We switch a lot of content between the two weeks, and went with a lot of
    demonstrations last week
    This week, we will cover issues of blockchain in more depth
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.5/25

    View Slide

  6. Today’s Topics
    Impossibility and Challenges of Blockchain
    Brief Introduction to Upgrading and Governance of Blockchain
    Technical Challenges of Blockchain
    Assignment
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.6/25

    View Slide

  7. Impossibility and Challenges of Blockchain
    Transitional technology, in the process of trial and error
    In fact, a lot of new designs are being tested
    If we do not have governance for (or if we do not know how to accommodate)
    technological changes, we cannot use it in society
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.7/25

    View Slide

  8. Hash Rate Transitions (Jan. 2009 - Nov. 2022)
    If malicious participants gain half of the hash rate, blockchain cannot be guaranteed to work correctly
    Risky in principle if the hashrate is doubled quickly → It has happened
    On the other hand, what if it doesn’t double rapidly? → Dilemma of providing room for malicious participants
    What if it suddenly halves? → Very risky in principle, and it also happened
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.8/25

    View Slide

  9. The DAO Incident (uncovered governance challenges)
    The DAO, an autonomous decentralized investment fund built on Ethereum
    Split (fund split) was recursively called, and 3,600,000 ETH (5 to 6 billion yen) was stolen
    (2016/6/17)
    Choices
    Do nothing
    Soft fork (maintains compatibility → freezes the address of the thief)
    Funds are not returned
    Hard fork (No compatibility → rewrites history; who controls the present controls the past)
    Worst occurrence of “Oneness Trap” (described later) in a sense
    Community chose “hard fork” ! (executed on 2016/7/20)
    “Most interesting. Gravity’s silhouette remains, but the star and all its planets have disappeared. How can this be?”
    “Because someone erased it from the archive memory.” — from Star Wars: Episode II – Attack of the Clones
    So the incident never happened
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.9/25

    View Slide

  10. Scaling Out
    Question
    There is one ATM that always has 10 people in line
    Sorry if you are in an advanced environment, and you don’t know what we are talking about
    (or even wonder what an ATM is) ;)
    What happens to the number of people in the queue if we add one ATM?
    Other conditions remain the same
    cf. Daisuke Yamazaki, “Rethinking Scaling Out” (in Japanese)
    http://www.slideshare.net/yamaz2/ss-58813038
    Performance problems can be solved by adding a server
    ⇒ The system scales out
    Blockchain does not scale out in its bare form (because everyone makes and maintains a replica)
    Improvement is possible if you see it as a KVS (Key-Value Store)
    Because of the distributed KVS technology
    But you might lose autonomy
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.10/25

    View Slide

  11. Scaling Out and Blockchain
    7PMVNFPG%BUBUP1SPDFTT
    -PBEQFS/PEF
    #MPDLDIBJO
    1SPQFSMZEFTJHOFEEJTUSJCVUFETZTUFN
    In blockchain, the cost of maintaining data structures rises linearly as transactions increase
    It does not scale out Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.11/25

    View Slide

  12. Blockchain’s “Oneness Trap”
    It does not scale out
    Adding more nodes does not solve or mitigate performance challenges
    Must be “the world is one” to work
    System does not work correctly if the network is partitioned by a large-scale disasters or
    political change
    Difficulty of governance to advance technology
    You cannot “try something different partially, and if it works, apply it to the whole”
    Impossibility of governance :
    Agreement by the “whole” must be maintained, but the “whole” cannot be defined
    ⇒ Powered few changes the technology instead
    ⇒ Those are disadvantages of non-decentralized nature of blockchain
    Conversely, there are great expectations and potential for truly decentralized “record fixation
    device in the air” Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.12/25

    View Slide

  13. Incentive Mismatch
    Ethereum cannot survive as an application platform if ETH as a currency
    crashes and declines
    Supported by validators’ motivation to get ETH
    When the value of ETH drops, validators withdraw
    Can people who want to run apps (smart contracts) buy ETH to maintain the price?
    If ETH’s market participants are primarily app users, may be
    . . .
    (but they aren’t)
    The design of the raw Bitcoin is goal-consistent, but
    . . .
    In other words, “Bitcoin cannot survive if BTC declines” would be fine
    But as proof applications such as Proof of Existence advance, similar problems arise
    Either way, the future of the system depends on the interests of the miners/validators
    ⇒ Need to separate application platforms from currency systems
    That is where the recent ledger technology is going, hopefully (because many still aren’t)
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.13/25

    View Slide

  14. What is the True Worth of Blockchain?
    Roughly speaking, what’s the thing you can never do without blockchain?
    Ex1
    : Digitizing the last will and testament (in a thought-experiment sense)
    After the death of the person, the private key used for the digital signature may no longer be a secret
    Can’t believe a notary saying, “it is as signed before the death” (possible collusion with malicious heir)
    Ex2
    : Online banking passbook data as proof (for the liabilities of banks)
    If you download it as a CSV file, the data anyone can create is not considered as evidence
    Even with the digital signature of the bank, once the private key is leaked, the data can be created by anyone
    Prove “data digitally signed at cetain past date has not been tampered with”
    (instead of believing those who insist so)
    “The Last Will Test” is to ask them if they can do that with their blockchain
    A test to see if something that someone has been pitching as “it’s a blockchain” really makes sense
    An idea (hash-chain with proof of work) that may satisfy this true worth, combined with existing technologies around the
    idea is the Bitcoin blockchain
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.14/25

    View Slide

  15. How Well Is It Realized Today?
    Is there a technology that can pass the “last will test”?
    Public blockchain may pass the test while the market value of the native currency is high
    Defense such that it would cost a lot to tamper with
    When the price of the native currency drops or crashes it becomes unreliable
    Private ledger systems in general only insist, so they do not pass the test
    Mostly, “blockchain made and operated by XXX Inc.” is meaningless ← please be careful
    We are building new technology to make it pass the test
    BBc-1 (Beyond Blockchain One; https://github.com/beyond-blockchain) (just an example)
    There is an inherent challenge of linkage between records and entities
    Includes areas that cannot be solved by engineering alone
    (does the public key really belong to the person?)
    Including the openness of the source code, it is roughly the problem of
    . . .
    “How can we trust automated mechanisms?”
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.15/25

    View Slide

  16. Brief Introduction to Upgrading and Governance
    of Blockchain
    Weaknesses are not left untouched, but continue to be improved
    But governance issues remain
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.16/25

    View Slide

  17. Enhancements to Bitcoin Blockchain
    Virtualization – Open Assets Protocol (no fork)
    Interpret transaction data in a specific way so that quantities independent from BTC can be defined and used
    Bug fix – Segregated Witness (SegWit) (soft fork)
    Signatures are separated from the transaction body
    Better privacy and conciseness – Taproot (and Schnorr signatures) (soft fork)
    Scripts can be partially disclosed by expressing them in Merklized Abstract Syntax Trees (kind of Merkle trees)
    Quickness – Payment channels (no fork)
    Only write to the blockchain when the channel is opened and closed, and in between you can make fast payments
    Conceptually, connected payment channels form a Lightning Network
    How do we upgrade?
    Soft fork : miners vote by setting a bit in a block header
    Wait, voting? Is it an Internet way? (remember “We reject kings, presidents and voting”?)
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.17/25

    View Slide

  18. Payment Channel (Bitcoin’s case)
    "MJDF "

    #PC #

    #MPDLDIBJO

    UP"#
    UP#

    UP"

    UP"
    MPDLUJNF
    QBZUSBOTBDUJPOGFFUPNJOFS
    PQFODIBOOFM pOBMQBZNFOUDMPTFDIBOOFM
    QBZ QBZ
    QBZUSBOTBDUJPOGFFUPNJOFS

    UP#

    UP"


    UP#

    UP"






    MPDLUJNF
    Alice pays fast by sending Bob transactions to pay, which are cut out of the deposit addressed to Alice and Bob
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.18/25

    View Slide

  19. Technical Challenges of Blockchain
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.19/25

    View Slide

  20. Technical Challenges of Blockchain
    Non real-time (probabilistic behavior)
    Difficulty of secrecy (guarantee of verifiability to all)
    Oneness (distribution vs. replication)
    Not scalable (do not scale if replicated to all participants)
    Harder governance of evolution (can’t change if everyone needs to be united)
    Incentive mismatch (discrepancy of motivations for participation in infrastructure and applications)
    Supported by the value of the native currency (crash would stop all applications)
    ⇒ Can be solved by redesigning it zero-base
    Actually in progress (ex. BBc -1)
    Problem with many ledgers is that they are not redesigned zero-base
    ex. Hash-chains without proof of work can be tampered with
    ex. Talking about “newspaper model”, you can’t prove anything by publishing articles in company newsletters
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.20/25

    View Slide

  21. Ethereum’s Approach (solutions blockchain-way)
    Non real-time (probabilistic behavior)
    ⇒ Transactions are finalized after two epochs; 1 epoch = 32 slots
    Difficulty of secrecy (guarantee of verifiability to all)
    ⇒ ZoE (Zcash on Ethereum)
    Oneness (distribution vs. replication)
    Not scalable (do not scale if replicated to all participants)
    ⇒ Sharding, Rollups (layer 2)
    Harder governance of evolution (can’t change if everyone needs to be united)
    ⇒ Benevolent Dictator For Life (BDFL) (with bitter smile ;) )
    Incentive mismatch (discrepancy of motivations for participation in infrastructure and applications)
    Supported by the value of the native currency (crash would stop all applications)
    ⇒ Will people who want to run the apps buy ETH and support?
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.21/25

    View Slide

  22. BBc-1’s Approach (solutions non-blockchain-way)
    Non real-time (probabilistic behavior)
    ⇒ No probabilistic behavior before transaction commits
    Difficulty of secrecy (guarantee of verifiability to all)
    ⇒ Transaction content is kept secret outside the domain, and can be
    encrypted inside
    Oneness (distribution vs. replication)
    Not scalable (do not scale if replicated to all participants)
    ⇒ Scale-out on a domain-by-domain basis, intra-domain DHT in the future
    Harder governance of evolution (can’t change if everyone needs to be united)
    ⇒ Autonomy by domain (don’t care about intra-domain protocols)
    Incentive mismatch (discrepancy of motivations for participation in infrastructure and applications)
    Supported by the value of the native currency (crash would stop all applications)
    ⇒ No native currency, proof of context work by mutual aid
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.22/25

    View Slide

  23. Assignment
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.23/25

    View Slide

  24. Assignment 5. “The DAO Attacked”
    In 2016, an autonomous decentralized investment fund “The DAO” leaked
    3.5M ETH in an attack that exploited a bug in a smart contract, but this
    incident was made to look like it never happened, by the hard fork of Ethereum
    1) Choose between
    A) public policy position (of a country with many victims), or
    B) management position at The DAO
    2) Discuss briefly what would have been the best thing to do from your position
    Deadline and how to submit
    December 20, 2022 at 17:59 JST
    From Moodle (mandatory) (Q&A forum)
    So that your classmates can read your report, refer to it, and comment on it
    Optionally, you can also post to #assignments channel at Discord
    Just plain text, and be concise, please
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.24/25

    View Slide

  25. See You Next Week in Classroom!
    Have a nice weekend!
    Take good care of yourselves
    Lecture 11 : Further Smart Contracts — FinTech — Financial Innovation and the Internet 2022 Fall — 2022-12-14 – p.25/25

    View Slide