1. When machines take decisions on their own:
Introduction to
Smart Contracts
philippe.camacho@dreamlab.net
Dreamlab
28 of August 2015
Bern, Switzerland
2. 2
“As another example, consider a hypothetical
digital security system for automobiles. The smart
contract design strategy suggests that we
successively refine security protocols to more fully
embed in a property the contractual terms which
deal with it. These protocols would give control of
the cryptographic keys for operating the
property to the person who rightfully owns that
property, based on the terms of the contract. In
the most straightforward implementation, the car
can be rendered inoperable unless the proper
challenge-response protocol is completed with
its rightful owner, preventing theft.”
Nick Szabo
3. 3
A smart contract is a program which execution is autonomous and
totally transparent.
In particular this execution cannot be reverted and its trace is public
and immutable.
A smart contract can send, receive and store money. It can also
interact with other smart contracts or any computational systems
connected to the internet.
6. 6
Agenda
• Bitcoin
• Change of paradigm
• Bitcoin is more than money
• Smart contracts
• Examples
• Ethereum
Objective:
understading the
principles behind this
technology
Objective:
Have a feeling of the
impact and challenges
related to this
technology
15. 15
¿But who did invent Bitcoin?
No one knows...
Anyways trust should
not depend on this.
http://www.newsweek.com/2014/03/14/face-behind-bitcoin-247957.html
20. 20
Audit
Not only the banking industry is
going to be impacted by Bitcoin,
but also the audit industry
21. 21
Solution #2
Origin Destination Amount
Homer Lisa 1 BTC
Homer Bart 2 BTC
Lisa Bart 1 BTC
… … …
The Bitcoin network
checks that an
account has enough
funds before
accepting a
transaction.
22. 22
Every transaction needs to be public.
Nobody will want to use such a system that
reveals all this information!
26. 26
Bitcoin y Anonymity
• Bitcoin is not totally
anonymous by default
• Some attempts to improve anonymity
zerocash-project.orgBlockchain.info
Dilemma: privacy
v/s crime
27. 27
Every account is public so I can spend
money from any of them
(I can spend other people’s
bitcoins).
30. 32
Solution #4
Origin Destination Amount Signature
HhY67j81 Jh89HF8m 1 BTC Djsh767
HhY67J81 LaU4V6uU 2 BTC 8988dd
Jh89HF8m LaU4V6uU 1 BTC djDhd7n
… … …
Bitcoin addresses are
computed from the public
key
Message
31. 33
What does it mean when I say
“I own 30 BTC”?
You know the private key related to a
public key (≈bitcoin address)
and its balance is 30 BTC.
You are the only person to know this
private key.
1
2
Implicit contract
You know the key => you are the owner
(Being owner = having the hability to
transfer)
40. 42
Solution #5
• The first node that manages to
solve this puzzle/equation wins
the block
• The bitcoin network extends this
chain with the new block
• The network always chooses to
extend the largest chain
Grrr!
I need to control
51% of the computational
power of the network (*)
(*) It is not that simple… => Majority is not Enough: Bitcoin Mining is Vulnerable
http://arxiv.org/abs/1311.0243
47. 49
Bitcoin is a smart contract
• It is a program
• Its execution is autonomous
• because of the decentralized network
• Every transactions are public
• It is not possible to modify the history of transactions
• The execution cannot be reverted
• A few clauses/statements of this contract
• No more than 21.000.000 de bitcoins
• A new block every 10 minutes
• Mining difficulty is ajusted to the power of the network
• Only a subset of possible transactions are allowed
• …
51. 53
Ethereum
• Platform similar to Bitcoin but:
• The language for writing smart
contracts is more expressive
(Turing-Complete)
• Avoids to reinvent the wheel by
forking an existing
cryptocurrency
• All the smart contracts use the
same blockchain
• Crowdfunding (sept. 2014)
• 31531 BTC = US$18,439,086
• Launching:
• it’s live since July 30th 2015!
Vitalik Buterin
Ethereum founder
53. 55
More examples of smart contracts
• Decentralized DNS
• Autonomous companies
• Define the shares at the beginning
• Dividends can be distributed automatically
• One could buy and sell stock instantly
• Insurance
• Heritance
• Direct democracy
• IOT (IBM+ Samsung using Ethereum =>
https://www.youtube.com/watch?v=U1XOPIqyP7A)
Great video, only 8
minutes
54. 56
Challenges
• Scalability (current problem with Bitcoin)
• Privacy v/s Criminality
• A bug can be very expensive
• A breach can lead to a loss of all funds of the contract
(which could be a whole company!)
• Generalized bug
• Fork Bitcoin in 2013
• Security?
Still relying on the
break-and-fix cycle
55. 57
Using smart contracts for crime
• Enable to do business without relying on trust
• => perfect for cybercrime
• Example of evil businesses
• Selling secrets
• DoS
• Assassination
• Defacement
• Relies on very sophisticated cryptography on top of
smart contracts
http://www.arijuels.com/wp-content/uploads/2013/09/public_gyges.pdf