SlideShare a Scribd company logo
1 of 17
Tim Swanson






Virtual token (e.g., a
bitcoin, a litecoin) having
at least one moneyness
attribute such as medium
of exchange
It is transported and
tracked on an encrypted,
decentralized ledger called
a cryptoledger (managed
by a cryptoprotocol)
Trustlessness




Computer protocols that
facilitate, verify, execute and
enforce the terms of a contract
Current proto examples include:
◦ Some digital financial instruments
used on electronic securities
exchanges
◦ Point-of-sale terminals
◦ Electronic Data Interchange (EDI)








They do not have a physical
enforcement arm the way
legal contracts do; they just
move the defined asset(s)
automatically under certain
conditions.
Unforgeability (encrypted),
confidentiality, and
divisibility
Reduce the fraud and
enforcement costs of many
commercial transactions
Doable today (e.g. small
business loan)










Version 0.9 (80 byte
hash)
Bitcoin currently manages
one asset via one token
Dev team has limited
resources
Yet in theory, a token can
represent any asset
And a token can be a
type of „smart contract‟








Colored Coins
Mastercoin
Counterparty (POB)
NXT (POS)
Invictus
Ethereum
*Open-Transaction
** Ripple
*** Peercover






Property whose
ownership is
controlled via a smart
contract, which may
or may not reside on
a cryptoledger
„Proplet‟
MEMS
Internet of Things




Not all gadgets, devices
or digital appliances are
technically smart
property
Ownership must be able
to transferred and
managed via smart
contracts


TradeNet/MatterNet (DAO/DACP)
◦ Decentralized Autonomous X
◦ Anything with a proplet









Cars
Refrigerators
Thermostats
Smoke detectors
Doors
Vacuums
Light bulbs
UAV (Quadcopter)
• Manage, trade and exchange assets globally,
pseudonymously (perhaps anonymously) entirely
without going into fiat


TAM is a fusion of:
◦
◦
◦
◦
◦

Cryptoledger
Smart Contracts (e.g., tokens)
Smart Property („proplets‟)
Decentralized exchanges
DAO/DACP*







Near frictionless within the network
Entirely decentralized (e.g. DEX, Coinality,
BankToTheFuture)
Reputation-based at address level (credit
score)
Independent arbitration (Judge.me,
Coinsigner)
Escrow (BTCrow)
Tokens to represent most contractual
agreements (e.g., „labor‟ token to represent X
amount of time used as invoice and
(dis)approved via atomic-transaction)








70 year leases are often
40-50 year leases
4 million rural Chinese
evicted each year
Local gov‟t generate
70% of annual income
from land sales
120-150 million
migrant workers
without urban hukou‟s










Low Bitcoin adoption (1-2 million users)
User interfaces and adoption
Consumer education
Legal uncertainties
Institutional/incumbent inertia
Reinventing the wheel
Is an ideal scenario, just like PGP
“Decentralization for decentralizations sake”




Email: tswanson@gmail.com
Twitter: @ofnumbers
Ofnumbers.com




Contracts very often use multi-signature outputs in order to allocate value to a group of users
... typically, the participants in the contract protocol. Multi-signature outputs are easy to create
with bitcoinj.
// Create a random key.
ECKey clientKey = new ECKey();
// We get the other parties public key from somewhere ...
ECKey serverKey = new ECKey(null, publicKeyBytes);
// Prepare a template for the contract.
Transaction contract = new Transaction(params);
List<ECKey> keys = ImmutableList.of(clientKey, serverKey);
// Create a 2-of-2 multisig output script.
Script script = ScriptBuilder.createMultiSigOutputScript(2, keys);
// Now add an output for 0.50 bitcoins that uses that script.
BigInteger amount = Utils.toNanoCoins(0, 50);
contract.addOutput(amount, script);
// We have said we want to make 0.5 coins controlled by us and them.
// But it's not a valid tx yet because there are no inputs.
Wallet.SendRequest req = Wallet.SendRequest.forTx(contract);
wallet.completeTx(req); // Could throw InsufficientMoneyException
// Broadcast and wait for it to propagate across the network.
// It should take a few seconds unless something went wrong.
peerGroup.broadcastTransaction(req.tx).get();








A common requirement when implementing contract protocols is to pass around and sign incomplete transactions.
The Wallet class doesn't know how to handle outputs that aren't fully owned by it. So we'll have to sign the spending transaction
ourselves.
The key point to bear in mind is that when you sign a transaction, what you actually sign is only parts of that transaction. Which parts are
controlled by the signature hash (sighash) flags. But no matter which flags you select, the contents of input scripts are never signed.
Indeed that must be the case, because otherwise you could never build a transaction - the act of signing the second input would modify
the version of the transaction signed by the first, breaking the signature.
This means that signatures can be calculated and sent between different parties in a contract, then inserted into a transaction to make it
valid.

// Assume we get the multisig transaction we're trying to spend from
// somewhere, like a network connection.
ECKey serverKey = ....;
Transaction contract = ....;
TransactionOutput multisigOutput = contract.getOutput(0);
Script multisigScript = multisigOutput.getScriptPubKey();
// Is the output what we expect?
checkState(multisigScript.isSentToMultiSig());
BigInteger value = multisigOutput.getValue();
// OK, now build a transaction that spends the money back to the client.
Transaction spendTx = new Transaction(params);
spendTx.addOutput(value, clientKey);
spendTx.addInput(multisigOutput);
// It's of the right form. But the wallet can't sign it. So, we have to
// do it ourselves.
Sha256Hash sighash = spendTx.hashTransactionForSignature(0, multisigScript, Transaction.SIGHASH_ALL, false);
ECKey.ECDSASignature signature = serverKey.sign(sighash);
// We have calculated a valid signature, so send it back to the client:
sendToClientApp(signature);




The server receives the contract and decides to give all the money back to the client (how generous of it!). It
constructs a transaction and signs it. Now the client must repeat the process and construct exactly the same
transaction and calculate a signature in the same way. It is then in possession of two valid signatures over the
same transaction, one from itself and one from the server. All that is left is to put them both into the
transaction:
TransactionOutput multisigContract = ....;
ECKey.ECSDASignature serverSignature = ....;
// Client side code.
Transaction spendTx = new Transaction(params);
spendTx.addOutput(value, clientKey);
TransactionInput input = spendTx.addInput(multisigOutput);
Sha256Hash sighash = spendTx.hashTransactionForSignature(0, multisigScript, Transaction.SIGHASH_ALL,
false);
ECKey.ECDSASignature mySignature = clientKey.sign(sighash);
// Create the script that spends the multi-sig output.
Script inputScript = ScriptBuilder.createMultiSigInputScript(
ImmutableList.of(mySignature, serverSignature), Transaction.SIGHASH_ALL, false);
// Add it to the input.
input.setScriptSig(inputScript);
// We can now check the server provided signature is correct, of course...
input.verify(multisigOutput); // Throws an exception if the script doesn't run.
// It's valid! Let's take back the money.
peerGroup.broadcastTransaction(spendTx).get();
// Wallet now has the money back in it.

More Related Content

What's hot

Blockchain, smart contracts and use cases for the Legal Hackers
Blockchain, smart contracts and use cases for the Legal HackersBlockchain, smart contracts and use cases for the Legal Hackers
Blockchain, smart contracts and use cases for the Legal HackersKoen Vingerhoets
 
Buckets of Permissioned, Permissionless, and Permissioned Permissionlessness ...
Buckets of Permissioned, Permissionless, and Permissioned Permissionlessness ...Buckets of Permissioned, Permissionless, and Permissioned Permissionlessness ...
Buckets of Permissioned, Permissionless, and Permissioned Permissionlessness ...Tim Swanson
 
The Studio On Air : blockchain & AI
The Studio On Air : blockchain & AIThe Studio On Air : blockchain & AI
The Studio On Air : blockchain & AIKoen Vingerhoets
 
Self Sovereign Digital Identity on the Blockchain: A Discourse Analysis
Self Sovereign Digital Identity on the Blockchain: A Discourse AnalysisSelf Sovereign Digital Identity on the Blockchain: A Discourse Analysis
Self Sovereign Digital Identity on the Blockchain: A Discourse Analysiseraser Juan José Calderón
 
Disadvantages and Advantages of Blockchain
Disadvantages and Advantages of BlockchainDisadvantages and Advantages of Blockchain
Disadvantages and Advantages of Blockchainijtsrd
 
Basic introduction in blockchain, smart contracts, permissioned ledgers
Basic introduction in blockchain, smart contracts, permissioned ledgersBasic introduction in blockchain, smart contracts, permissioned ledgers
Basic introduction in blockchain, smart contracts, permissioned ledgersKoen Vingerhoets
 
Smart contractjp smartcontract_about
Smart contractjp smartcontract_aboutSmart contractjp smartcontract_about
Smart contractjp smartcontract_aboutTomoaki Sato
 
The Nuances of Tokenization: A brief explanation on attempts from this past d...
The Nuances of Tokenization: A brief explanation on attempts from this past d...The Nuances of Tokenization: A brief explanation on attempts from this past d...
The Nuances of Tokenization: A brief explanation on attempts from this past d...Tim Swanson
 
Blockchain intro: The end of the middleman
Blockchain intro: The end of the middlemanBlockchain intro: The end of the middleman
Blockchain intro: The end of the middlemanAndries De Vos
 
Blockchain_in_FINTECH
Blockchain_in_FINTECHBlockchain_in_FINTECH
Blockchain_in_FINTECHxspeedcruiser
 
The best smart contract platforms in 2021
The best smart contract platforms in 2021The best smart contract platforms in 2021
The best smart contract platforms in 2021OliviaJune1
 
Moving Beyond BINO Beta
Moving Beyond BINO BetaMoving Beyond BINO Beta
Moving Beyond BINO BetaTim Swanson
 
The Tokenization of Everything - SAP Central Bank Executive Summit 2019
The Tokenization of Everything - SAP Central Bank Executive Summit 2019The Tokenization of Everything - SAP Central Bank Executive Summit 2019
The Tokenization of Everything - SAP Central Bank Executive Summit 2019Todd McDonald
 
Hacking Finance: Crypto & Math based Currencies, Smart contracts and Blockch...
Hacking Finance: Crypto & Math based Currencies, Smart contracts  and Blockch...Hacking Finance: Crypto & Math based Currencies, Smart contracts  and Blockch...
Hacking Finance: Crypto & Math based Currencies, Smart contracts and Blockch...Raffaele Mauro
 
An introduction to Blockchain (for nontechnical people)
An introduction to Blockchain (for nontechnical people)An introduction to Blockchain (for nontechnical people)
An introduction to Blockchain (for nontechnical people)Miguel Neumann
 
Contracts Across Coins - Smart Contracts for Bitcoin, Ripple and the altcoins
Contracts Across Coins - Smart Contracts for Bitcoin, Ripple and the altcoinsContracts Across Coins - Smart Contracts for Bitcoin, Ripple and the altcoins
Contracts Across Coins - Smart Contracts for Bitcoin, Ripple and the altcoinsRipple Labs
 
Blockchain analysis: 2016-11-23 MeetUp FinTech Marketpay.io - LemonPay.me
Blockchain analysis: 2016-11-23 MeetUp FinTech Marketpay.io - LemonPay.meBlockchain analysis: 2016-11-23 MeetUp FinTech Marketpay.io - LemonPay.me
Blockchain analysis: 2016-11-23 MeetUp FinTech Marketpay.io - LemonPay.meJuan Ignacio Pérez Sacristán
 
Cryptocurrency solving problems
Cryptocurrency solving problems Cryptocurrency solving problems
Cryptocurrency solving problems Suman Nayak
 

What's hot (19)

Blockchain, smart contracts and use cases for the Legal Hackers
Blockchain, smart contracts and use cases for the Legal HackersBlockchain, smart contracts and use cases for the Legal Hackers
Blockchain, smart contracts and use cases for the Legal Hackers
 
Buckets of Permissioned, Permissionless, and Permissioned Permissionlessness ...
Buckets of Permissioned, Permissionless, and Permissioned Permissionlessness ...Buckets of Permissioned, Permissionless, and Permissioned Permissionlessness ...
Buckets of Permissioned, Permissionless, and Permissioned Permissionlessness ...
 
The Studio On Air : blockchain & AI
The Studio On Air : blockchain & AIThe Studio On Air : blockchain & AI
The Studio On Air : blockchain & AI
 
Self Sovereign Digital Identity on the Blockchain: A Discourse Analysis
Self Sovereign Digital Identity on the Blockchain: A Discourse AnalysisSelf Sovereign Digital Identity on the Blockchain: A Discourse Analysis
Self Sovereign Digital Identity on the Blockchain: A Discourse Analysis
 
Disadvantages and Advantages of Blockchain
Disadvantages and Advantages of BlockchainDisadvantages and Advantages of Blockchain
Disadvantages and Advantages of Blockchain
 
Basic introduction in blockchain, smart contracts, permissioned ledgers
Basic introduction in blockchain, smart contracts, permissioned ledgersBasic introduction in blockchain, smart contracts, permissioned ledgers
Basic introduction in blockchain, smart contracts, permissioned ledgers
 
Unlocking Blockchain’s Potential
Unlocking Blockchain’s PotentialUnlocking Blockchain’s Potential
Unlocking Blockchain’s Potential
 
Smart contractjp smartcontract_about
Smart contractjp smartcontract_aboutSmart contractjp smartcontract_about
Smart contractjp smartcontract_about
 
The Nuances of Tokenization: A brief explanation on attempts from this past d...
The Nuances of Tokenization: A brief explanation on attempts from this past d...The Nuances of Tokenization: A brief explanation on attempts from this past d...
The Nuances of Tokenization: A brief explanation on attempts from this past d...
 
Blockchain intro: The end of the middleman
Blockchain intro: The end of the middlemanBlockchain intro: The end of the middleman
Blockchain intro: The end of the middleman
 
Blockchain_in_FINTECH
Blockchain_in_FINTECHBlockchain_in_FINTECH
Blockchain_in_FINTECH
 
The best smart contract platforms in 2021
The best smart contract platforms in 2021The best smart contract platforms in 2021
The best smart contract platforms in 2021
 
Moving Beyond BINO Beta
Moving Beyond BINO BetaMoving Beyond BINO Beta
Moving Beyond BINO Beta
 
The Tokenization of Everything - SAP Central Bank Executive Summit 2019
The Tokenization of Everything - SAP Central Bank Executive Summit 2019The Tokenization of Everything - SAP Central Bank Executive Summit 2019
The Tokenization of Everything - SAP Central Bank Executive Summit 2019
 
Hacking Finance: Crypto & Math based Currencies, Smart contracts and Blockch...
Hacking Finance: Crypto & Math based Currencies, Smart contracts  and Blockch...Hacking Finance: Crypto & Math based Currencies, Smart contracts  and Blockch...
Hacking Finance: Crypto & Math based Currencies, Smart contracts and Blockch...
 
An introduction to Blockchain (for nontechnical people)
An introduction to Blockchain (for nontechnical people)An introduction to Blockchain (for nontechnical people)
An introduction to Blockchain (for nontechnical people)
 
Contracts Across Coins - Smart Contracts for Bitcoin, Ripple and the altcoins
Contracts Across Coins - Smart Contracts for Bitcoin, Ripple and the altcoinsContracts Across Coins - Smart Contracts for Bitcoin, Ripple and the altcoins
Contracts Across Coins - Smart Contracts for Bitcoin, Ripple and the altcoins
 
Blockchain analysis: 2016-11-23 MeetUp FinTech Marketpay.io - LemonPay.me
Blockchain analysis: 2016-11-23 MeetUp FinTech Marketpay.io - LemonPay.meBlockchain analysis: 2016-11-23 MeetUp FinTech Marketpay.io - LemonPay.me
Blockchain analysis: 2016-11-23 MeetUp FinTech Marketpay.io - LemonPay.me
 
Cryptocurrency solving problems
Cryptocurrency solving problems Cryptocurrency solving problems
Cryptocurrency solving problems
 

Similar to Primer to smart contracts, smart property, trustless asset management

BlockChain for the Banker
BlockChain for the BankerBlockChain for the Banker
BlockChain for the BankerBohdan Szymanik
 
The problem with blockchains
The problem with blockchainsThe problem with blockchains
The problem with blockchainsGurkirat Singh
 
Blockchain intro - the basics
Blockchain intro - the basicsBlockchain intro - the basics
Blockchain intro - the basicsZakir Hoosen
 
Blockchain-intro (2)
Blockchain-intro (2)Blockchain-intro (2)
Blockchain-intro (2)Zakir Hoosen
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchainPriyab Satoshi
 
Blockchain, smart contracts - introduction
Blockchain, smart contracts - introductionBlockchain, smart contracts - introduction
Blockchain, smart contracts - introductionLukasz Jarmulowicz
 
DevDay: Have Your Cake and Eat it Too, Privacy and Security with ZKP, ING
DevDay: Have Your Cake and Eat it Too, Privacy and Security with ZKP, INGDevDay: Have Your Cake and Eat it Too, Privacy and Security with ZKP, ING
DevDay: Have Your Cake and Eat it Too, Privacy and Security with ZKP, INGR3
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumTomoaki Sato
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart ContractDeepak Aryal
 
R3Corda_Concepts+Components_AICTE_STTP_2020
R3Corda_Concepts+Components_AICTE_STTP_2020R3Corda_Concepts+Components_AICTE_STTP_2020
R3Corda_Concepts+Components_AICTE_STTP_2020Amritha Antony
 
R3Corda - Architecture Overview - Concepts and Components
R3Corda - Architecture Overview - Concepts and ComponentsR3Corda - Architecture Overview - Concepts and Components
R3Corda - Architecture Overview - Concepts and ComponentsGokul Alex
 
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)IT Arena
 
Kriptovaluták, hashbányászat és okoscicák
Kriptovaluták, hashbányászat és okoscicákKriptovaluták, hashbányászat és okoscicák
Kriptovaluták, hashbányászat és okoscicákhackersuli
 
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Destry Saul
 

Similar to Primer to smart contracts, smart property, trustless asset management (20)

BlockChain for the Banker
BlockChain for the BankerBlockChain for the Banker
BlockChain for the Banker
 
The problem with blockchains
The problem with blockchainsThe problem with blockchains
The problem with blockchains
 
Blockchain intro - the basics
Blockchain intro - the basicsBlockchain intro - the basics
Blockchain intro - the basics
 
Blockchain-intro (2)
Blockchain-intro (2)Blockchain-intro (2)
Blockchain-intro (2)
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchain
 
Blockchain, smart contracts - introduction
Blockchain, smart contracts - introductionBlockchain, smart contracts - introduction
Blockchain, smart contracts - introduction
 
DevDay: Have Your Cake and Eat it Too, Privacy and Security with ZKP, ING
DevDay: Have Your Cake and Eat it Too, Privacy and Security with ZKP, INGDevDay: Have Your Cake and Eat it Too, Privacy and Security with ZKP, ING
DevDay: Have Your Cake and Eat it Too, Privacy and Security with ZKP, ING
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
 
Cryptocurrency
Cryptocurrency Cryptocurrency
Cryptocurrency
 
Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum) Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum)
 
Blockchain.pptx
Blockchain.pptxBlockchain.pptx
Blockchain.pptx
 
Ethereum Smart Contracts 101 with Cryptizens.io
Ethereum Smart Contracts 101 with Cryptizens.ioEthereum Smart Contracts 101 with Cryptizens.io
Ethereum Smart Contracts 101 with Cryptizens.io
 
1. ibm blockchain explained
1. ibm blockchain explained1. ibm blockchain explained
1. ibm blockchain explained
 
bitcoin_presentation
bitcoin_presentationbitcoin_presentation
bitcoin_presentation
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart Contract
 
R3Corda_Concepts+Components_AICTE_STTP_2020
R3Corda_Concepts+Components_AICTE_STTP_2020R3Corda_Concepts+Components_AICTE_STTP_2020
R3Corda_Concepts+Components_AICTE_STTP_2020
 
R3Corda - Architecture Overview - Concepts and Components
R3Corda - Architecture Overview - Concepts and ComponentsR3Corda - Architecture Overview - Concepts and Components
R3Corda - Architecture Overview - Concepts and Components
 
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)
 
Kriptovaluták, hashbányászat és okoscicák
Kriptovaluták, hashbányászat és okoscicákKriptovaluták, hashbányászat és okoscicák
Kriptovaluták, hashbányászat és okoscicák
 
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
 

More from Tim Swanson

The Fed and FDIC bailed out “crypto friendly” banks.pptx
The Fed and FDIC bailed out “crypto friendly” banks.pptxThe Fed and FDIC bailed out “crypto friendly” banks.pptx
The Fed and FDIC bailed out “crypto friendly” banks.pptxTim Swanson
 
8 areas for PMF and IMF with blockchains_.pptx
8 areas for PMF and IMF with blockchains_.pptx8 areas for PMF and IMF with blockchains_.pptx
8 areas for PMF and IMF with blockchains_.pptxTim Swanson
 
Collateral-backed stablecoin landscape
Collateral-backed stablecoin landscapeCollateral-backed stablecoin landscape
Collateral-backed stablecoin landscapeTim Swanson
 
DeFi's dependency on the U.S. banking system
DeFi's dependency on the U.S. banking systemDeFi's dependency on the U.S. banking system
DeFi's dependency on the U.S. banking systemTim Swanson
 
Exchange-related chains such as BSC
Exchange-related chains such as BSCExchange-related chains such as BSC
Exchange-related chains such as BSCTim Swanson
 
Regtech in the era of intermediaries
Regtech in the era of intermediariesRegtech in the era of intermediaries
Regtech in the era of intermediariesTim Swanson
 
B-words and financial market infrastructures
B-words and financial market infrastructuresB-words and financial market infrastructures
B-words and financial market infrastructuresTim Swanson
 
Color around Dead Token Litigation
Color around Dead Token LitigationColor around Dead Token Litigation
Color around Dead Token LitigationTim Swanson
 
Clouds and Chains
Clouds and ChainsClouds and Chains
Clouds and ChainsTim Swanson
 
Distributed Ledger Technology as Financial Market Infrastructure
Distributed Ledger Technology as Financial Market InfrastructureDistributed Ledger Technology as Financial Market Infrastructure
Distributed Ledger Technology as Financial Market InfrastructureTim Swanson
 
The tech landscape surrounding distributed ledgers
The tech landscape surrounding distributed ledgersThe tech landscape surrounding distributed ledgers
The tech landscape surrounding distributed ledgersTim Swanson
 
Defining Smart Contracts
Defining Smart ContractsDefining Smart Contracts
Defining Smart ContractsTim Swanson
 
Brief overview of cryptoeconomics
Brief overview of cryptoeconomicsBrief overview of cryptoeconomics
Brief overview of cryptoeconomicsTim Swanson
 
The Distributed Ledger Landscape
The Distributed Ledger LandscapeThe Distributed Ledger Landscape
The Distributed Ledger LandscapeTim Swanson
 
The Future of Fintech: Crystal balls and tasseography
The Future of Fintech: Crystal balls and tasseographyThe Future of Fintech: Crystal balls and tasseography
The Future of Fintech: Crystal balls and tasseographyTim Swanson
 
By the numbers: understanding value transfers to and from China
By the numbers: understanding value transfers to and from ChinaBy the numbers: understanding value transfers to and from China
By the numbers: understanding value transfers to and from ChinaTim Swanson
 
Making Lemonade out of Lemons: Squeezing utility from a proof-of-work experiment
Making Lemonade out of Lemons: Squeezing utility from a proof-of-work experimentMaking Lemonade out of Lemons: Squeezing utility from a proof-of-work experiment
Making Lemonade out of Lemons: Squeezing utility from a proof-of-work experimentTim Swanson
 
The Continued Existence of Altcoins, Appcoins and Commodity coins
The Continued Existence of Altcoins, Appcoins and Commodity coinsThe Continued Existence of Altcoins, Appcoins and Commodity coins
The Continued Existence of Altcoins, Appcoins and Commodity coinsTim Swanson
 

More from Tim Swanson (20)

The Fed and FDIC bailed out “crypto friendly” banks.pptx
The Fed and FDIC bailed out “crypto friendly” banks.pptxThe Fed and FDIC bailed out “crypto friendly” banks.pptx
The Fed and FDIC bailed out “crypto friendly” banks.pptx
 
8 areas for PMF and IMF with blockchains_.pptx
8 areas for PMF and IMF with blockchains_.pptx8 areas for PMF and IMF with blockchains_.pptx
8 areas for PMF and IMF with blockchains_.pptx
 
Collateral-backed stablecoin landscape
Collateral-backed stablecoin landscapeCollateral-backed stablecoin landscape
Collateral-backed stablecoin landscape
 
DeFi's dependency on the U.S. banking system
DeFi's dependency on the U.S. banking systemDeFi's dependency on the U.S. banking system
DeFi's dependency on the U.S. banking system
 
Exchange-related chains such as BSC
Exchange-related chains such as BSCExchange-related chains such as BSC
Exchange-related chains such as BSC
 
Regtech in the era of intermediaries
Regtech in the era of intermediariesRegtech in the era of intermediaries
Regtech in the era of intermediaries
 
B-words and financial market infrastructures
B-words and financial market infrastructuresB-words and financial market infrastructures
B-words and financial market infrastructures
 
Color around Dead Token Litigation
Color around Dead Token LitigationColor around Dead Token Litigation
Color around Dead Token Litigation
 
Blockchain 2040
Blockchain 2040Blockchain 2040
Blockchain 2040
 
Clouds and Chains
Clouds and ChainsClouds and Chains
Clouds and Chains
 
Distributed Ledger Technology as Financial Market Infrastructure
Distributed Ledger Technology as Financial Market InfrastructureDistributed Ledger Technology as Financial Market Infrastructure
Distributed Ledger Technology as Financial Market Infrastructure
 
Code is not law
Code is not lawCode is not law
Code is not law
 
The tech landscape surrounding distributed ledgers
The tech landscape surrounding distributed ledgersThe tech landscape surrounding distributed ledgers
The tech landscape surrounding distributed ledgers
 
Defining Smart Contracts
Defining Smart ContractsDefining Smart Contracts
Defining Smart Contracts
 
Brief overview of cryptoeconomics
Brief overview of cryptoeconomicsBrief overview of cryptoeconomics
Brief overview of cryptoeconomics
 
The Distributed Ledger Landscape
The Distributed Ledger LandscapeThe Distributed Ledger Landscape
The Distributed Ledger Landscape
 
The Future of Fintech: Crystal balls and tasseography
The Future of Fintech: Crystal balls and tasseographyThe Future of Fintech: Crystal balls and tasseography
The Future of Fintech: Crystal balls and tasseography
 
By the numbers: understanding value transfers to and from China
By the numbers: understanding value transfers to and from ChinaBy the numbers: understanding value transfers to and from China
By the numbers: understanding value transfers to and from China
 
Making Lemonade out of Lemons: Squeezing utility from a proof-of-work experiment
Making Lemonade out of Lemons: Squeezing utility from a proof-of-work experimentMaking Lemonade out of Lemons: Squeezing utility from a proof-of-work experiment
Making Lemonade out of Lemons: Squeezing utility from a proof-of-work experiment
 
The Continued Existence of Altcoins, Appcoins and Commodity coins
The Continued Existence of Altcoins, Appcoins and Commodity coinsThe Continued Existence of Altcoins, Appcoins and Commodity coins
The Continued Existence of Altcoins, Appcoins and Commodity coins
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Primer to smart contracts, smart property, trustless asset management

  • 2.    Virtual token (e.g., a bitcoin, a litecoin) having at least one moneyness attribute such as medium of exchange It is transported and tracked on an encrypted, decentralized ledger called a cryptoledger (managed by a cryptoprotocol) Trustlessness
  • 3.   Computer protocols that facilitate, verify, execute and enforce the terms of a contract Current proto examples include: ◦ Some digital financial instruments used on electronic securities exchanges ◦ Point-of-sale terminals ◦ Electronic Data Interchange (EDI)
  • 4.     They do not have a physical enforcement arm the way legal contracts do; they just move the defined asset(s) automatically under certain conditions. Unforgeability (encrypted), confidentiality, and divisibility Reduce the fraud and enforcement costs of many commercial transactions Doable today (e.g. small business loan)
  • 5.      Version 0.9 (80 byte hash) Bitcoin currently manages one asset via one token Dev team has limited resources Yet in theory, a token can represent any asset And a token can be a type of „smart contract‟
  • 6.       Colored Coins Mastercoin Counterparty (POB) NXT (POS) Invictus Ethereum *Open-Transaction ** Ripple *** Peercover
  • 7.     Property whose ownership is controlled via a smart contract, which may or may not reside on a cryptoledger „Proplet‟ MEMS Internet of Things
  • 8.   Not all gadgets, devices or digital appliances are technically smart property Ownership must be able to transferred and managed via smart contracts
  • 9.  TradeNet/MatterNet (DAO/DACP) ◦ Decentralized Autonomous X ◦ Anything with a proplet         Cars Refrigerators Thermostats Smoke detectors Doors Vacuums Light bulbs UAV (Quadcopter)
  • 10. • Manage, trade and exchange assets globally, pseudonymously (perhaps anonymously) entirely without going into fiat  TAM is a fusion of: ◦ ◦ ◦ ◦ ◦ Cryptoledger Smart Contracts (e.g., tokens) Smart Property („proplets‟) Decentralized exchanges DAO/DACP*
  • 11.       Near frictionless within the network Entirely decentralized (e.g. DEX, Coinality, BankToTheFuture) Reputation-based at address level (credit score) Independent arbitration (Judge.me, Coinsigner) Escrow (BTCrow) Tokens to represent most contractual agreements (e.g., „labor‟ token to represent X amount of time used as invoice and (dis)approved via atomic-transaction)
  • 12.     70 year leases are often 40-50 year leases 4 million rural Chinese evicted each year Local gov‟t generate 70% of annual income from land sales 120-150 million migrant workers without urban hukou‟s
  • 13.         Low Bitcoin adoption (1-2 million users) User interfaces and adoption Consumer education Legal uncertainties Institutional/incumbent inertia Reinventing the wheel Is an ideal scenario, just like PGP “Decentralization for decentralizations sake”
  • 15.   Contracts very often use multi-signature outputs in order to allocate value to a group of users ... typically, the participants in the contract protocol. Multi-signature outputs are easy to create with bitcoinj. // Create a random key. ECKey clientKey = new ECKey(); // We get the other parties public key from somewhere ... ECKey serverKey = new ECKey(null, publicKeyBytes); // Prepare a template for the contract. Transaction contract = new Transaction(params); List<ECKey> keys = ImmutableList.of(clientKey, serverKey); // Create a 2-of-2 multisig output script. Script script = ScriptBuilder.createMultiSigOutputScript(2, keys); // Now add an output for 0.50 bitcoins that uses that script. BigInteger amount = Utils.toNanoCoins(0, 50); contract.addOutput(amount, script); // We have said we want to make 0.5 coins controlled by us and them. // But it's not a valid tx yet because there are no inputs. Wallet.SendRequest req = Wallet.SendRequest.forTx(contract); wallet.completeTx(req); // Could throw InsufficientMoneyException // Broadcast and wait for it to propagate across the network. // It should take a few seconds unless something went wrong. peerGroup.broadcastTransaction(req.tx).get();
  • 16.      A common requirement when implementing contract protocols is to pass around and sign incomplete transactions. The Wallet class doesn't know how to handle outputs that aren't fully owned by it. So we'll have to sign the spending transaction ourselves. The key point to bear in mind is that when you sign a transaction, what you actually sign is only parts of that transaction. Which parts are controlled by the signature hash (sighash) flags. But no matter which flags you select, the contents of input scripts are never signed. Indeed that must be the case, because otherwise you could never build a transaction - the act of signing the second input would modify the version of the transaction signed by the first, breaking the signature. This means that signatures can be calculated and sent between different parties in a contract, then inserted into a transaction to make it valid. // Assume we get the multisig transaction we're trying to spend from // somewhere, like a network connection. ECKey serverKey = ....; Transaction contract = ....; TransactionOutput multisigOutput = contract.getOutput(0); Script multisigScript = multisigOutput.getScriptPubKey(); // Is the output what we expect? checkState(multisigScript.isSentToMultiSig()); BigInteger value = multisigOutput.getValue(); // OK, now build a transaction that spends the money back to the client. Transaction spendTx = new Transaction(params); spendTx.addOutput(value, clientKey); spendTx.addInput(multisigOutput); // It's of the right form. But the wallet can't sign it. So, we have to // do it ourselves. Sha256Hash sighash = spendTx.hashTransactionForSignature(0, multisigScript, Transaction.SIGHASH_ALL, false); ECKey.ECDSASignature signature = serverKey.sign(sighash); // We have calculated a valid signature, so send it back to the client: sendToClientApp(signature);
  • 17.   The server receives the contract and decides to give all the money back to the client (how generous of it!). It constructs a transaction and signs it. Now the client must repeat the process and construct exactly the same transaction and calculate a signature in the same way. It is then in possession of two valid signatures over the same transaction, one from itself and one from the server. All that is left is to put them both into the transaction: TransactionOutput multisigContract = ....; ECKey.ECSDASignature serverSignature = ....; // Client side code. Transaction spendTx = new Transaction(params); spendTx.addOutput(value, clientKey); TransactionInput input = spendTx.addInput(multisigOutput); Sha256Hash sighash = spendTx.hashTransactionForSignature(0, multisigScript, Transaction.SIGHASH_ALL, false); ECKey.ECDSASignature mySignature = clientKey.sign(sighash); // Create the script that spends the multi-sig output. Script inputScript = ScriptBuilder.createMultiSigInputScript( ImmutableList.of(mySignature, serverSignature), Transaction.SIGHASH_ALL, false); // Add it to the input. input.setScriptSig(inputScript); // We can now check the server provided signature is correct, of course... input.verify(multisigOutput); // Throws an exception if the script doesn't run. // It's valid! Let's take back the money. peerGroup.broadcastTransaction(spendTx).get(); // Wallet now has the money back in it.

Editor's Notes

  1. The following is a hypothetical scenario, where user adoption and education are quicker than what will likely occur. Just as the Segway product was overhyped, proponents of cryptoprotocols need to hedge their terms and take into account the slow user adoption rates that will likely occur with the concepts in this Powerpoint. For example, roughly 1-2 million people have used a cryptocurrency despite millions of hours of promotion/marketing/promotion on a global level. Could the same thing happen with smart contracts?
  2. All cryptocurrencies are virtual and digital, but not all digital ‘coins’ are cryptocurrencies.
  3. Smart Contracts by Nick Szabo: http://szabo.best.vwh.net/smart.contracts.htmlAccording to Mark Miller the first smart contracting system was AMIX, the American Information Exchange.
  4. Theyare computer protocols – algorithms – that can self-execute, self-enforce, self-verify and self-constrain the performance of a contract. As show below, contracts on 2.0 platforms basically enforce themselves. The term smart contract is sometimes used as a bit of a misnomer, because it undersells the capabilities of a DAO. An ‘active contract’ or ‘live contract’ explains that the contract itself is the mechanism that monitors and actively controls the prior agreement per the terms. See also: WorkingWithContracts from bitcoinj
  5. Core Development Update #5 by Gavin Andresen https://bitcoinfoundation.org/blog/?p=290
  6. Proplets -- Devices for Controlling Property by Nick Szabo http://szabo.best.vwh.net/proplets.html
  7. Just because you have WiFi enabled lightbulbs or even doors, that this is not smart property.  It may be automated property but it is not &quot;smart&quot; in the sense that ownership and control can be reverted automatically to a different party.
  8. Decentralized Autonomous Consensus Platform (coined by Adam Levine) See Mike Hearn’s presentation at the 2013 Turing conference: http://www.youtube.com/watch?v=Pu4PAMFPo5Y
  9. See also: http://www.generalgovernance.com
  10. See Chinese Land-Use Rights: What Happens After 70 Years? from China Smack, China’s Real Estate Riddle from Patrick Chovanec, You May Own your Apartment, but who Owns the Land Underneath Your Feet? by Thomas Rippel, If Beijing is your landlord, what happens when the lease is up? from China Economic Review and Chinese fear homes are castles in the air by Stephen WongSee China’s Land Grab Epidemic Is Causing More Wukan-Style Protests from The Atlantic and China Tackles Land Grabs, Key Source of Rural Anger from The Wall Street JournalSee China land price fall threatens local finances from Financial Times and China’s land-seizure problem from Chicago TribuneInternal Migration in China and the Effects on Sending Regions from OECDSee Hukou system and China: Urbanization and Hukou Reform from The Diplomat
  11. From Mike Hearn: http://code.google.com/p/bitcoinj/wiki/WorkingWithContracts
  12. From Mike Hearn: http://code.google.com/p/bitcoinj/wiki/WorkingWithContracts
  13. From Mike Hearn: http://code.google.com/p/bitcoinj/wiki/WorkingWithContracts