Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
HTLC入門
Search
Shu Kobuchi
August 26, 2018
2
640
HTLC入門
2018年8月26日にHashHubで行われた今井崇也博士主催「オフチェーンアカデミーハックデーβ」でHTLC(Hashed TimeLock Contract)入門のLTをさせていただきました。
Shu Kobuchi
August 26, 2018
Tweet
Share
More Decks by Shu Kobuchi
See All by Shu Kobuchi
生成AI入門
shukob
0
230
LangChainでWebサイトの内容取得やGitHubソースコード取得
shukob
0
450
生成AIアプリケーションにおけるRAGとデータベースの役割
shukob
0
1.2k
ビットコイン・ブロックチェーン入門
shukob
0
240
生成AI入門
shukob
2
1.1k
Mastering Bitcoin Third Editionの紹介
shukob
0
260
NFT技術概論
shukob
0
410
やさしいERC20開発
shukob
0
230
ビットコイン・ブロックチェーン入門
shukob
0
270
Featured
See All Featured
Unsuck your backbone
ammeep
668
57k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Being A Developer After 40
akosma
86
590k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Embracing the Ebb and Flow
colly
84
4.5k
Faster Mobile Websites
deanohume
305
30k
The Invisible Side of Design
smashingmag
298
50k
A Philosophy of Restraint
colly
203
16k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Transcript
HTLCೖ 2018/8/26 ΦϑνΣʔϯΞΧσϛʔϋοΫσʔβ খᔹ प Shu Kobuchi
ࣗݾհ খᔹपɹ4IV,PCVDIJɹ!TIV@LPCTIVLPCVDIJ χοΫωʔϜɿ͜Ϳγϡʔ ϒϩοΫஉɹIUUQTXXXZPVUVCFDPNXBUDI WBU$*2B8*6: ϛεϏοτίΠϯ ౻ຊਅҥࢯͷΠϯλϏϡʔهࣄ IUUQTHPPHMKNRL !2 ◾03"/(&#&".
ɹɹখᔹ͕.BJOOFUͰཱ͍ͯͯΔ ɹɹɹDMJHIUOJOHϊʔυ ◾גࣜձࣾΩϡʔϒγεςϜ ɹɹܦӦઓུຊ෦ٕज़ઓུࣨ ɹɹɹ*5εϖγϟϦετ
ίϛϡχςΟհ ҉߸௨՟ಡॻձษڧձɹIUUQTDSZQUPDVSSFODZDPOOQBTTDPN 04$౦ژʹʮຊ҉߸௨՟Ϣʔβձʯͱͯ͠ग़ల ॳ৺ऀʙதڃऀ͚ͷʮϏοτίΠϯͱ͔ษڧձʯʢ݄̍ճʣ தڃऀʙ্ڃऀ͚ͷʮ҉߸௨՟ྠಡձʯʢ݄̍ճʣ DSBTIBDBEFNZ *5ܥಈը৴ ʹͯϏοτίΠϯͱ͔ษڧձͷΞʔΧΠϒ৴த ɹIUUQTDSBTIBDBEFNZMFDUVSFSDSZQUPDVSSFODZ ϩάϛʔ5FDIʢςοΫʣ
ษڧձॻ͖ى͜͠ ͱͷఏܞDSBTIBDBEFNZΛհͯ͠։ ࢝༧ఆ IUUQTMPHNJKQUFDI ຊ҉߸௨՟Ϣʔβձ ౦ژࢧ෦ 04$౦ژͷग़ల ࣍ճ݄ !3
)5-$ೖ
)BTIFE5JNF-PDL$POUSBDU தؒऀΛܦ༝͢ΔϚϧνϗοϓૹۚΛ࣮ݱ νϟωϧͷ։ઃ૬ख͕૿͑ΔͱɺPGϚϧνγάѼʹ͢ΔσϙδοτͰ ϩοΫ͞ΕΔ#JUDPJO͕૿͑Δ νϟωϧະ։ઃͷ૬खͱνϟωϧ։ઃࡁΈͷୈࡾऀΛܦ༝ܾͯ͠ࡁ !5 σϙδοτͷ #JUDPJO͕ଟ͍
σϙδοτͷ #JUDPJOΛ͑ΒΕΔ
தؒऀΛ৴༻ͤͣͱૹۚͰ͖ΔΈ͕ඞཁ "MJDF$BSPMͱνϟωϧΛష͍ͬͯͳ͍͕ɺ#PCΛ௨ͯ͠ૹ͕ۚͰ͖ͦ͏ "MJDF͕#PCʹ$BSPM#5$ૹۚ͢ΔΑ͏ʹݴͬͯɺ#PC͕౪ΉՄೳੑ ൱ఆͰ͖ͳ͍ #PC͕৴༻Ͱ͖ͳͯ͘ૹۚͰ͖ΔΈ͕ඞཁ !6 "MJDF #PC $BSPM
ৄ͘͠%SZKBࢯͷࢿྉΛ 5IBEEFVT%SZKB -JHIUOJOH/FUXPSL8IJUFQBQFSஶऀͷҰਓʣ IUUQTCDKQBSDIJWFTFBTPONBUFSJBMT @-JHIUOJOH@/FUXPSLQEG !7
)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
தؒऀ͔Βݟͯ࢝ɾऴͷ৴པ͕ͳͯ͑͘ΔΑ͏ʹ #JUDPJOͱ4FDSFU3ͷަ͚ͩͰෆे !9 ҆ໜږࢯϒϩάʮ%FWFMPQNFOUXJUIQMFBTVSFʯΑΓ IUUQTUFDINFEJBUIJOLIBUFOBCMPHDPNFOUSZ
)5-$#*1ͰൃҊ #JUDPJO*NQSPWFNFOU1SPSPTBMʢϏοτίΠϯվળఏҊʣ #*1Ͱ)5-$͕ൃҊ͞Εͨ IUUQTHJUIVCDPNCJUDPJOCJQTCMPCNBTUFSCJQNFEJBXJLJ !10
)5-$ΤεΫϩʔత -JHIUOJOH/FUXPSL͚ͩͰͳ͘ɺΦϯνΣʔϯʗΦϑνΣʔϯΘͣΤεΫϩʔ औҾʹԠ༻Ͱ͖Δ෯͑͘Δߟ͑ํ &UIFSFVN4NBSU$POUSBDUͰ)5-$Λ͑ͦ͏ #5$⁶&5)ͷΑ͏ͳҟछνΣʔϯؒऔҾͰ͋Δ"UPNJD4XBQʢΞτϛοΫ εϫοϓʣʹ)5-$͕ΘΕ͍ͯΔ IUUQT[PPNCMDDPNBUPNJDTXBQ -JHIUOJOH/FUXPSLͷνϟωϧؒʢ"MJDF⁶#PCͷνϟωϧͱ#PC⁶$BSPMͷ νϟωϧʣऔҾ"UPNJD4XBQͰ͋Δ IUUQTUFDINFEJBUIJOLIBUFOBCMPHDPNFOUSZ
!11
-JHIUOJOH/FUXPSLΛֶͿ্ͰಡΜͰ͓͖͍ͨॻ੶ ࢁ࡚ॏҰɾ҆ໜږɾాதढ़ଠஶ ʰϒϩοΫνΣʔϯɾϓϩά ϥϛϯάԾ௨՟ೖʱߨஊࣾ !12
ࢀߟࢿྉɹ-JHIUOJOH/FUXPSL࣮༻ࣄྫ
-JHIUOJOH/FUXPSLΛ5FTUOFUͰମݧ 4UBS#MPDLT IUUQTTUBSCMPDLTBDJORDP ◾ձܭ23ίʔυಡΈऔΓ ɹɹεϚϗͰಡΈऔܾͬͯࡁ ɹɹΦϯνΣʔϯͱผن֨ͷૹۚํ๏
8PP$PNNFSDFͷԾ௨՟ܾࡁ #JUDPJO&UIFSFVNΛ͡Ίͱ͢Δ༷ʑͳԾ௨՟ܾࡁʹରԠ ◾#JUDPJOͱ"MUDPJO ѥछ ɹɹ#JUDPJO #JUDPJO$BTI -JUFDPJO %BTI ͳͲ
IUUQTKBXPSEQSFTTPSHQMVHJOTHPVSM XPPDPNNFSDFCJUDPJOBMUDPJOQBZNFOUHBUFXBZ BEEPO ◾&UIFSFVN ɹɹ&UIFSFVN &3$UPLFOT &UIFSFVN্Ͱൃߦ͞Ε ɹɹɹͨ&3$ͱ͍͏ن֨ͷτʔΫϯ IUUQTXXXXQCMPHDPNDSZQUPDVSSFODJFT XPSEQSFTTBOEXPPDPNNFSDFXFCTJUFT
Ծ௨՟ܾࡁͰ࠷৽Λߦ͘8PP$PNNFSDF #JUDPJOͷઌਐٕज़-JHIUOJOH/FUXPSLͷܾࡁʹରԠ ◾8PP$PNNFSDF(BUFXBZ-JHIUOJOH ɹɹੈքతͳ#JUDPJOελʔτΞοϓ #MPDLTUSFBN͕ࣾ8PPDPNNFSDFͱซ༻ ɹɹɹ͢Δ(BUFXBZΛΦʔϓϯιʔεͰఏڙ IUUQTHJUIVCDPN&MFNFOUT1SPKFDUXPPDPNNFSDFHBUFXBZMJHIUOJOH
-JHIUOJOH/FUXPSLͷ࣮ళฮܾࡁ ݄ ຊͰॳΊͯͷ-JHIUOJOH/FUXPSL࣮ళฮܾࡁ͕ߦΘΕ ͨ !17 ϕϧΪʔϏʔϧμΠχϯάαϯλϧψʔ ҉߸௨՟ܾࡁͷ *$0 *OJUJBM$PJO0⒎FSJOH
Ͱ໊ݹ ɹ͔Β౦ژࡔʹҠస ܸࣗऀͱͳΓɺ5XJUUFSͰେ͖ͳ ڹ ຊͰ-JHIUOJOH/FUXPSL͕େ͖ͳ ɹҰาΛ౿Έग़ͨ͠ IUUQTUXJUUFSDPNTIV@LPCTUBUVT
ࢀߟࢿྉɹDMJHIUOJOHΛ"84Ͱߏங
"84Ͱ-JHIUOJOH/FUXPSLϊʔυΛߏங &$Λར༻ ◾ΠϯελϯελΠϓ ɹɹUTNBMM UNJDSPͩͱ ɹɹɹϏϧυ࣌ʹ ɹɹɹϝϞϦෆ ◾ετϨʔδαΠζ ɹɹϑϧϊʔυͳΒ
ɹɹ5FTUOFUͳΒ(# ɹɹ.BJOFUͳΒ(# ◾".* ɹɹ6CVOUV ϒϩοΫνΣʔϯ ɹɹɹͰΑ͘ར༻͞ΕΔ
#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
։͚Δϙʔτ ηΩϡϦςΟάϧʔϓΠϯόϯυ Ͱઃఆ ◾.BJOOFUͷ߹ ɹɹ ◾5FTUOFUͷ߹ ɹɹ ◾MJHIUOJOH
.BJOOFU 5FTUOFUڞ௨ ɹɹ
"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" }
-JHIUOJOH/FUXPSL&YQMPSFS -JHIUOJOH/FUXPSLνϟωϧΛՄࢹԽͨ͠αΠτ 5FTUOFU IUUQTFYQMPSFSBDJORDP
-JHIUOJOH/FUXPSL&YQMPSFS -JHIUOJOH/FUXPSLνϟωϧΛՄࢹԽͨ͠αΠτ .BJOOFU IUUQTMONBJOOFUHBCFOXJO ◾03"/(&#&". ɹɹখᔹ͕.BJOOFUͰཱ͍ͯͯΔϊʔυ ◾5FTUOFUΛ͑Δن ɹɹϊʔυɺνϟωϧͱʹ.BJOOFUͷํ͕ଟ
#JUDPJOΛࢧ͑Δ"84 #JUDPJOϊʔυΛՔಇͤ͞Δͷʹ"84͔ͳΓΘΕ͍ͯΔ ੈքͷϊʔυ&YQMPSFS IUUQTCJUOPEFTFBSODPNOPEFT R+BQBO
#JUDPJOΛࢧ͑Δ"84 #JUDPJOϊʔυΛՔಇͤ͞Δͷʹ"84͔ͳΓΘΕ͍ͯΔ ੈքͷϊʔυ&YQMPSFS IUUQTCJUOPEFTFBSODPNOPEFT R+BQBO