Upgrade to Pro — share decks privately, control downloads, hide ads and more …

blockchain.tokyo#18-2019-03-26

 blockchain.tokyo#18-2019-03-26

Tomokazu Kozuma

March 26, 2019
Tweet

More Decks by Tomokazu Kozuma

Other Decks in Technology

Transcript

  1. A B O U T M Y S E L

    F ࣗݾ঺հ Tomokazu Kozuma @Tomokazu106 ౦ژ޻ۀେֶେֶӃଔۀޙɺαΠόʔΤʔδΣϯτͰεϚϗήʔϜͷαʔόɺΠϯ ϑϥશൠΛ୲౰ɻԾ૝௨՟ʹ͍ٕͭͯज़ϒϩάΛॻ͍ͯΔ͏ͪʹ຅಄͠ɺຊ৬ͱ ͯ͠஫ྗ͢ΔͨΊʹ(JODPʹೖࣾɻ(JODPͰ͸ϒϩοΫνΣʔϯͷϊʔυӡ༻ɺϋʔ υϑΥʔΫରԠɺόοΫΤϯυͳͲ޿ൣғΛ୲౰ɻ
  2. #$)ͱ#47ͷಛ௃ • 01@$0%&ͷ෮ݩɿ
 [email protected]ɺ01@-4)*'5ɺ01@34)*'5ɺ01@*/7&35 • εΫϦϓτ͋ͨΓ01@$0%&ͷ੍ݶΛऔΓআ͘ • ࠷େϒϩοΫαΠζΛ.#·Ͱ֦େ F e

    a t u r e o f B C H a n d B S V • ৽ن01@$0%&ɿ01@$)&$,%"5"4*( 7&3*':  • $BOPOJDBM5SBOTBDUJPO0SEFSJOHʢ$503ʣͷಋೖ B C H ɿ B i t c o i n A B C B S V ɿ n C h a i n
  3. #$)ͱ#47ͷ໰୊఺ • ϦϓϨΠϓϩςΫγϣϯػೳ͕ͳ͍ʢ#$)ʹ݄ಋೖ༧ఆʣ P r o b l e m

    • #$)Λૹۚ͢Δͱ#47΋ૹۚ͞Ε
 ˠτϥϯβΫγϣϯϦϓϨΠ͕ൃੜ • ͓٬༷͕ࢿ࢈Λ҆શʹ؅ཧͰ͖ΔΑ͏ʹ͢Δඞཁ͕͋Δ
 ˠεϓϦοτػೳΛ࣮૷
  4. %VTU5SBOTBDUJPO • ख਺ྉͱͯ͠औΓࠐ·Εͳ͍࠷௿ֹۚʢTBUʣͷ 6590Λ࢖༻ A b o u t D

    u s t T r a n s a c t i o n ? • #$)ʹ͔͠ଘࡏ͠ͳ͍%VTU5YΛΠϯϓοτʹؚΊͯ ૹۚ͢Δ • #47ͷνΣʔϯʹ͸ଘࡏ͠ͳ͍6590͕Πϯϓοτʹ ؚ·Ε͍ͯΔͨΊঝೝ͞Εͳ͍
  5. O-PDL5JNF • τϥϯβΫγϣϯʹࢦఆͰ͖Δύϥϝʔλ A b o u t n L

    o c k T i m e • ࢦఆͨ͠ϒϩοΫߴɺ6OJY5JNF·ͰϒϩοΫʹ औΓࠐ·Εͳ͍ • #$)ͱ#47ͷ࠷৽ϒϩοΫߴͷࠩΛར༻ͯ͠ εϓϦοτ͢Δํ๏
  6. εϓϦοτͷൺֱ εϓϦοτํ๏ ϝϦοτ σϝϦοτ %VTU5SBOTBDUJPO ࣮૷͕͍Βͳ͍ ༰қʹ࣮ߦͰ͖Δ εϓϦοτ͢Δʹ͸෼཭ࡁͷ6590͕ඞཁ શͯͷ΢ΥϨοτʹରͯ͠ૹۚ͢Δඞཁ͕͋Δ O-PDL5JNF

    ࣮૷΄΅͕͍Βͳ͍ #$)ͱ#47ͷϒϩοΫߴ͕཭Ε͍ͯΔඞཁ͕͋Δ ஌͕ࣝͳ͍ͱૹۚλΠϛϯά͕Θ͔Βͳ͍ 01@$0%& 01@$)&$,%"5"4*( ͍ͭͰ΋ԿճͰ΋ εϓϦοτͰ͖Δ ௐࠪͱ࣮૷͕গ͠େม
  7. 01@$)&$,%"5"4*(ͱ͸ʁ • ϒϩοΫνΣʔϯ֎ͷσʔλʢΦϥΫϧʣͷॺ໊ݕূΛߦ͑Δ A b o u t O P

    _ C H E C K D A T A S I G <signature> <message> <pubkey> OP_CHECKDATASIG S c r i p t • ΦϥΫϧ͕࢖͑ΔͷͰΞτϛοΫεϫοϓ΁ͷԠ༻ʹظ଴
  8. 5 S p l i t U s i n

    g P 2 P K H a n d P 2 S H εϓϦοτͷखॱ 3FEFFN4DSJQUͷߏஙͱղআ 01@$)&$,%"5"4*(Λ࢖ͬͨεϓϦοτํ๏
  9. εϓϦοτͷखॱ • εϓϦοτ͸ࣗ෼΁શֹૹۚΛճߦ͏ F l o w o f S

    p l i t • ճ໨͸01@$)&$,%"5"4*(Λ3FEFFN4DSJQUʹ ؚΉΞυϨεʹૹۚ͢Δ͜ͱ͕໨త • ճ໨ͷૹۚ͸01@$)&$,%"5"4*(ΛؚΉ6590Λ ղআͯ͠11,)ʹૹۚ͢Δ͜ͱ͕໨త
  10. ճ໨ͷશֹૹۚ • 01@$)&$,%"5"4*(ΛؚΉ14)ΞυϨεʹTBUૹۚ *OQVU 0VUQVU #$)#47 #$)#47 #$)#47 TBU #$)#47

    ͓௼Γ 14)"EESFTT 11,)"EESFTT • #47Ͱ͸14)ͷ6590͕࢖͑ͳ͍ͷͰ࠷௿ֹۚʹ͓ͯ͘͠
  11. ճ໨ͷશֹૹۚ • 01@$)&$,%"5"4*(Ͱ࡞ΒΕͨ6590ΛؚΜͩૹۚΛ͢Δ͜ ͱͰ෼཭Ͱ͖Δ *OQVU 0VUQVU શֹ#$) TBU #$)#47 ͓௼Γ

    14)"EESFTT 11,)"EESFTT 11,)"EESFTT • #47Ͱ࢖͑Δͷ͸ճ໨ͷૹۚͰ͓௼Γͱͯ͠ૹͬͨ෼͚ͩ
  12. 3FEFFN4DSJQUͷߏங • 3FEFFN4DSJQU಺Ͱॺ໊ݕূ͕׬݁͢ΔΑ͏ߏங B u i l d i n

    g R e d e e m S c r i p t <signature> <message> <pubkey> OP_CHECKDATASIGVERIFY R e d e e m S c r i p t • ͜Εͩͱ୭Ͱ΋ղআͯ͠࢖༻͢Δ͜ͱ͕Ͱ͖ͯ͠·͏ͷͰɺ 3FEFFN4DSJQUʹࣗ෼ͷެ։伴Λ૊ΈࠐΉ
  13. • 11,)Λ3FEFFN4DSJQUʹ૊ΈࠐΉ <signature> <message> <pubkey> OP_CHECKDATASIGVERIFY OP_DUP OP_HASH160 <20-bytes-pubkey-hash> OP_EQUALVERIFY

    OP_CHECKSIG R e d e e m S c r i p t 3FEFFN4DSJQUͷߏங B u i l d i n g R e d e e m S c r i p t
  14. 3FEFFN4DSJQUͷղআ • 3FEFFN4DSJQUͷαΠζ͕#ZUFTΛ௒͑ΔͷͰ 01@164)%"5"Λ࢖͏ L o c k i n

    g S c r i p t OP_HASH160 <20-bytes-redeem-script—hash> OP_EQUAL U n l o c k i n g S c r i p t <signature> <pubkey> OP_PUSHDATA1 redeem-script