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

FinTech 9-10 : Smart Contracts and Decentralize...

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

FinTech 9-10 : Smart Contracts and Decentralized Finance

Slides I used for FinTech - Financial Innovation and the Internet 2026 Fall at Graduate School of Business and Finance, Waseda University on October 30, 2026.

Avatar for Kenji Saito

Kenji Saito PRO

October 28, 2026

More Decks by Kenji Saito

Other Decks in Technology

Transcript

  1. generated by Stable Image Ultra FinTech — Financial Innovation and

    the Internet 2026 Fall Lecture 9-10 : Smart Contracts and Decentralized Finance Kenji Saito, Graduate School of Business and Finance, Waseda University Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 1/72
  2. This class is recorded Using Zoom For your convenience in

    reviewing the lectures Recordings are shared via Dropbox and you can ask questions with time-stamped comments Of course, students are encouraged to ask questions in class The recordings could be used for research on (online) learning Transcribed for use and anonymized Will let you know when the necessity arises Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 2/72
  3. The lecture slides can be found at : https://speakerdeck.com/ks91/collections/fintech-2026-fall Recording

    and chat text will be posted at Moodle and Discord Note, however, that chat messages are often unnoticed I have invited you all to the Discord server of the class (continued from the past years) Look for the first announcement at Moodle Trial automatic transcription for lectures will be posted at Discord Because it would contain many mistakes More information is available on Discord, so you have a reason to join the Discord server Furthermore, in the end, participation in Discord may become mandatory for the progress of group work Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 3/72
  4. Schedule (provisional) Lecture 1 10/2 Overview of FinTech (1) •

    Lecture 2 10/2 Overview of FinTech (2) • Lecture 3 10/9 Internet Technology and Governance (1) • Lecture 4 10/9 Internet Technology and Governance (2) • Lecture 5 10/16 The World of Apps (1) online • Lecture 6 10/16 The World of Apps (2) online • Lecture 7 10/23 Blockchain (1) • Lecture 8 10/23 Blockchain (2) • Lecture 9 10/30 Smart Contracts and Decentralized Finance (1) online • Lecture 10 10/30 Smart Contracts and Decentralized Finance (2) online • Lecture 11 11/13 Cyber-Physical Society and Future of Finance (1) online Lecture 12 11/13 Cyber-Physical Society and Future of Finance (2) online Lecture 13 11/20 FinTech Ideathon Lecture 14 11/20 Presentations and Conclusions Online presence is possible but not recommended for non-online lectures for interactivity reasons Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 4/72
  5. Last Week, We Did. . . Basics of Cryptography Zero-knowledge

    proof Assignment Review Understanding Blockchain Bitcoin’s “question” and “answer” / Beaker/Newspaper Model (physical model of Bitcoin) Applicability of Blockchain Impossibility and Challenges of Blockchain Brief Introduction to Upgrading and Governance of Blockchain Assignment — Science Fiction Prototyping Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 5/72
  6. Today’s Topics Applicability, Impossibility and Challenges of Blockchain Brief Introduction

    to Upgrading and Governance of Blockchain Assignment Review Smart Contracts and Ethereum Ethereum — Beaker/Newspaper/Machine Model Smart Contract Programming ERC-20 and Other Standards Demonstration (Maybe Next Week) How do we purchase digital rights to a real estate with digital currency? Assignment Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 6/72
  7. Proof and/or Message Embedded in block 0 You can embed

    data unrelated to Bitcoin in the free space of transaction (TX) data Text string embedded in the 1st TX of the 1st block “The Times 03/Jan/2009 Chancellor on brink of second bailout for banks” Anyone can verify this Specify 0 in the search field of https://www.blockchain.com/explorer , proceed to BTC Block See the input for the only TX in the block that came up Use “Hex to ASCII Text Converter” for example What is the intention? Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 7/72
  8. Applicability of Blockchain Possible applications and what you can actually

    do today Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 8/72
  9. Possible Applications (as Hyperledger project sees them) Financial Assets Direct

    access (no need for mediation), agreed real-time settlements, business rule descriptions, and confidentiality Corporate behavior (automating corporate management, especially in financial matters) Real-time execution and confidentiality control of share splits, capital reductions and consolidations, share transfers and exchanges, mergers, third-party allocation of new shares, etc. Supply Chain Traceback of materials, and record and search from production, storage to sales (beware of linkage problem) Master Data Management Only authorized personnel can update and designated reviewers approve it Sharing Economy and IoT Smart cities/towns, transportation, healthcare/fitness, retail, architecture, education, etc. (implicitly real-time and on a large scale) where trust is not necessarily established Red letters denote parts that blockchains are not good at Within the problems we want to solve, there are sub-problems that have not been solved yet Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 9/72
  10. Actual Applications to Date Currency and Remittance Ex. Bitcoin, .

    . . Remittances that bypass banking networks That’s a huge impact Proof of Existence Ex. Proof of Existence, Everledger (in the past), . . . Embed arbitrary digests in a blockchain (piggybacking hack) There is also a method of embedding a single digest of a large number of records Proof that a record has existed and has not been tampered with Origin Certification (traceability, tracking and accounting) This is the originally intended application category of blockchain (an alternative to “newspaper”) Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 10/72
  11. General Model of Existence and Certification doc doc doc 1

    2 3 4 digest digest digest digest digest digest …… …… …… digest …… …… Merkle tree (kept by the service, and sent partially to each client) doc digest doc n digest duplicate in case of odd number digest digest Information disclosed to parties requiring proofs blockchain … … digest digest public information record Merkle root * Upon receiving doc 3, Alice also receives digests shown in blue and whether they are on the left or right. can retrieve information * Starting with the digest of doc 3, Alice will know the series of digests to be concatenated, so she can reproduce the calculations up to the Markle root and confirm that the resulting Markle root matches the value recorded in the blockchain. * Anyone can reproduce the process and verify the existence of docs if they understand the principle and have necessary information. Merkle trees are also used within blocks in blockchain to record transactions or states Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 11/72
  12. 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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 12/72
  13. Hash Rate Transitions (Jan. 2009 - Oct. 2026) 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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 13/72
  14. Reality vs. Blockchain A thought experiment You want to start

    a new business on the beach: If a customer pays in bitcoin, a drone flying overhead will drop them a can of juice When should the drone drop the can? Reality that goes in real-time and blockchain’s behavior are very different But as a business decision, a risk taker can drop the canned juice the moment they detect a payment As long as they are in a position to use social infrastructure, they can act disruptively Not because it is a perfect technology But because it is a fairly cheap platform (cost is paid by the miners) Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 14/72
  15. The DAO Incident (uncovered governance challenges) The DAO, an autonomous

    decentralized investment fund built on Ethereum Split (fund split) was recursively called, and 360,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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 15/72
  16. 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 (don’t look at the finger, look at the moon, abstract! this is a model!) 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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 16/72
  17. Scaling Out and Blockchain Blockchain Load per Node Properly designed

    distributed system Volume of Data to Process In blockchain, the cost of maintaining data structures rises linearly as transactions increase It does not scale out Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 17/72
  18. 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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 18/72
  19. 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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 19/72
  20. 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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 20/72
  21. 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/BBc-2 (Beyond Blockchain One/Two; 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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 21/72
  22. Brief Introduction to Upgrading and Governance of Blockchain Weaknesses are

    not left untouched, but continue to be improved But governance issues remain Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 22/72
  23. 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? Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 23/72
  24. Payment Channel (Bitcoin’s case) Alice (A) open channel to A&B

    pay 0.01 pay 0.01 final payment & close channel to B 2 0.01 to A 1.0001 to B 0.99 0.02 to A to A locktime ...... to B 0.98 1.0 0.07 to A locktime 4 1 5 0.93 6 Bob (B) Blockchain 3 pay transaction fee to miner 7 pay transaction fee to miner Alice pays fast by sending Bob transactions to pay, which are cut out of the deposit addressed to Alice and Bob Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 24/72
  25. Science Fiction Prototyping What about it? Lecture 9-10 : Smart

    Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 25/72
  26. Why Science Fiction Prototyping? What is Science Fiction? Fantasy based

    on or disguised as the thoughts and ideas of science and technology The world with existing science and technology is the real world Ex1 : Medical drama Ex2 : Economic novels The world with science and technology unknown to the real world → Fiction Ex1 : Medical drama with nano-machines Ex2 : Drama with digital currency that depreciates (my book “NEO in Wonderland”) Designing new media and putting it into society = living science fiction To work out plans for that = to write science fiction Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 26/72
  27. Assignment Review Lecture 9-10 : Smart Contracts and Decentralized Finance

    — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 27/72
  28. Assignment 4. “Smart Contracts” Please think freely with the image

    of the word “smart contract” to fantasize a specific application example, and state the application briefly That is, go ahead and write a very short science fiction (You may add your comments or questions about the class, if any) Deadline and how to submit October 27, 2026 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 So that anyone in our Discord can read your report, refer to it, and comment on it Just plain text, and be concise, please You may want to apply Kent Beck style for abstracts (4 sentences) 起 (problem) 承 (why it is a problem) 転 (startling sentence) 結 (consequences) of a story Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 28/72
  29. Trends and Measures Trends . . . of your reports

    Measures . . . how to improve the class 17 responses out of 18 students (as of Wednesday noon; always better late than never) Your Sci-Fi stories are about. . . beer taproom / hoarder prevention / chip that signs behind one’s ear / travel insurance / small-scale national heritage ownership / surrender contract / search for lost dogs / international trade payments / city’s flood gate / selling one’s future salary / contract that protected me / divorce in four seconds / trading dreams / human survival relied on an automated open ledger / sports circles / autonomous asset contract Very interesting stories! Many of your stories ended with The Monkey’s Paw-like situations A contract brings about a certain outcome, but something important is lost in the process It seems that many were based on the premise that the current monetary economy and specialised labour society would remain unchanged Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 29/72
  30. R-san’s Story (so using a signing key as an identity

    is a bad idea) Mika liked to watch her money arrive: 0.61 yen for every second she worked, ticking upward like a pulse. In 2061, nobody waited for payday. Salary streamed in, rent and insurance streamed out, all signed by a chip behind her left ear. On Tuesday night, a solar storm hit Tokyo. By morning, the chip was dead. The new one took ten minutes to install. It worked perfectly. It just didn’t know her. “Can you move my savings to it?” she asked the clerk at the registry. “Only your old key can sign that.” “Then override it.” The clerk looked almost embarrassed. Overrides had been abolished after the Freeze of 2049, when a single government order emptied forty million accounts in one afternoon. Since then, no one could touch anyone’s money. That was the promise. Her new key had no balance, no lease and no work history. Her employer s contract hired by reputation score, and hers was zero, so she was offered a probation trial at half pay. Apartment contracts required twelve months of signed rent history. Her old key had nine years of it, and it was still automatically paying rent on an apartment whose door no longer opened for her. She slept in the corridor outside, listening to the lock hum. Within a month, she had joined the Blanks: people with working chips and empty pasts, living under the elevated tracks and starting again from zero. Every night she checked a public terminal. Her old self was still there, still paying rent, still in good standing. No one could ever take her money again. Not even Mika. Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 30/72
  31. L-san’s Story : The World Where Objects Own Themselves In

    the 22nd century, society faces a paradox: many valuable possessions remain unused for years, while others struggle to access the same resources. Traditional ownership allows people to keep assets indefinitely, even when they no longer need them, leading to inefficient resource allocation. To address this issue, a new system called the Autonomous Asset Contract gives each object its own digital identity, wallet, and smart contract. Instead of being sold to permanent owners, objects collect usage fees to cover production and maintenance costs, manage their own life cycles, and even refuse access to those who have mistreated them. For example, when a piano remains unused for a year, it automatically finds a new music student, arranges delivery, and pays for its own tuning using accumulated funds. As a result, manufacturers no longer simply sell products but create assets that can sustain themselves, while people shift from permanent owners to temporary users. In this world, nobody truly owns things anymore; people simply keep them company for a while. ⇒ Isn’t this a great story? Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 31/72
  32. D-san’s Explanation in the Fiction The value of a smart

    contract is that it lets parties who don’t trust each other agree on the rules before a conflict begins ⇒ Just because an agreement can be set down in a way that cannot be altered does not mean an agreement can be reached Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 32/72
  33. Y-san’s Explanation in the Fiction (1) Only a hard fork

    could rewrite the contracts, but it required the whole network to agree ⇒ A fork does not require agreement with those who are not in the fork A hard fork participants can be minority A soft fork participants must be majority, otherwise the fork can be wiped out Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 33/72
  34. Y-san’s Explanation in the Fiction (2) People love smart contracts

    because no one can interfere with them and they execute instantly and automatically ⇒ Actually, They are protected from interference by the high market price of the native tokens, They take time for finalization, and They may only be executed upon receipt of messages, and validators execute them Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 34/72
  35. Smart Contracts and Ethereum Ethereum — Beaker/Newspaper/Machine Model Smart Contract

    Programming Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 35/72
  36. Overview of Ethereum Blockchain and State Transition EVM (Ethereum Virtual

    Machine) Ethereum explained by a physical model Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 36/72
  37. What is Ethereum? Vitalik Buterin, “Ethereum White Paper: A NEXT

    GENERATION SMART CONTRACT & DECENTRALIZED APPLICATION PLATFORM” Applying blockchain technology Block interval : at most 1 block in a 12-second time slot Put a programming language on it Turing complete = can emulate a universal Turing machine (well that’s almost a definition of a programming language) Foundation for DApps (applications that automate the center) An attempt to make the current financial and monetary system obsolete That’s what smart contracts are all about Automate digital asset transfers and their state transitions Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 37/72
  38. Blockchain and State Transitions external actors digital signature human, for

    example state stateʼ storage account set of transactions EVM code (contract code) Ether → gas EVM message or a new autonomous object invoke data exchanged among accounts or Ether Blockchain = Run of a state machine (state transition system) = Operation of a computer Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 38/72
  39. Glossary Ether (ETH) Native currency of Ethereum (compensation for validating)

    External Actor A real person/entity who can digitally sign, having an account EOA : Externally-Owned Account Autonomous Object (internal actor) ← or rather, automated object Operates autonomously within the system, and has an account That said, if you don’t send a message, it won’t work (and validators run them) Account Has an Ether balance, and can have storage (state) and EVM code EVM Code Smart contract program Smart contract = application program on Ethereum 6= intelligent contract Authenticity is ensured by being recorded in blockchain Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 39/72
  40. EVM : Ethereum Virtual Machine external actors digital signature human,

    for example stateʼ state storage account set of transactions autonomous object EVM code (contract code) Ether → gas EVM message or a new autonomous object invoke data exchanged among accounts or Ether Triggered when an automated object receives a message, performs a contract, and changes state Gas (computing resource) must be bought for the following reasons To avoid infinite loops and control congestion (base fee; burnt), and compensate the block proposers (priority fee) Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 40/72
  41. Beaker/Newspaper/Machine Model (1/7) Physical model of how Ethereum works today

    cf. PROOF-OF-STAKE (POS), Eth2Book Preconditions About beakers (containers for native cryptocurrency) Unlike Bitcoin, beakers are not created anew for each transaction, but are created as a set with the private key and placed at a specific address for each Private key opens the stopper, and the liquid is injected somewhere (no need to empty it) The pour spout is always open, allowing liquid to be injected About Liquid The liquid is used as fuel for the mechanical calculator to run automatically About the machine (mechanical calculator) We use the world’s one and only mechanical calculator It has a vast memory and works by inserting punch cards and setting a beaker Programmers cannot type directly into a punch card Use a service that compiles human-readable code into punch cards Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 41/72
  42. Beaker/Newspaper/Machine Model (2/7) Transactions Calculator-assisted processing is called a transaction,

    and there are three types: (1) Set source and destination beakers and move the fuel by the specified amount (2) Set up a beaker with a card deck describing the application program and initial parameters, and write the program in memory (deploy) · The calculator also executes the initialization code for that program to set up the application (3) Set up a card and beaker and use it to call a program in memory Signed newspaper article The person wishing to execute their transaction distributes copies of the following information as their signed article to the validators described later Address of the beaker from which the fuel is injected (signed so we know it is you) Punch card contents Amount of fuel that may be given to the validator running the calculator (priority fee) and the maximum amount of fuel that may be used The articles of the executed transactions make up one page of the newspaper Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 42/72
  43. Beaker/Newspaper/Machine Model (3/7) Fuel consumption Mechanical calculator does not run

    at a constant fuel consumption rate; it runs worse (requires more fuel) when transactions are crowded and better (requires less fuel) when not One unit of calculation that consumes fuel is confusingly called gas Newspaper page size is also weighed in gas (Total gas usage for executed transactions) The standard paper size is 15 million gas and the maximum size is 30 million gas If the page standard is exceeded, the fuel consumption of transactions will be worse on the next page, and if below the standard, the fuel consumption of the next page will be better People like to use the calculator when they can get the most mileage, so we hope this will help regulate congestion (what do you think?) Move to the next method with sufficiently accumulated costs of PoW Method described on the next page and beyond cannot be started from zero Ethereum has moved from PoW to the next scheme in September 2022 Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 43/72
  44. Beaker/Newspaper/Machine Model (4/7) Deposits and Validators Fuel is weighed in

    units of Gwei where 1 Giga Gwei is ETH A validator is an entity or person who has deposited 32 ETH(!) into the system Validators are required to do the following tasks, and if they do them diligently, they will increase the ETH deposit, and if they do them sloppily, they will forfeit the ETH deposit · The maximum value that counts as a deposit is 32 ETH (actual amount can be more) · Validator is expelled for falling below 16 ETH Slot and Newspaper Page (block) proposal Time is separated by slots at 12 second intervals In each slot, one of the validators wins a raffle (in the usual sense) Winning validator lets selected articles actually run on the calculator (if they fail to run, the articles are discarded), composes a page of the newspaper and proposes it to everyone If the validator skips it, the page was not made in that slot Other validators that received the page will do confirmation calculations Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 44/72
  45. Beaker/Newspaper/Machine Model (5/7) Epoch and Finalization 32 slots as 1

    epoch (384 sec) Validator is assigned to a committee for one of the slots in each epoch (beacon committee) to testify (sign) the correctness of the page proposed for that slot The first slot in an epoch is called the checkpoint Validator specifically attests to the checkpoints of two consecutive epochs If testimonials from validators that amount ≥ 32 of the total deposit are obtained The latest checkpoint is justified The second latest checkpoint is finalized (the pages up to it are their final versions) Sync Committee Every 256 epochs, 512 validators are selected as a committee to testify for the pages This will help non-validators to consider the correctness of the pages Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 45/72
  46. Beaker/Newspaper/Machine Model (6/7) What if the sequence of pages in

    an epoch branches? Since everyone does what they do as they please, divergence may occur For example, one validator might think that no block was proposed in the previous slot In that case, we will use the history with the most testimonials weighed by the deposits (modified Nakamoto consensus ← the history with the largest cost is the most correct) Confiscation and expulsion If you are selected for a sync committee and do not respond, you forfeit from your deposit If you do not testify at checkpoints, you forfeit from the deposit Failure to finalize a page for more than 4 epochs will result in forfeiture from the deposits attested to the minority side (no reward for the majority side in the meantime) Hopefully this will make it easier for the majority side to get ≥ 23 of the deposits If you propose more than one page in the same slot, attempt to alter the history, or double-vote, you will be banned after forfeiting your deposit (after 36 days) If there are multiple validators who misbehaved at the same time, we will consider possibility of a conspiracy and confiscate them so badly Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 46/72
  47. Beaker/Newspaper/Machine Model (7/7) Rewards Reward for working diligently as a

    validator is proportional to the amount of your deposit and inversely proportional to the square root of everyone’s total deposit Delay in testifying will reduce the amount of your reward Rewards are given per epoch Way of drawing lots or electing validators to committees (existing metaphor) Uses a conceptual DAO (RANDAO) to generate random numbers This is a deck of playing cards placed in the memory of the calculator Validator proposing a page shuffles the deck once during the proposal Takes XOR of the digest of the signature on the data based on the epoch number and the existing RANDAO Each time a page is generated, the deck is shuffled one after the other, so that it accumulates enough randomness It is random yet deterministic since everyone is looking at the same deck The deck at the end of each epoch is used to determine the proposers and committee members after 2 epochs Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 47/72
  48. Smart Contract Programming Programming language Characteristics and challenges Lecture 9-10

    : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 48/72
  49. Programming Language EVM interprets bytecode (instruction set for virtual machines

    or interpreters) EVM is a stack machine (stack calculator) (see Lecture 5-6) Programmers don’t usually program in bytecode or machine languages Requires compilers for other, high-level languages High-level language : human-readable/writable language On the other hand, languages close to machines are called low-level languages . . . We may be scolded by artificial intelligence in the near future ;) Examples : Solidity — JavaScript-like language Current primary language Vyper — Python-like language LLL — Lisp-like language Fe — Rust-like features with reference to Vyper? ← NEW! Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 49/72
  50. Solidity Sample Code (this is a high-level language!) pragma solidity

    >=0.4.18 <0.6.0; contract IndivisibleAsset { /* transfer ownership of non-divisible assets */ string public _name; string public _symbol; uint256 public _quantity; address public _owner; constructor(string name, string symbol, uint256 quantity) public { _name = name; _symbol = symbol; _quantity = quantity; _owner = msg.sender; } function transfer(address to) public returns (bool) { require (_owner == msg.sender); _owner = to; return true; } } Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 50/72
  51. Another Solidity Sample Code (snippet) . .. function transfer(address to,

    uint256 value) public returns (bool) { balances[msg.sender] = balances[msg.sender] - value; balances[to] = balances[to] + value; return true; } . . . This can be the core of a (not-so-secure) token contract Without considering overflow/underflow A token contract typically manages the balances of all users Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 51/72
  52. Features of Programming Language Solidity JavaScript-like Object-oriented Describe a contract

    as a template (type or class) Constructor is called during deployment Deploy here means to deploy the contract to the blockchain Decides what parameters to pass to the constructor upon deployment Conforms to Ethereum programming model Deployed contract is a specific entity (instance) Has an account (identified by the address, just like a human user) Has storage and ETH balance Can send messages to other contracts Model where deployed contracts are manipulated by sending messages On the assumption that the authenticity of the code that responds to the message is guaranteed Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 52/72
  53. Characteristics and Challenges Characteristics Execute the program during the block

    validation process, and reflect the results in the “world state” Redundant verifiers Closed within the state of blockchain (maintained by the verifiers) This design is consistent in the Ethereum system Challenges I/O commands cannot be issued from within the program Not affected by the outside world other than external actors who send signed messages ⇒ ex. Data from sensors cannot be read directly (problem of an oracle) Not able to directly affect the outside world ⇒ ex. Cannot send commands to the motor to turn it on/off Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 53/72
  54. ERC-20 and Other Standards Lecture 9-10 : Smart Contracts and

    Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 54/72
  55. ERC-20 Token Proposal number 20 classified under ERC (Ethereum Request

    for Comments) https://github.com/ethereum/ercs/blob/master/ERCS/erc-20.md (EIP: Ethereum Improvement Proposal) ← EIPs are assigned serial numbers (proposal numbers) contract ERC20 { function totalSupply() constant returns (uint totalSupply); function balanceOf(address _owner) constant returns (uint balance); function transfer(address _to, uint _value) returns (bool success); function transferFrom(address _from, address _to, uint _value) returns (bool success); function approve(address _spender, uint _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint remaining); event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } Other options include name, symbol, and decimals (how many digits follow the decimal point) approve allows withdrawals by other users, and allowance returns that limit It has been updated to ERC-777 (including prevention of mis-sent transactions), but proper implementation is difficult and not recommended Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 55/72
  56. The Impact Brought by ERC-20 ERC-20 is, so to speak,

    an “abstract class” It defines the possible “operations (interfaces)” for token-type objects ⇒ Software designed with ERC-20 objects in mind (written assuming the target of operations is an ERC-20 object) works for all tokens that comply with ERC-20 This reflects the effect of abstract data types and class inheritance in object-oriented programming ⇒ Development efficiency and applicability are greatly improved Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 56/72
  57. Token Types Fungible ERC-20 → ERC-223 (draft) or ERC-777 (standard

    token) (not recommended after all) Non-Fungible ERC-721 Can represent physical assets, virtual assets, liabilities (assets with negative value), etc. Multi-Token Standard ERC-1155 (allows handling multiple types of tokens in a single contract) ERC-3525 (defines SLOTs, enabling splitting and merging within the same slot) Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 57/72
  58. Demonstration Automated Escrow An attempt to automate real-estate brokerage, banking,

    and Legal Affairs Bureau (or judicial scrivener) Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 58/72
  59. ex. Automated Escrow to Purchase Land (automation of centers) Defined

    ʻAirʼ 1 either can do this create and fix in the air create and fix in the air Buyer Seller 3 return land return money internal state 2 settle land deposit Land Asset transfer land rights to buyer 2 Digital Token transfer internal state internal state transfer payment deposit can freely join and leave can freely join and leave Purchase Contract transfer payment to seller 1. Purchase contract is fixed in the air to prevent taking away of land or money (both parties can verify the contract) 2. Deposit land rights and purchase money in the contract (if they change their minds, they can take them back) 3. When settled (anyone can do it if both right and money are deposited), the rights and money for the property are transferred simultaneously Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 59/72
  60. For Demonstrations, We Use Brownie, a Python-based development and testing

    framework for smart contracts on EVM https://eth-brownie.readthedocs.io/en/stable/ Today, we will use the Python interpreter environment it provides And infura.io that provides accesses to Ethereum (main and test) networks https://infura.io Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 60/72
  61. A Little Preparation If you have problems with newer versions

    of Python 3, try Python 3.9 (3.9.18) Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 61/72
  62. Sample Code and Demo git clone from GitHub $ git

    clone https://github.com/ks91/sample-smart-contracts.git Follow README 1. Setup a sample token project with brownie Brownie is a Python-based Ethereum programming and test environment Javascript-based one is called Truffle, and an Ethereum remote procedure call client is called Ganache See? Engineers are fun people to work with! 2. Copy the content of contracts, scripts and tests directories of this sample project into the corresponding directories of the token project 3. Compile 4. Test Today, I will demonstrate manually the test for automated escrow Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 62/72
  63. settle() from OneTimeEscrow function settle() public returns (bool) { require(_token_.balanceOf(address(this))

    >= _price_); /* ’this’ means this contract */ require(_asset_.getOwner() == address(this)); _token_.transfer(_seller_ , _price_); _asset_.transfer(_buyer_); emit Settled(); /* event log */ return true; } Just to introduce the settle() part from the sample code Only if both the price and the asset are deposited with the contract, It transfers money to the seller and asset to the buyer Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 63/72
  64. Open console and connect to Sepolia testnet Use brownie console

    >>> network.disconnect() # disconnect from the default, simulated environment of Ethereum >>> network.connect(’sepolia’) >>> len(accounts) 0 >>> accounts.add(paste the hexadecimal string of the private key here) <LocalAccount object ’hexadecimal string of the account’> >>> accounts[0].balace() Here is the ETH balance of the account We set up two accounts Once you have created multiple accounts, you can try to transfer ETH, for example as follows >>> accounts[0].transfer(accounts[1], "1 ether") But before that, you may want to feed the accounts with Sepolia ETH from some public faucet Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 64/72
  65. Test Code (1) from brownie import * import pytest def

    test_deploy_and_settle(Token, IndivisibleAsset, OneTimeEscrow): asset = accounts[0].deploy(IndivisibleAsset, "5322 Endo", "mˆ2", 300) token = accounts[0].deploy(Token, "Test Token", "TEST", 18, "1000 ether") Deploying token and asset contracts The above is just the test code as it is, so in the console we will just type the inside of the function First, let’s do seller = accounts[0] and buyer = accounts[1] for readability Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 65/72
  66. Test Code (2) token.transfer(accounts[1], 300, {’from’: accounts[0]}) escrow = accounts[0].deploy(OneTimeEscrow,

    token, accounts[1], asset, accounts[0], 300) Sending 300 coins from seller (accounts[0]) to buyer (accounts[1]) to prepare Because the buyer has to cast a transaction that pays 300 coins Deploying Escrow Contracts Buyer is accounts[1], seller is accounts[0], and the price is 300 coins Since we are using the sample arguments of the baked Token as they are, 300 coins is actually a very small unit, like wei in ETH Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 66/72
  67. Test Code (3) token.transfer(escrow, 300, {’from’: accounts[1]}) asset.transfer(escrow, {’from’: accounts[0]})

    assert token.balanceOf(accounts[0]) == 999999999999999999700 assert token.balanceOf(accounts[1]) == 0 assert token.balanceOf(escrow) == 300 assert asset.getOwner() == escrow Buyer (accounts[1]) deposits 300 coins in escrow, and Seller (accounts[0]) deposits the asset in escrow assert tests a statement, and fails the test if it turns out to be false But we are in console (not doing an automated test), so we just see the values Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 67/72
  68. Test Code (4) escrow.settle({’from’: accounts[0]}) assert token.balanceOf(accounts[0]) == 1000000000000000000000 assert

    token.balanceOf(accounts[1]) == 0 assert token.balanceOf(escrow) == 0 assert asset.getOwner() == accounts[1] Calling settle() and closing the transaction In this code, it is called by seller (accounts[0]), but it is OK to call from either side Let’s see some transactions on an Ethereum Sepolia testnet explorer Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 68/72
  69. Authenticity of Contracts Anyone can participate in block validation and

    contract execution as a verifier ⇒ Everyone has access to the contract code It is in principle verifiable that the correct contract is being executed I/O is outside blockchain → this is possible without revealing the entirety of the agreement True worth of smart contract is that everyone can confirm that “the correct contract was executed”? Program code and its execution results as “record whose contents and existence cannot be denied by anyone” But Ethereum’s method should not be the only one There are many issues including how to manage the contracts’ life cycles We have already talked about The DAO Incident Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 69/72
  70. Assignment Lecture 9-10 : Smart Contracts and Decentralized Finance —

    FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 70/72
  71. Assignment 5. “Artificial General Intelligence” AGI (Artificial General Intelligence) is

    capable of performing all the intellectual activities possible for humans at a level equal to or better than that of humans This will mean the replacement of intellectual labor, and will also accelerate the replacement of physical labor because of the precise control of robots, as well as any other major changes in society Suppose that AGI will appear by 2027 (cf. Anthropic’s CEO’s blog) Please briefly describe the changes that could occur in the area of finance by 2030 (You may add your comments or questions about the class, if any) Deadline and how to submit November 10, 2026 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 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 71/72
  72. Have a Nice Weekend or two, and See You Next

    Time Online! Lecture 9-10 : Smart Contracts and Decentralized Finance — FinTech — Financial Innovation and the Internet 2026 Fall — 2026-10-30 – p. 72/72