Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Bitcoin: transactions et contrats sur la chaîne
Erwan Martin
Lyon Bitcoin Meetup
public@fzwte.net
June 30, 2015
Erwan Mart...
Plan
1 Rappels
Adresses et clés publiques
Blocks
Transactions
Scripts
2 Contrats
Escrow
Campagne de nancement
Dépôt de gar...
Rappels
Table of Contents
1 Rappels
Adresses et clés publiques
Blocks
Transactions
Scripts
2 Contrats
Escrow
Campagne de n...
Rappels Adresses et clés publiques
Adresses et clés publiques
02fb825c6f28169d255c4e7472fb8cb81a290b2119a387a6db9172542b2a...
Rappels Blocks
Blocks
Magic no
Block size
Block header
Version
hashPrevBlock
hashMerkleRoot
Time
Bits
Nonce
Transaction co...
Rappels Transactions
Transactions
Version no
In-counter
Input
Input
Input
...
Out-counter
Output 1
Output 2
Output 3
...
T...
Rappels Transactions
Transactions
Tx #42
Tx #88
Input 1
Input 2
Input 3
Input 4
Output 1
2 BTC
Output 2
5 BTC
Output 3
1 B...
Rappels Scripts
Scripts: où?
Tx #42 Tx #88
Input scriptOutput script
Script = Input script + Output script
Erwan Martin (B...
Rappels Scripts
Scripts: principe
Tx #42 Tx #88
???A + B= 42
scriptSig
scriptPubKey
Script
scriptSig, scriptPubKey
???, A ...
Rappels Scripts
Scripts: Pay to Public Key Hash
Tx #42 Tx #88
sig pubKeyOP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHE...
Rappels Scripts
Execution
Script
⇒ sig
pubKey
OP_DUP
OP_HASH160
pubKeyHash
OP_EQUALVERIFY
OP_CHECKSIG
Pile avant
[vide].
P...
Rappels Scripts
Execution
Script
sig
⇒ pubKey
OP_DUP
OP_HASH160
pubKeyHash
OP_EQUALVERIFY
OP_CHECKSIG
Pile avant
sig.
Pile...
Rappels Scripts
Execution
Script
sig
pubKey
⇒ OP_DUP
OP_HASH160
pubKeyHash
OP_EQUALVERIFY
OP_CHECKSIG
Pile avant
pubKey
si...
Rappels Scripts
Execution
Script
sig
pubKey
OP_DUP
⇒ OP_HASH160
pubKeyHash
OP_EQUALVERIFY
OP_CHECKSIG
Pile avant
pubKey
pu...
Rappels Scripts
Execution
Script
sig
pubKey
OP_DUP
OP_HASH160
⇒ pubKeyHash
OP_EQUALVERIFY
OP_CHECKSIG
Pile avant
pubHashA
...
Rappels Scripts
Execution
Script
sig
pubKey
OP_DUP
OP_HASH160
pubKeyHash
⇒ OP_EQUALVERIFY
OP_CHECKSIG
Pile avant
pubKeyHas...
Rappels Scripts
Execution
Script
sig
pubKey
OP_DUP
OP_HASH160
pubKeyHash
OP_EQUALVERIFY
⇒ OP_CHECKSIG
Pile avant
pubKey
si...
Contrats
Table of Contents
1 Rappels
Adresses et clés publiques
Blocks
Transactions
Scripts
2 Contrats
Escrow
Campagne de ...
Contrats Escrow
Escrow
Tx #42 Tx #88
OP_FALSE sig1 sig2OP_2 pubKey1 pubKey2 pubKey3 OP_3 OP_CHECKMULTISIG
Script
OP_FALSE ...
Contrats Campagne de nancement
Campagne de nancement: principe
Cahier des charges
Le fondateur a besoin de 20 BTC.
4 parti...
Contrats Campagne de nancement
Campagne de nancement: implémentation
Tx #42 Tx #88
Input 1
Output 1
5 BTC
Output 1
20 BTC
...
Contrats Campagne de nancement
Campagne de nancement: implémentation
Tx #42 Tx #105
Input 1
Output 1
5 BTC
Output 1
20 BTC...
Contrats Campagne de nancement
Quelques types de signatures
SIGHASH_ALL|SIGHASH_ANYONECANPAY
Signe tous les outputs et seu...
Contrats Dépôt de garantie
Dépôt de garantie: cahier des charges
Cahier des charges
Une somme provenant de l'utilisateur e...
Contrats Dépôt de garantie
Dépôt de garantie: implémentation
Génération de clés
L'utilisateur et le fournisseur de service...
Contrats Dépôt de garantie
Dépôt de garantie: implémentation
Transaction retour
Le fournisseur génère une deuxième transac...
Contrats Dépôt de garantie
Signature du contrat
Signature du contrat
L'utilisateur ajoute sa signature dans la transaction...
Épilogue
Table of Contents
1 Rappels
Adresses et clés publiques
Blocks
Transactions
Scripts
2 Contrats
Escrow
Campagne de ...
Épilogue
Mais encore?
Laverie
Pour brouiller les pistes dans les transactions.
Micro paiement
Même principe que pour le dé...
Épilogue
Fin
1 Rappels
Adresses et clés publiques
Blocks
Transactions
Scripts
2 Contrats
Escrow
Campagne de nancement
Dépô...
Nächste SlideShare
Wird geladen in …5
×

Bitcoin: transactions et contrats sur la chaîne

667 Aufrufe

Veröffentlicht am

Bitcoin: transactions et contrats sur la chaîne.
Meetup Bitcoin de Lyon du 30 Juin 2015.

Veröffentlicht in: Ingenieurwesen
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier

Bitcoin: transactions et contrats sur la chaîne

  1. 1. Bitcoin: transactions et contrats sur la chaîne Erwan Martin Lyon Bitcoin Meetup public@fzwte.net June 30, 2015 Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 1 / 30
  2. 2. Plan 1 Rappels Adresses et clés publiques Blocks Transactions Scripts 2 Contrats Escrow Campagne de nancement Dépôt de garantie 3 Épilogue Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 2 / 30
  3. 3. Rappels Table of Contents 1 Rappels Adresses et clés publiques Blocks Transactions Scripts 2 Contrats Escrow Campagne de nancement Dépôt de garantie 3 Épilogue Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 3 / 30
  4. 4. Rappels Adresses et clés publiques Adresses et clés publiques 02fb825c6f28169d255c4e7472fb8cb81a290b2119a387a6db9172542b2ac7e164 bcf3fdce6250ad4eb8fc60afc50b5aeb9a6aa034fc2c25b891248c8b88f83512 Public Key: SHA256 9a3f8d58f9b04e7ceb7be4fdc44a84d1a5d44233 RIPEMD160 00 9a3f8d58f9b04e7ceb7be4fdc44a84d1a5d44233 be6e1301 1F4bCDsVtiJMVfoFkZy8FUMv7NieY2X9EG UnBase58 Bitcoin Address: Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 4 / 30
  5. 5. Rappels Blocks Blocks Magic no Block size Block header Version hashPrevBlock hashMerkleRoot Time Bits Nonce Transaction counter Transaction Transaction Transaction ... Block Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 5 / 30
  6. 6. Rappels Transactions Transactions Version no In-counter Input Input Input ... Out-counter Output 1 Output 2 Output 3 ... Transaction Value Txout-script length Txout-script Output Previous TxHash Previous Txout-index Txin-script length Input Txin-script Sequence number Lock time Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 6 / 30
  7. 7. Rappels Transactions Transactions Tx #42 Tx #88 Input 1 Input 2 Input 3 Input 4 Output 1 2 BTC Output 2 5 BTC Output 3 1 BTC Output 4 3 BTC Tx #33 Output 1 0.5 BTC Output 2 0.5 BTC Output 3 8 BTC Output 1 3 BTC Output 2 4 BTC Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 7 / 30
  8. 8. Rappels Scripts Scripts: où? Tx #42 Tx #88 Input scriptOutput script Script = Input script + Output script Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 8 / 30
  9. 9. Rappels Scripts Scripts: principe Tx #42 Tx #88 ???A + B= 42 scriptSig scriptPubKey Script scriptSig, scriptPubKey ???, A + B = 42 Résolution A = 40, B = 2, A + B = 42 Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 9 / 30
  10. 10. Rappels Scripts Scripts: Pay to Public Key Hash Tx #42 Tx #88 sig pubKeyOP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG Script sig pubKey OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 10 / 30
  11. 11. Rappels Scripts Execution Script ⇒ sig pubKey OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG Pile avant [vide]. Pile après sig. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 11 / 30
  12. 12. Rappels Scripts Execution Script sig ⇒ pubKey OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG Pile avant sig. Pile après pubKey sig Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 12 / 30
  13. 13. Rappels Scripts Execution Script sig pubKey ⇒ OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG Pile avant pubKey sig Pile après pubKey pubKey sig Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 13 / 30
  14. 14. Rappels Scripts Execution Script sig pubKey OP_DUP ⇒ OP_HASH160 pubKeyHash OP_EQUALVERIFY OP_CHECKSIG Pile avant pubKey pubKey sig Pile après pubHashA pubKey sig Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 14 / 30
  15. 15. Rappels Scripts Execution Script sig pubKey OP_DUP OP_HASH160 ⇒ pubKeyHash OP_EQUALVERIFY OP_CHECKSIG Pile avant pubHashA pubKey sig Pile après pubKeyHash pubHashA pubKey sig Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 15 / 30
  16. 16. Rappels Scripts Execution Script sig pubKey OP_DUP OP_HASH160 pubKeyHash ⇒ OP_EQUALVERIFY OP_CHECKSIG Pile avant pubKeyHash pubHashA pubKey sig Pile après pubKey sig Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 16 / 30
  17. 17. Rappels Scripts Execution Script sig pubKey OP_DUP OP_HASH160 pubKeyHash OP_EQUALVERIFY ⇒ OP_CHECKSIG Pile avant pubKey sig Pile après true Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 17 / 30
  18. 18. Contrats Table of Contents 1 Rappels Adresses et clés publiques Blocks Transactions Scripts 2 Contrats Escrow Campagne de nancement Dépôt de garantie 3 Épilogue Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 18 / 30
  19. 19. Contrats Escrow Escrow Tx #42 Tx #88 OP_FALSE sig1 sig2OP_2 pubKey1 pubKey2 pubKey3 OP_3 OP_CHECKMULTISIG Script OP_FALSE sig1 sig2 OP_2 pubKey1 pubKey2 pubKey3 OP_3 OP_CHECKMULTISIG Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 19 / 30
  20. 20. Contrats Campagne de nancement Campagne de nancement: principe Cahier des charges Le fondateur a besoin de 20 BTC. 4 participants doivent donner 5 BTC. S'il n'y a pas assez de participants, personne ne paye. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 20 / 30
  21. 21. Contrats Campagne de nancement Campagne de nancement: implémentation Tx #42 Tx #88 Input 1 Output 1 5 BTC Output 1 20 BTC Tx #43 Tx #89 Input 1 Output 1 5 BTC Output 1 20 BTC Alice: Bob: Promesses de don Chaque participant créé une transaction avec comme sortie une adresse du fondateur, mais avec le montant total de la campagne. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 21 / 30
  22. 22. Contrats Campagne de nancement Campagne de nancement: implémentation Tx #42 Tx #105 Input 1 Output 1 5 BTC Output 1 20 BTCTx #43 Input 2 Output 1 5 BTC Alice: Bob: Input 3 Input 4 Phase de collecte Le fondateur crée une transaction en fusionnant toutes celles qu'il a reçu. Utilisation du drapeau SIGHASH_ANYONECANPAY. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 22 / 30
  23. 23. Contrats Campagne de nancement Quelques types de signatures SIGHASH_ALL|SIGHASH_ANYONECANPAY Signe tous les outputs et seulement cet input. N'importe qui peut contribuer des satoshis à la transaction, mais sans changer où ils vont. SIGHASH_SINGLE|SIGHASH_ANYONECANPAY Signe seulement ce couple input/output. Permet à n'importe qui de rajouter des inputs et des outputs. SIGHASH_NONE|SIGHASH_ANYONECANPAY Signe seulement cet input. N'importe qui peut dépenser les satoshis associés comme il lui semble en rajoutant des inputs et des outputs. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 23 / 30
  24. 24. Contrats Dépôt de garantie Dépôt de garantie: cahier des charges Cahier des charges Une somme provenant de l'utilisateur est bloquée pendant une durée déterminée. À la n du temps, la somme est automatiquement re-transférée à l'utilisateur. Les deux parties peuvent annuler/modier le contrat à loisir, mais ensemble. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 24 / 30
  25. 25. Contrats Dépôt de garantie Dépôt de garantie: implémentation Génération de clés L'utilisateur et le fournisseur de service s'échangent chacun une clé publique: pubKeyUser et pubKeyService. Première transaction L'utilisateur génère une transaction à destination du fournisseur nécessitant les deux signatures associées. Tx #42 OP_2 pubUser pubKeyService OP_2 OP_CHECKMULTISIGInput 1 Tx #37 Output 1 10 BTC Il envoie au fournisseur l'empreinte de cette transaction. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 25 / 30
  26. 26. Contrats Dépôt de garantie Dépôt de garantie: implémentation Transaction retour Le fournisseur génère une deuxième transaction qui dépense la première et la renvoi à l'utilisateur. Tx #42 OP_2 pubUser pubKeyService OP_2 OP_CHECKMULTISIGInput 1 Tx #37 Output 1 10 BTC Tx #63 OP_DUP OP_HASH160 pubKeyLocataire OP_EQUALVERIFY OP_CHECKSIG OP_FALSE 0 sigService LockTime: 6 mois Sequence number: 0 Le LockTime est conguré selon la durée voulue du dépôt, et le numéro de séquence de l'input est mis à 0. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 26 / 30
  27. 27. Contrats Dépôt de garantie Signature du contrat Signature du contrat L'utilisateur ajoute sa signature dans la transaction retour, puis publie les deux transactions. Fin normale du contrat À la n du contrat, la transaction est inclue dans un bloc, et les bitcoins retournent à l'utilisateur. Modication du contrat Les deux utilisateurs peuvent recréer une transaction retour avec des modalités diérentes, en incrémentant le Sequence Number. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 27 / 30
  28. 28. Épilogue Table of Contents 1 Rappels Adresses et clés publiques Blocks Transactions Scripts 2 Contrats Escrow Campagne de nancement Dépôt de garantie 3 Épilogue Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 28 / 30
  29. 29. Épilogue Mais encore? Laverie Pour brouiller les pistes dans les transactions. Micro paiement Même principe que pour le dépôt de garantie. Loterie Andrychowicz, Dziembowski, Malinowski, Mazurek. Secure Multiparty Computations on Bitcoin Cryptology ePrint Report 2013/784. Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 29 / 30
  30. 30. Épilogue Fin 1 Rappels Adresses et clés publiques Blocks Transactions Scripts 2 Contrats Escrow Campagne de nancement Dépôt de garantie 3 Épilogue Erwan Martin (Bitcoin Lyon) Bitcoin contracts June 30, 2015 30 / 30

×