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

HTLC入門

Shu Kobuchi
August 26, 2018
640

 HTLC入門

2018年8月26日にHashHubで行われた今井崇也博士主催「オフチェーンアカデミーハックデーβ」でHTLC(Hashed TimeLock Contract)入門のLTをさせていただきました。

Shu Kobuchi

August 26, 2018
Tweet

Transcript

  1. )5-$ͷ؆қతͳྫ ᶃ4FDSFU3Λ࡞੒͠ɺ4FDSFU)BTI3Λ"MJDFʹ࿈ܞ ᶄ)5-$59"Ͱɺ"MJDF͔Β#PC΁ͷࢧ෷͍Λอূ ᶅ)5-$59#ͱᶆ)5-$59$Ͱ#PC͔Β$BSPM΁ͷૹۚ ᶄ)5-$59"ͱᶇ)5-$59#Ͱ"MJDF͔Β#PC΁ͷૹۚ !8 "MJDF #PC $BSPM 4FDSFU3

    ᶃ)BTI3 ᶄ)5-$59" 4FDSFU3ͱ#PC`T1SJW,FZͰೖखՄ ·ͨ͸ɺ̎िؒܦաޙ"MJDF`T1SJW,FZ ͰೖखՄ ᶅ)5-$59# 4FDSFU3ͱ$BSPM`T1SJW,FZͰೖखՄ ·ͨ͸ɺ̎िؒܦաޙ#PC`T1SJW,FZ ͰೖखՄ ᶆ)5-$59$ 4FDSFU3ͱ$BSPM`T1SJW,FZͰೖख ᶇ)5-$59# 4FDSFU3ͱ#PC`T1SJW,FZͰೖख 4FDSFU3
  2. 8PP$PNNFSDFͷԾ૝௨՟ܾࡁ #JUDPJO΍&UIFSFVNΛ͸͡Ίͱ͢Δ༷ʑͳԾ૝௨՟ܾࡁʹରԠ ◾#JUDPJOͱ"MUDPJO ѥछ 
 ɹɹ—#JUDPJO
 —#JUDPJO$BTI
 —-JUFDPJO
 —%BTI
 ͳͲ

    IUUQTKBXPSEQSFTTPSHQMVHJOTHPVSM XPPDPNNFSDFCJUDPJOBMUDPJOQBZNFOUHBUFXBZ BEEPO ◾&UIFSFVN
 ɹɹ—&UIFSFVN
 —&3$UPLFOT &UIFSFVN্Ͱൃߦ͞Ε
 ɹɹɹͨ&3$ͱ͍͏ن֨ͷτʔΫϯ IUUQTXXXXQCMPHDPNDSZQUPDVSSFODJFT XPSEQSFTTBOEXPPDPNNFSDFXFCTJUFT
  3. -JHIUOJOH/FUXPSLͷ࣮ళฮܾࡁ ೥݄೔ ౔ ೔ຊͰॳΊͯͷ-JHIUOJOH/FUXPSL࣮ళฮܾࡁ͕ߦΘΕ ͨ !17 ϕϧΪʔϏʔϧμΠχϯάαϯλϧψʔ
 —҉߸௨՟ܾࡁͷ੟஍
 —*$0 *OJUJBM$PJO0⒎FSJOH

    Ͱ໊ݹ԰
 ɹ͔Β౦ژ੺ࡔʹҠస ࣗ਎͸໨ܸऀͱͳΓɺ5XJUUFSͰ͸େ͖ͳ ൓ڹ
 —೔ຊͰ-JHIUOJOH/FUXPSL͕େ͖ͳ
 ɹҰาΛ౿Έग़ͨ͠ IUUQTUXJUUFSDPNTIV@LPCTUBUVT
  4. #JUDPJO$PSFͱDMJHIUOJOHΠϯετʔϧ #JUDPJOϊʔυ͸$ ͷϦϑΝϨϯε࣮૷ͷ#JUDPJO$PSF CJUDPJOE ΍+BWB࣮૷ ͷCJUDPJOKɺHP࣮૷ͷCUDEͳͲ͕͋Γɺ-JHIUOJOH/FUXPSLϊʔυ΋$ݴޠ࣮૷ ͷDMJHIUOJOH MJHIUOJOHE ɺHPݴޠ࣮૷ͷMOEͳͲ͕͋Δɻ
 ࠓճ͸ɺ#JUDPJO$PSF

    CJUDPJOE  DMJHIUOJOH MJHIUOJOHE Λ঺հ #JUDPJODPSFͷΠϯετʔϧ VCVOUV  IUUQTRJJUBDPNUPLVPJUFNTFGEGDGDFC -JHIUOJOH/FUXPSLϊʔυΛ্ཱͪ͛Δํ๏ DMJHIUOJOHฤ  IUUQTRJJUBDPNNVUBJUFNTCFDBGFDE
  5. "84Ͱཱͯͨϊʔυ΁ͷνϟωϧͷషΓํ ௨ৗɺ*1WύϒϦοΫ*1Λ༻͍Δ͕ɺ"84౳Ϋϥ΢υͰ͸
 *1WύϒϦοΫ*1Ͱ͸షΕͳ͍ͷͰɺύϒϦοΫ%/4Λར༻ $ lightning-cli connect 03878c29e98b292d75184e04f8732df71b829e1f027abd881f68ba87f94890f8e2 54.64.156.15:9735 { "code"

    : -1, "message" : "Connection establishment: Connection timed out" } vagrant@vagrant:~/lightning$ lightning-cli connect 03878c29e98b292d75184e04f8732df71b829e1f027abd881f68ba87f94890f8e2 ec2-54-64-156-15.ap-nor theast-1.compute.amazonaws.com:9735 { "id": “03878c29e98b292d75184e04f8732df71b829e1f027abd881f68ba87f94890f8e2" } vagrant@vagrant:~/lightning$ lightning-cli fundchannel 03878c29e98b292d75184e04f8732df71b829e1f027abd881f68ba87f94890f8e2 1000000 { “tx": "02000000000101f8fb8fe048fe4dd0d9c2f854777685b4bf8bc68ba18a7e2b6c092a4a26fee2110100000000f fffffff0240420f0000000000220020117ee3b27964d2fec71ec73fa6c3ac4f14f5a23b6d7dd17b0a925c9d421 62c9859bb650300000000160014be090d0aceb6702c948220f84c9cc1a026ce60a302473044022004d5dc06814 fab006d8658c9d4a76669fbab4c3257e6e377e8b44a2502628262022075564b6dd354a3bac745403b0e16fd7b3 ab8f8e303a17acf75165ea92c8a0026012102f530fbd401090d92b1863cf6db3657c323dc482f12a88ff4a5814 7ac0111acf900000000", "txid": "cfd32c38756a5165cba58c01daf2503de7e220c671f41483949ca8be2bb93e8b", "channel_id": “8b3eb92bbea89c948314f471c620e2e73d50f2da018ca5cb65516a75382cd3cf" }