Smart Contracts Ethereum Smart contracts Szabo 1997 http
Smart Contracts & Ethereum
Smart contracts: Szabo (1997) http: //ojphi. org/ojs/index. php/fm/article/view/548/469 • “The basic idea behind smart contracts is that many kinds of contractual clauses (such as collateral, bonding, delineation of property rights, etc. ) can be embedded in the hardware and software we deal with, in Nick Szabo such a way as to make breach of contract expensive. . . ”
Some Familiar Smart Contracts: © Fidelity Investments
Smart Contracts, Defined. • Multiple Definitions: • A set of coded computer functions. • May incorporate the elements of a binding contract (e. g. , offer, acceptance, and consideration), or may simply execute code. • Whether the code incorporates contract terms occurs on a “higher level” than the execution of the code itself • Allows code to take actions at specified times and/or based on reference to the occurrence or non-occurrence of an event • Example events: score of a sporting event, amount of precipitation, height of a wave, result of a vote • Events are reported to the smart contract by an “oracle” • When associated with a blockchain, the smart contract “code” is held by a wallet that controls assets at issue (i. e. the res of the contract)
Smart Contracts, Defined. • Defining a Smart Contract • Smart contracts on blockchains couple logic-based execution with the ability to automatically transmit value on the same platform. • Value must be natively digital – crypto assets, storage, cpu cycles, etc. • Users of Blockchain enabled smart contracts sign transactions using their private keys • Causes assets to be transferred to the smart contract. • Binds participants to the agreed smart contract code terms. • When data from an oracle is received, the smart contract will act without further need for input or signatures from the parties to the smart contract and effectuate the directions found in the smart contract code. • Except if/when something breaks • Used frequently for ICOs • Buyer sends one asset to a wallet address that triggers a programmatic response which causes another asset to be sent automatically to an address provided by the buyer.
Smart Contracts, Defined. • Defining a Smart Contract • “Programmable money” • Agreement written in (& Limited by) computer code, limited by computer code • Part of our cultural heritage: from Hero of Alexandria to Auto Starter Interrupters • Oracles, dispute resolution, and other systemic problems • Is Code law?
Smart Contracts are mislabeled. • The contact is not smart. It’s only as useful as…. • The coding behind it • The code may not do what the parties intended • • If it doesn’t execute, assets may be immobilized If it executed incorrectly, it may pay the wrong party If the code is shoddy, it may be vulnerable to a hacker who may misdirect or take the res If the code relies on other code, it may be vulnerable to other hackers • It may not be legally enforceable • It may only automate the execution portion of a contract • It may not be a contract at all- used by one party. • Code is code, not law.
8 Oracles • Data feed that provides external data to smart contract code to enable it to execute • Selected by parties in formation of contract • “Trusted third party” • What is the nature of the relationship between the Oracle and the parties to the contract?
Oracles are a vulnerability • Oracles can be the boon or the bane of a smart contract • If the code doesn’t do what the parties intended, it may break • • If it doesn’t execute, assets may be immobilized If it executed incorrectly, it may pay the wrong party If the code is shoddy, it may be vulnerable to a hacker If the code relies on other code, it may be vulnerable to other hackers • It may be corrupt or corrupted • How can parties prevent extrinsic tampering with the code? • Hiring hackers • Paying off/threatening oracles • “innocent” mistake
1 0 Are Smart Contracts Actually “Contracts”? • Does my smart contract create a legally enforceable agreement? • How can parties to a smart contract avoid unintended consequences? • When should you use these?
1 1 Are Smart Contracts Actually “Contracts”? • Does my smart contract create a legally enforceable agreement? • Maybe: • Are all elements of formation present? • Florida law: offer, acceptance, consideration, sufficient specificity of essential terms • Are all elements that make a contract enforceable present? • Do the contracting parties have capacity? • Is the subject of the contract legally appropriate? • Is the “entire” agreement in the code? • • How can a party identify the “entire” agreement? How does this compare to a standard written contract? What code needs to be reviewed? Who is qualified to review these?
1 2 Are Smart Contracts Actually “Contracts”? • How can parties to a smart contract avoid unintended consequences? • Traversing the Lawyer/Coder delta: • Lawyer must explain the transaction to the coder • Lawyer must understand how the code is intended to operate • Ask about contingencies- “What if this doesn’t work” • Document the agreement • Memorandum of Intent ? • Parallel written contract ? • What do we gain here?
1 3 Are Smart Contracts Actually “Contracts”? • May be preferable to written contract these under the following circumstances: • • Agreement is unlikely to be breached Speed of performance is critical Contracting parties know eachother well… or not at all Illegal/regulated subject matter The “international donut hole” Formal dispute resolution is expensive or unavailable Verifiable public data triggers execution of the contract • Use these when the following attributes are desired: • Public disclosure of the agreement • Enhanced auditability • Automated execution • Or use it as the performance aspect of a contract
1 4 Potential benefits • Standardizing formation, execution, settlement may reduce costs of negotiations & drafting agreements. • Security: Transactions are encrypted and stored on a distributed ledger intended to be immutable. • Speed: Automation reduces transaction times and unnecessary manual processes. • Business innovation: Automating flow of digital assets and payments may foster new products and business models.
1 5 Potential benefits • Regtech: • Built-in regulatory compliance (e. g. , cannot sell to a non-Eligible Contract Participant (ECP); cannot sell until mandated period has passed; or must report certain data). • Automate regulatory reporting- smart contracts automatically report data at pre-determined intervals). • Stress testing built into smart contracts and regulatory nodes (e. g. , execute scenarios on smart contracts to determine payouts across the network). • • Self execution of contract terms Auditability of performance Potentially lower operating costs Publicaly disclosed terms
Blockchain Smart Contracts • Ethereum: “Worldwide computer” • Token of value also used to obtain computing services from decentralized network of nodes • First of several: Hyperledger, Neo, Ubiq, Omni, Counterparty, Rootstock • Choice of Platform: • • Governance Persistence Development team Cybersecurity Scalability Track record of dispute resolution Insurance?
What could possibly go wrong…? • Smart contracts are irrevocable* and are meant to be impossible to interrupt. • What if a smart contract is hacked and stops, or instead of stopping, continues to run on its own? • May operate in future states not anticipated by either party • Law may change during the pendency of a smart contract, making its execution illegal • Specific performance may cause irreparable economic damage • Smart contracts may take unforseen actions, such as transmission of customer data without consent • Smart contracts may be hacked and rewritten or drained of assets • Smart contracts may prevent courts from intervening in the interest of justice • Much of contract law deals with “unforseeable” circumstances that neither party would have envisioned * Except when there’s not…
Ethereum • Blockchain-based, designed by Vitalik Buterin • Intended to run apps across blockchain • “World Computer” to “Build Unstoppable Applications” • Natively operates smart contracts using language called Solidty • Initially based on POW consensus • Centrally planned evolution from POW to multistate distributed execution platform which requires a transition to POS • Distinguishable from Bitcoin • Encryption style • Native scripting - Blocksize/Blocktime - Development by Foundation
DAO’s, Examined • Decentralized/Distributed Autonomous Organizations • Smart Contracts + Blockchains + Tokens of Value + Humans • “Corporations Lite” • Replace human judgment with computer execution based upon disclosed rule based logic • Transparent + Predictable • Eliminates Ultra Vires activity • Opt In/Opt Out of Legal system • Does not require legal incorporation • May choose across a spectrum of human participation
The. Dao: Slock. it’s Science Project • Emulates a crowdfunding entity • Funding • 28 -day funding period (escalating cost of entry) • Aggregate investment ~$210 mm USD/13% of ETH market • Roles/Actors • • Curators Investors Contractors Creators • Governance • • Dao Tokens - locus of control/evidence of ownership Projects proposed, whitelisted by curators, voted on by Investors 20% quorum/ majority vote adoption of projects “Split” withdrawal project available to any investor
Game Theory/Incentive Structure - Predictable Investor Behaviors Lead to Devaluation of Dao Tokens and ETH holdings - Failing to reach voting quorum Failed split/attacks against splits Pitfalls of funding projects Disclosure of large project subject to vote - Lack of checks and balances against insider conspiracy - Depends on curator competency/ altruism. - Malicious project proposals /SIPA - Cartelism - Moral Hazards
Failed Proposal
The Dao’s Manifesto
The Dao’s Terms
The Dao’s Terms
The Dao Code
The Dao Code
For the want of a nail… • Attack on The. Dao • Split transaction exploits bad code • A recursive call error in the split transaction code permits withdrawal of more than the initial investment • Not technically a hack because no code changed • Akin to an SQL injection attack • Comes to the attention of the Ethereum Foundation (and not the Dao creators)
Buterin’s Reaction
Other Insiders’ Reactions
Exchange Operator Reaction
The Response • As you saw…. Panic! • Shut down trading • White Hat “counterattacks” • Valuation of ETH/DAO Tokens plummet • Complaints to the SEC • Should Ethereum “go fork itself”? • Hard Fork • Soft fork • Mt. Gox approach
Aftermath So, what actually happened? - Hard fork reversal - Arguments as to handling of extra. Balance - PR hit for Ethereum - ETH/ETC Split violates “conventional cryptoeconomics” - Post-failure litigation - SEC Attention
The. Dao, or why regular contracts still matter. • Kicking open Pandora’s box (i. e. unintended consequences) • • • Code quality is critical Document your agreement Include dispute resolution mechanisms What happens when “on chain” dispute resolution fails? Who decides how to resolve issues? Upon what critical resources does this agreement rely? • Should smart contracts be “immutable”?
Smart Contract Example: Real Estate • Add efficiency and reduce costs and errors for routine financial transactions: • Escrow • Automatic Recurring Payments • Investment models • Elimination of intermediaries that exist to provide trust: • Escrow agents, Land Title Recorders, Title agents, Notaries • Elimination of tort of specific performance • Potential absurd implications- auto ignition limiters • Better data security/privacy • Logical for state contingent industries- gambling, insurance
Existing Challenges to Widespread Smart Contract Use • Flawed code • Lawyer/coder communication • Maturity of oracle technology • Bad law • Resistance by entrenched market actors • Resistance by legislators • Adaptation by existing gatekeepers • Cybersecurity vulnerabilities • Switching costs
Barriers to Smart Contract adoption • PR • Learning Curve • User interfaces • Incumbents • “Garbage in, garbage out” • Consensus mechanisms/Scaling • Legal/social/behavioral/political barriers
General Risks created by Smart Contracts • Facilitates increased transactions in illegal subject matter • Integration into traditional financial system can create systemic risk • Fraud/manipulation • Incompatibility with conventional justice system
Operational risks • Lacking backup / failover mechanisms. • Oracle risks • Lacking customer protections. • Blockchain forks. • In case of an operational failure, recourse may be limited or nonexistent – complete loss of a virtual asset is possible. • Poor governance. Smart contracts may require attention, action, and possible revision subject to appropriate governance and liability mechanisms.
Technical risks • Coding errors: • Software vulnerabilities. • Hackers • Bad code • Infrastructure failures: • Internet outages • Server failures • Upgrades to underlying software • Underlying system issues: • Scaling or bandwidth issues. • Divergent/Forked Blockchains – such events can create multiple smart contracts where only one existed, or may disrupt the functioning of a smart contract. • Create legal disputes over ownership of assets • Future shocks unforeseen or unanticipated future events. • Cybersecurity risks
Fraud • Smart contracts can include nefarious code. • Smart contracts may be manipulated by insiders who may have “backdoors” or “kill switches” to the code or a deeper understanding of how the smart contract will react to particular events or inputs. • Entities may solicit or offer smart contracts that do not behave as advertised. • Oracles may accept or distribute unexpected information, resulting in outcomes that do not reflect the intent of one or more of the contracting parties when entering into the contract. • Oracles may manipulated or fraudulent
Governance considerations • Establishing governance standards may avert significant problems with smart contracts. • • assign responsibility for smart contract design and operation, establish mechanisms for dispute resolution. Incorporate terms & conditions for enforceability Establish by agreement when parties can seek external dispute resolutions • How should smart contracts interact with the conventional justice system?
Strengths • Self execution of contract terms • Auditability of performance • Potentially lower operating costs • Publicaly disclosed terms
Formation & enforcement difficulties • Meeting of the minds • Translating legal intent to code • Legally enforceable subject matter • Capacity to contract • Relies upon implicit assumption that contracting parties understand code & that code reflects their intent • How many consumers engaging in a financial transaction can read and audi code • How many can read English?
Weaknesses • Reliance on code, code writers • Delta between code- fluent and law- fluent • Inflexibility • Difficulty in representing equitable principles in code • Potential “immutability” may require resort to exotic inefficient strategies to reform smart contract • Uncertain enforceability
What if your client wants a smart contract? • Understand client business goals • Work with team member who understands code • Review code to confirm it reflects the intent of the parties • Adapt code to specific situation • Understand requirements/capabilities of platforms • Consider documenting intent in side letter or memorandum of understanding • Consider creating “what if” document to address failure, improper execution
Unresolved Legal issues • Subject Matter & Personal Jurisdiction over a smart contract • Parties, network, code writer? • Who is liable for a “broken” smart contract? • If the contract does not perform as expected, how can contract be enforced? • Self help • How do these work for non-digital assets? • “Abstraction layer” needs to connect digital assets to real life assets • May require legislation to connect titled property to digital assets • Raskin- strong & weak smart contract theories • Views smart contracts as a flavor of self help • Courts should only interfere when smart contract is unconscionable • Unlikely to be adopted
- Slides: 47