0% found this document useful (0 votes)
356 views33 pages

Ethereum Smart Contracts

The document discusses the concept of smart contracts, beginning with their origins in the early 1990s and proposals by Nick Szabo for using automated transactions to enforce contracts. It then outlines the development of cryptocurrencies like Bitcoin that enabled the creation of digital contracts through scripting capabilities. Finally, it covers how Ethereum has expanded on this by introducing a Turing-complete programming language for more complex smart contracts to be developed and run on its blockchain.

Uploaded by

pacdox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
356 views33 pages

Ethereum Smart Contracts

The document discusses the concept of smart contracts, beginning with their origins in the early 1990s and proposals by Nick Szabo for using automated transactions to enforce contracts. It then outlines the development of cryptocurrencies like Bitcoin that enabled the creation of digital contracts through scripting capabilities. Finally, it covers how Ethereum has expanded on this by introducing a Turing-complete programming language for more complex smart contracts to be developed and run on its blockchain.

Uploaded by

pacdox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

SMART CONTRACTS

Steve Omohundro, Ph.D.


Possibility Research

SteveOmohundro.com
PossibilityResearch.com
SelfAwareSystems.com
http://www.flickr.com/photos/klearchos/623501846/
http://www.amazon.com/Before-Dawn-Recovering-History-Ancestors/dp/014303832X/ref=sr_1_1

First Humans: 50,000 Years Ago


http://www1.umn.edu/ships/evolutionofmorality/text/23b.htm

Nomadic
Groups of 150
Few possessions
Exchange transactions

http://udtanzania2014.weebly.com/uploads/2/5/1/0/25106725/227878_orig.jpg

Roots Honey

http://ingervandyke.com/2012/10/africa-in-focus-day-15/
http://commons.wikimedia.org/wiki/File:San_tribesman.jpg
Hunter/Gatherer Prisoners Dilemma
http://commons.wikimedia.org/wiki/File:San_tribesman.jpg http://udtanzania2014.weebly.com/uploads/2/5/1/0/25106725/227878_orig.jpg

Win - Win Lose - Win

Win - Lose X Lose - Lose X


http://ingervandyke.com/2012/10/africa-in-focus-day-15/
Social and Moral Cooperation Mechanisms
Language
Gossip
Reputation
Moral Emotions
(Compassion, Gratitude, Awe,
Elevation, Anger, Contempt,
Disgust, Embarrassment, Shame,
Guilt)
Bare facial skin and
color vision
Altruistic Punishment
Banishment
http://faculty.virginia.edu/haidtlab/articles/alternate_versions/haidt.2003.the-moral-emotions.pub025-as-html.html
http://www.telegraph.co.uk/travel/destinations/middleeast/11105676/The-worlds-20-oldest-cities.html?frame=3043200

First Large Societies: 11,000 Years Ago

Money: 10,000 ya
Writing: 5,000 ya
Laws: 4,000 ya
200x Drop in Violence in 5000 Years

Pinker, Better Angels of our Nature


Contracts are Societys Programming Language
Network of agreements about:

Investment
Employment
Purchases
Supply
Real Estate
Construction
Law
Insurance
Marriage

http://mybillofrights.org/wp-content/uploads/2010/11/Borderless-
Heirloom-Poster.png
What is a contract?
A contract is an agreement
creating and defining obligations
between the parties. - Salmond
1. Offer: One party makes a
proposal
2. Acceptance: Another party
or parties accept it
3. Intention to be legally
bound: E.g. competent
4. Consideration: Win-Win
exchange of value

http://en.wikipedia.org/wiki/History_of_insurance
Economic Theory of Contract Law
Remedies for breach
e.g. Damages or performance
Create prosocial incentives
Economic efficiency
Pareto, Kaldor-Hicks
Incomplete contracts
Adverse Selection
e.g. Illness -> health insurance
Moral Hazard
e.g. Car insurance -> speeding

This is a very expensive mechanism!


Lawyers fees, judges costs, waiting time, uncertainty, etc.
Smart Contracts Nick Szabo 1993

http://firstmonday.org/ojs/index.php/fm/article/view/548/469

5 Contracting phases:
Search, Negotiation, Commitment, Performance, Adjudication
Simple Smart Contract: Vending Machine

Contract with bearer


Takes coins
Finite Automata
Dispenses change and product
Limited loss
Cost of breaking lockbox is
greater than gain

http://www.tvends.com/wp-content/uploads/2013/02/vending-9ef7622824ebebf95474a19d1aa4d98f.jpg
Automobile as Smart Property

http://firstmonday.org/ojs/index.php/fm/article/view/548/469

http://alliancemediaartshs.com/wp-content/uploads/2014/09/Repo-Man.png
Ripped Instruments
Al wants a cab ride
Willing to pay $100
Doesnt trust cabby Bob
Bob doesnt trust Al
He rips $100 bill in half
Gives half to Bob
Gives other half at destination
Loses incentive to cheat

http://firstmonday.org/ojs/index.php/fm/article/view/548/469

http://money.usnews.com/dbimages/master/14576/FE_DA_1130funds.ripped.jpg
2008: Bitcoin - Satoshi Nakamoto
Decentralized consensus
Blockchain ledger
prevents double spending
Bitcoin miners get paid for
adding blocks
Proof of work prevents
Sybil attacks
Current market cap: $5B

http://blog.newegg.com/blog/wp-content/uploads/bitcoin-logo-3d.jpg
Bitcoin Price History
https://blockchain.info/charts/market-
price?timespan=all&showDataPoints=false&daysAverageString=1&show_header=true&scale=0&address=
Bitcoin Mining Hardware

http://www.joeydevilla.com/wordpress/wp- http://www.kotaku.com.au/2013/11/bitcoin-mining-is-getting-out-of-control/
content/uploads/2013/04/bitcoin-fpga-mining-rig.jpg-.jpg
513 Altcoins on coinmarketcap.com

Bitcoin: $4.7B The rest: $500M


http://coinmarketcap.com/ http://blogs-images.forbes.com/matthickey/files/2014/04/dogecoin_logo_large_verge_medium_landscape.png
Satoshi on Bitcoin Scripting 2010
The design supports a tremendous variety of
possible transaction types that I designed years
ago. Escrow transactions, bonded contracts,
third party arbitration, multi-party signature,
etc. If Bitcoin catches on in a big way, these are
things we'll want to explore in the future, but
they all had to be designed at the beginning to
make sure they would be possible later.

https://bitcointalk.org/index.php?topic=195.msg1611#msg1611
Bitcoin Script
List of instructions with transactions that
limits access to bitcoins
Locking script and Unlocking script
Forth-like, stack-based, no loops
80 opcodes: 8 for constants, 7 flow control, 19
stack operations, 1 string, 2 bitwise compare,
20 arithmetic, 10 crypto
P2SH Pay-to-script-hash allows transactions
to be signed with a script (2012)
https://en.bitcoin.it/wiki/Script
http://chimera.labs.oreilly.com/books/1234000001802/ch05.html#_script_construction_lock_unlock
MultiSig
m-of-n address associated with n private keys,
sending bitcoins requires at least m sigs
2-of-2: address to keep keys on 2 machines
2-of-3: thief needs 2, and can lose 1
2-of-3: buyer, seller, and escrow agent
2 factor authentication
Use two different wallet services
Use two different software implementations
Service provider holds a key and is cosigner
Example Smart Contracts in Bitcoin
Assurance Contracts: Like Kickstarter, only
transfer payments if goal is reached
Returnable Deposit: Demonstrate
commitment by tying up funds
Escrow and dispute mediation: Lock up coins
so needs third party to spend
Multi-party decentralized lotteries

https://en.bitcoin.it/wiki/Contracts
2013: Ethereum Vitalik Buterin
Blockchain with a built-in
programming language
Consensus-based globally
executed virtual machine
Contracts in Turing complete
programming language EVM
Execution and storage use
gas
$18.4M Ether Sale 7/2014

http://digiato.com/wp-content/uploads/2014/06/Vitalik-Buterin.jpg
EVM: Ethereum Virtual Machine
Accounts have key, code and storage
Send each other messages
Externally Owned Accounts EOA
Contracts receive messages -> run code
Stack-based language: 56 opcodes, arithmetic,
Boolean, control flow, crypto
New: loops, gas, create, suicide

https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
Interacting Ethereum Contracts

https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
Higher Level Ethereum Languages
LLL: Low Level Lisp-like contract language
Serpent: Python-like contract language
Mutan: C-like contract language
Solidity: JavaScript/C++-like contract language
object oriented, static typing

https://github.com/ethereum/cpp-ethereum/wiki/LLL
https://github.com/ethereum/wiki/wiki/Serpent
https://github.com/obscuren/mutan
https://github.com/ethereum/cpp-ethereum/wiki/Solidity,-Docs-and-ABI
EtherScripter

http://etherscripter.com/what_is_ethereum.html
Smart Contract Applications
Voting systems
Domain registries
Financial exchanges
Derivatives
Savings accounts
Prediction markets
Crowdfunding platforms
Intellectual property
Other Cryptocurrencies
Smart Property http://www.ricardoaraujo.net/img/graph.png
Internet of Things
Gartner: By 2020:
From 2.5 billion ->
30 billion devices
Economic value add:
$1.9 Trillion
Need:
Internet of Money
Cryptocurrencies and
Smart Contracts!

http://www.gartner.com/newsroom/id/2621015

http://www.datanami.com/2013/10/09/gartner_internet_of_things_plus_big_data_transforming_the_world/
Obfuscated Contracts Buterin 2014
Indistinguishability Obfuscation
Amit Sahai 2013
Obscure programs or circuits so
keys remain hidden
Contracts can have private keys to
external bank or other
cryptocoins
But how to agree on obfuscated
contracts?

http://bitcoinmagazine.com/10055/cryptographic-code-obfuscation-decentralized-autonomous-organizations-huge-leap-forward/

http://www.cs.ucla.edu/news/news-archive/2013/professor-amit-sahai-has-record-success-at-crypto-2013
Decentralized Autonomous Organizations (DAO)
Eris: Ethereum DAO platform inspired by
Stack Exchange

Bylaws on the Blockchain


Decentralized Forums
Decentralized Crowdfunding
Decentralized Voting
Decentralized Reputation
(Citizenship, Development, Moderation)
Standardized Contract Factories

http://hplusmagazine.com/2014/06/17/eris-the-dawn-of-distributed-
autonomous-organizations-and-the-future-of-governance/
https://eris.projectdouglas.org/
http://fc01.deviantart.net/fs70/i/2010/073/8/a/godess_eris_statue_by_chaos_dark_lord.jpg
Self-Bootstrapping DAOs Adam Levine

Propose a project
Kickstarter-like funding
Issue shares
Stake-based voting
Vote on contractors
Vote as developed
Distribute profits

https://bitsharestalk.org/index.php?topic=1854.0 http://www.cerebralmastication.com/wp-content/uploads/2010/06/boot.jpg
Externalities and DAS
(Decentralized Autonomous Societies)
Adam Smiths Invisible Hand
Inefficiency from Externalities
Negative: Pollution, Climate change, Arms
races, Noise, Fraud, Scams, Antibiotics,
Overfishing, Overlogging, Speeding, DUI,
Status competition
Positive: Vaccination, Bees, Education,
Network effects
Internalize: Regulation,Taxes, Fines
Coase Theorem (1960)
Information and Transaction Costs

http://www.daviddfriedman.com/Academic/Coase_World.html http://www.quotecounterquote.com/2010_04_01_archive.html
Smart Contracts and AI
AIs enable smart contract:
Perception
Action
Dispute resolution
Design
Constraints

Smart contracts constrain


Robots and AIs:
AI legal framework
Self-enforcing structures http://www.trbimg.com/img-50fe0287/turbine/ct-biz-0122-baxter1.jpg-20130121/600

You might also like