Contracts FinTech — Financial Innovation and the Internet 2019 Fall Kenji Saito Professor, Graduate School of Business and Finance, Waseda University [email protected] Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.1/40
uniqueness) Possibilities, Impossibilities and True Worth Applications people talk about, and thoese workable in reality Problems of blockchain Science Fiction Prototyping and Assignment Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.4/40
of blockchain Blockchain’s true worth and the “last will test” Assignment Review Smart Contracts and Ethereum Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.5/40
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 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.6/40
participants gain half of the hash rate, blockchain cannot be guaranteed to work correctly Risky in principle if the hashrate is doubled quickly → And it is happening 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 Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.7/40
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 Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.8/40
decentralized investment fund built on Ethereum Split (of fund) was recursively called, and 360k ETH (5∼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 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.9/40
the cost of maintaining data structures rises linearly as transactions increase It does not scale out Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.10/40
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 structure Conversely, there are great expectations and potential for truly decentralized “record fixation device in the air” Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.11/40
ETH as a currency crashes and declines Supported by miners’ motivation to get ETH When the value of ETH drops, miners 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 Everledger and Factom advance, similar problems arise Either way, the future of the system depends on the interests of the miners ⇒ 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 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.12/40
1. Guarantee of Validity (For Bitcoin : UTXO data structure + digital signature) Self-contained and verifiable by everyone ⇒ Beneficial (yet confidentiality is a problem) 2. Proof of Existence (For Bitcoin : Hash-chain w/ proof of work) Evidence base for nonrepudiation of existence ⇒ Not as strong as expected 3. Consent of Uniqueness (For Bitcoin : Nakamoto consensus) Trial to finalize transactions ⇒ Problem in synchronizing with reality In addition, the non-decentralized structure and incentive mismatch by 2 and 3 Necessary to simultaneously solve the problems and explore applications on the assumption that the problems will be solved Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.13/40
digital signature Proof of Existence e.g. hash-chain with proof of work Consent of Uniqueness e.g. Nakamoto consensus Description of Rules e.g. transfer of bitcoins - The content of a transaction cannot be altered, - not contrary to past history of transactions regarding the asset, - and the transaction is cast by a legitimate user - Cannot delete the evidence of an existing transaction in the past, - and cannot fabricate an evidence of a transaction that did not exist - When two mutually contradicting transactions are cast, (eventually) everyone chooses the same one to place in the history - Application logic to decide what valid transactions are Blockchain ≪or alike≫ (tries to) bring the End-to-End philosophy of the Internet into reality in the control of assets, thereby making a Record Fixation Device in the Air The center is automated Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.14/40
digital signature Proof of Existence e.g. hash-chain with proof of work Consent of Uniqueness e.g. Nakamoto consensus Description of Rules e.g. transfer of bitcoins - The content of a transaction cannot be altered, - not contrary to past history of transactions regarding the asset, - and the transaction is cast by a legitimate user - Cannot delete the evidence of an existing transaction in the past, - and cannot fabricate an evidence of a transaction that did not exist - When two mutually contradicting transactions are cast, (eventually) everyone chooses the same one to place in the history - Application logic to decide what valid transactions are Digital signatures suffice! Needed to rely on trust! Design-dependent feature! Application layer! Blockchain ≪or alike≫ (tries to) bring the End-to-End philosophy of the Internet into reality in the control of assets, thereby making a Record Fixation Device in the Air The center is automated Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.14/40
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 that “data digitally signed at a cetain past point of time has not been tampered with since then” (instead of believing those who insist on their statement) “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 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.15/40
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) There is an inherent challenge of linkage between records and entities though Includes areas that cannot be solved by technology alone (does the public key really belong to the person?) Including the openness of the source code, all is roughly the problem of . . . “How can we trust automated mechanisms?” Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.16/40
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 Deadline and how to submit November 27, 2019 at 17:59 JST From Course N@vi Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.18/40
Countermeasures . . . how to improve the class 15 out of 16 students submitted (as of this morning) (better later than never) Sci-Fi themes : home renting * P2P car rental * mind-scanner/mind-reader * Todai-Keio surrender contract * tokens backed by proven reserve in the asteroid * employment contract * smart marriage contract * purchasing * booking a band * single account on a cloud * cuisine FAX * every human behavior? * translation of contracts into a simple language You are so talented! I enjoyed reading your work very much One thing about “private key” It is secretly held by a person or an entity to perform digital signatures, and the signed data can be verified with the corresponding public key which can be made public Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.19/40
world for several months, she feels it is such waste that leaving her car in home without using it, so she decides to lend her car out so that she could gain some advantages on this Joanna finds Jamie through a P2P car rental platform, after some conversation, Joanna thinks Jamie is a reliable person to lend her car Joanna’s car is quite advanced, it equipped with an electronic lock that could only be unlocked by a specific secret key Joanna and Jamie then sign a smart contract to specify that Jamie should return the car by the last day of this month, and if Jamie wants to continue using the car, he needs to pay rent for another month before the last day of this month, otherwise, the key will expire However, on the first day of the second month, Jamie doesn’t pay the rent for next month When he tries to start the car, the smart contract detects that Joanna’s bank account has not received Jamie’s rent, Then the contract executes, the secret key of Joanna’s car expired immediately, and Jamie cannot start the car anymore All these processes are done automatically, Joanna doesn’t need to do anything, and all she gets is a notification on her phone that Jamie didn’t pay the rent and the car is now locked ⇒ What happens then? This application is often talked about, but what if Jamie wants to start the car in an emergency? Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.20/40
point between Earth and the Moon) was a blockchain backed by the resources of the asteroid Each token corresponded to a portion of a proven reserve in the asteroid Bidders would lease resources Sure, if the owners had firms, they would all have some good use for their own share of resources They could produce, sell, and compete Now, whoever had the best use for a share of resources, would have the best bid for temporary control of it The owner would share in whatever gains resulted ⇒ Very interesting! (especially the part that tells that firms have disappeared) This reminds me of the ongoing joint research on the currency for active debris removal But probably the system of economy will have changed before this is actualized Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.21/40
news that Charles, her husband of 30 years, was in the hospital undergoing emergency surgery for a stroke, she didn’t realize it was only the beginning of a very bad day She arrived at the viewing gallery and watched as the robo-surgeons methodically and precisely removed the clots from her beloved husband’s arteries It was a standard procedure, expected to be over in less than 10 minutes A sudden power blip made Charles’ heart monitor flatline for a split second, which irreversibly triggered the “termination by death” clause in the Woods’ smart marriage contract Two things happened simultaneously: half of the Woods’ marital assets were transferred via bitcoin to Vivienne’s personal bank account; and red lights in the viewing gallery directed towards her flashed “UNAUTHORIZED PERSONNEL VACATE PREMISES IMMEDIATELY” While the rest of the surgery went off without a hitch, Vivienne was no longer there to witness it: as an unrelated stranger, she had been escorted out of the hospital by armed robo-guards Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.22/40
marriage meant the surgical procedure would no longer be covered under their joint insurance policy, and Charles would need to pay for it in full However, Vivienne had other, more pressing concerns Having arrived in front of their shared flat of 30 years, she was unable to get past the biometric security sensor “UNAUTHORIZED PERSONNEL VACATE PREMISES IMMEDIATELY” “Well, that’s just my luck,” Vivienne mumbled ⇒ Too bad! ;) I have always thougth it is not a good idea to detect a person’s death only with sensors Death is a social event, and I believe it would be better if it involves a digital signature by the doctor Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.23/40
Blockchains change the world” (2016) “Oh, Great Decentralization: 5 Perspectives of Near Blockchain Future” Organized by editors based on my interview The story of “Family” from it You want to get married. You realized this feeling, so you and your partner records the words of your oath (contract) in the air “If you don’t want to be with me, you can break this contract. With the key that only you can use” OK, what if she loses the key? Till death do them part ;) Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.24/40
in a broad sense Smart contracts and vending machines What is a contract? Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.26/40
system for automatically transferring and transitioning digitally represented assets according to predetermined rules Or more mechanically, To write program code and data to a blockchain, And run the program blockchain-wise to update data Run when miners verify transactions They do not agree with the feeling of the word But there is a meaning to this narrow sense Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.27/40
for implementing contracts mechanically Or, contracts implemented as such ↑ Definition in future dictionaries A vending machine is a primitive form of smart contracts Vending machine . . . do you remember “Reality vs. Blockchain”? Reality that goes in real-time and blockchain’s behavior are very different Suggesting that smart contracts in a broad sense cannot be implemented by blockchain today Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.28/40
written or spoken agreement, especially one concerning employment, sales, or tenancy, that is intended to be enforceable by law Essential requirement for its establishment Coherence of manifestation of intention between the parties And the medium for that, Oral, handshake, carving/baking on clay tablets and breaking them, paper (handwriting), paper (print) What can a machine do? cf. “The medium is the message.” by McLuhan cf. “Gutenberg Galaxy” by McLuhan Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.29/40
“movies” Clear distinction between finished and unfinished “products” Individualism Unification of popular culture . . . ⇒ Prepared the industrial society Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.30/40
methodology Global perspective Everyone becomes a filmmaker Obscured finished and unfinished products ⇒ open design Promotion of collaboration Diversification of cultural events . . . ⇒ Preparing for the next society Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.31/40
GENERATION SMART CONTRACT & DECENTRALIZED APPLICATION PLATFORM” Applying blockchain technology Targeted average block interval : 15 seconds 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 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.33/40
DPOUSBDUDPEF NFTTBHFPSBOFXBVUPOPNPVTPCKFDU EBUBFYDIBOHFEBNPOHBDDPVOUTPS&UIFS TUPSBHF TUBUF` TFUPG USBOTBDUJPOT EJHJUBMTJHOBUVSF &7. IVNBO GPSFYBNQMF Blockchain = Run of a state machine (state transition system) = Operation of a computer Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.34/40
External Actor A real person/entity who can digitally sign, having an account EOA : Externally-Owned Account Autonomous Object (internal actor) Operates autonomously within the system, and has an account That said, if you don’t send a message, it won’t work (and miners 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 ̸ = intelligent contract Authenticity is ensured by being written in blockchain Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.35/40
JOWPLF DPOUSBDUDPEF NFTTBHFPSBOFXBVUPOPNPVTPCKFDU EBUBFYDIBOHFEBNPOHBDDPVOUTPS&UIFS TUPSBHF TUBUF` TFUPG USBOTBDUJPOT EJHJUBMTJHOBUVSF &7. IVNBO GPSFYBNQMF BVUPOPNPVT PCKFDU Triggered when an autonomous object receives a message, performs a contract, and changes state Gas must be supplied for each execution step (to avoid an infinite loop and to compensate EVM executor = miner) Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.36/40
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 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.37/40
transaction finalization mechanism (Casper) 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, Plasma (multi-layered) 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 Ether and support? Lecture 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.38/40
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 9 : Blockchain (3) and Smart Contracts — FinTech — Financial Innovation and the Internet 2019 Fall — 2019-11-29 – p.39/40