3. WHAT DOES
“SMART CONTRACT” MEAN?
Does it need to be maintained on a
decentralized system?
Need to be on the Bitcoin Blockchain?
Are they really smart,
or just dumb scripts?
Can they be legal?
8. BITCOIN MECHANISMS
Pay to Public Key Hash – Basic transaction. Lock
(encumber) script and unlock script.
Pay to Public Key, Multi-Signature, OP_RETURN
Pay to Script Hash (P2SH) – “N-of-M multisig”
and others. Redeem script, Locking script,
Unlocking script
Plus, the dimension of time:
LOCKTIME - post-date a transaction.
OP_CHECKLOCKTIMEVERIFY (OP_CLTV, OP_HODL) -
Relative lock-time based on sequence numbers or
timestamp. BIP68.
OP_CHECKSEQUENCEVERIFY (OP_CSV)– Assures input
has reached a specified age after mined. BIP112.
10. SPECIFYING A SMART CONTRACT
Not that easy!
“Step by Step Towards Creating a Safe
Smart Contract: Lessons and Insights
from a Cryptocurrency Lab”, University
of Maryland
Play for Keeps
Errors in encoding State Machines
Failing to use cryptography
Misaligned incentives
Should use best practices for design
24. FEATURES
Meaningful social connections, communities
Post jobs publicly or privately
Promote jobs and talent
Rewards for referrals
Reputation based on capabilities
Powered by Bitcoin w/Escrow
Global opportunities
Pay for performance
Granular payment milestones
Peer-to-peer dispute resolution
27. SPECIAL K
Privacy protections
Strong “social contracts”;
Consent to connect.
Based on Applied π Calculus
Specification of behavioral types
Embedded DSL. Functional. Scala.
External DSL. New contract language.
E.g., get and set of a state:
contract Cell( get, set, state ) = {
select {
case rtn <- get; v <- state => {
rtn!( v ) | state!( v ) | Cell( get, set, state )
}
case newValue <- set; v <- state => {
state!( newValue ) | Cell( get, set, state )
}
}