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

ライトニングネットワーク 初心者向け説明@株式会社ミクシィ様

 ライトニングネットワーク 初心者向け説明@株式会社ミクシィ様

ライトニングネットワーク 初心者向け説明@株式会社ミクシィ様
CreativeBlockchain Community~ MeetUp Vol.3

693bebf0f9f34ee94dd2c873a6888418?s=128

Takaya Imai

March 22, 2018
Tweet

Transcript

  1. 2nd-layerٕज़ʢϥΠτχϯάωοτϫʔΫʣ ॳ৺ऀ޲͚આ໌ˍεϚϗΛར༻ͨ͠ϋϯζΦϯମݧ 5BLBZB*NBJ $&0!'SPOUJFS1BSUOFST--$ $PGPVOEFSBOE$50!6OJUFE#JUDPJOFST*OD $SFBUJWF#MPDLDIBJO$PNNVOJUZd.FFU6Q7PM OEMBZFSٕज़ʢϥΠτχϯάωοτϫʔΫʣฤ !גࣜձࣾϛΫγΟ 

  2. ࣗݾ঺հ ϑϩϯςΟΞύʔτφʔζ߹ಉձࣾ ୅දCEO United Bitcoiners Inc. ڞಉ૑ۀऀˍऔక໾CTO ϚελϦϯάϏοτίΠϯɺ຋༁ऀ୅ද ੈքͰॳΊͯͷɺ೔ຊޠʹΑΔϏοτίΠϯɾϒϩοΫ νΣʔϯͷৄࡉٕज़ॻ(NTTग़൛ࣾ)

    2016/7/14ग़൛ ిࢠॻ੶൛(kindle)΋ ΦʔϓϯΤσΟγϣϯ൛ https://www.bitcoinbook.info
  3. ࣗݾ঺հ όοΫάϥ΢ϯυ ৽ׁେֶେֶӃɹૉཻࢠཧ࿦෺ཧɹത࢜(ཧ) ΧΧΫίϜ ݕࡧΤϯδϯ։ൃɹݕࡧαʔόΫϥελߏஙӡ༻ɹେن໛σʔλॲཧɹػցֶशɹ ը૾ೝࣝ σʔλλϫʔגࣜձࣾɹ୅දऔక໾

  4. ϥΠτχϯάωοτϫʔΫʁ

  5. ϥΠτχϯάωοτϫʔΫʁ 2015೥2݄ʹJoseph PoonͱThaddeus DryjaʹΑͬͯఏҊ͞ ΕͨϏοτίΠϯ্ͷηΧϯυϨΠϠʔٕज़ औҾख਺ྉΛ҆͘͢Δ͜ͱͱૹۚ଎౓Λ଎͘͢Δ͜ͱΛ໨ తͱ͍ͯ͠Δ “νϟωϧ”ͱ͍͏̎ऀؒૹۚܦ࿏ʹΑΔP̎PωοτϫʔΫ Ͱ͋Γɺෳ਺ͷνϟωϧΛܦ༝ͯ͠ૹۚ͢Δ νϟωϧऔҾ૬खɺૹۚ஥հऀΛ৴༻͢Δඞཁ͕ͳ͍

  6. ϏοτίΠϯͷ εέʔϦϯά໰୊ εέʔϦϯά໰୊ ඵؒऔҾ਺͕̓݅ఔ౓ 1MB / 256byte /10෼/60ඵ = 6.8औҾຖඵ

    Segwit (Segregated Witness)༗ޮԽޙɺ̍ϒϩοΫʹ̍MBΑΓೖΔΑ͏ʹͳͬͨͨΊɺඵؒऔҾ਺ ͸લΑΓվળ ϒϩοΫνΣʔϯαΠζͷ૿େ ̍̒̌GBऑ (2018/3/7ݱࡏ) τϥϯβΫγϣϯख਺ྉͷߴಅ ૹ෇͞ΕΔτϥϯβΫγϣϯͷ਺͕૿͑ΔͱɺϚΠφʔ͸ΑΓख਺ྉͷߴ͍τϥϯβΫγϣϯ͔Β ϒϩοΫʹऔΓࠐ΋͏ͱ͢Δ ࠷ۙ͸̍ճͷૹۚ͋ͨΓ5ԁऑ(1satoshi/byte) 2017೥12݄͸ϐʔΫͰ̍ճͷૹۚ͋ͨΓ4000ԁఔ౓ͷͱ͖΋͋ͬͨ
  7. None
  8. 160GB

  9. 4.6tx/sec

  10. 4000ԁ͘Β͍/tx

  11. ͍Ζ͍Ζͳղܾࡦ ΦϯνΣʔϯεέʔϦϯά औҾຖʹϒϩοΫνΣʔϯʹॻ͖ࠐΉ͜ͱΛલఏͱͯ͠ɺॲཧೳ ྗͷ૿ڧΛ͢ΔεέʔϦϯάํ๏ ΦϑνΣʔϯεέʔϦϯά ϒϩοΫνΣʔϯʹॻ͖ࠐΉճ਺ΛݮΒ͢͜ͱͰɺॲཧೳྗͷ ૿ڧΛ͢ΔεέʔϦϯάํ๏ ϒϩοΫνΣʔϯͷར఺Λ׆༻ͭͭ͠ɺϒϩοΫνΣʔϯͱ͸૬ ޓ࡞༻Λසൟʹ͠ͳ͍ॲཧ૚Λઃ͚ͯૹۚॲཧΛ࣮ߦ͢Δ

  12. ͍Ζ͍Ζͳղܾࡦ ΦϯνΣʔϯଆ ผͷϒϩοΫνΣʔϯʹॲཧΛԡ͠΍Δ αΠυνΣʔϯ/υϥΠϒνΣʔϯ τϥϯβΫγϣϯͷσʔλͷҰ෦Λผ࿮ʹԡ͠΍Δ SegWit (Segregated Witness) ϒϩοΫαΠζΛେ͖͘͢Δ ϏοάϒϩοΫ

    ϒϩοΫͷ఻ୡํ๏ͷվળɺGraphen τϥϯβΫγϣϯͷαΠζΛখ͘͢͞Δ γϡϊΞॺ໊(Schnorr Signature) ࢖Θͳ͍τϥϯβΫγϣϯεΫϦϓτΛল͘ɺ Graftroot ΦϑνΣʔϯଆ ϥΠτχϯάωοτϫʔΫ Ethereum(ϥΠσϯωοτϫʔΫɺϚΠΫϩϥΠσϯ ωοτϫʔΫ)
  13. #MPDLDIBJO DPOOFDUFEUP #JUDPJO ;DBTI #MPDLDIBJO &UIFSFVN #MPDLDIBJO #JUDPJO #MPDLDIBJO ʜ

    -JHIUOJOH/FUXPSL "UPNJD 4XBQ 1BZQBM 7JTB $PTNPT #MPDLDIBJO DPOOFDUFEUP TPNF CMPDLDIBJOT 3BJEFO/FUXPSL ΦϯνΣʔϯଆ ΦϑνΣʔϯଆ 4JEFDIBJO ϒϩοΫνΣʔϯ֎ ֤ٕज़ͷؔ࿈Πϝʔδ *OUFSMFEHFS
  14. ϥΠτχϯάωοτϫʔΫʁ ಛ௃Λ̍ͭ̍ͭઆ໌͠·͢ɻ

  15. ϥΠτχϯάωοτϫʔΫʁ جຊతͳΞΠσΞ̍ ຖճऔҾΛϒϩοΫνΣʔϯʹॻ͖ࠐΉͷͰ͸ͳ͘ɺ֤औҾͷ݁Ռͱͯ͠ਖ਼ຯͷ͓ۚΛ࠷ޙ ʹૹΔ ྫ 1. A͞Μ͕B͞Μʹ1000ԁିͨ͠ 2. B͞Μ͕A͞Μʹ500ԁ෼͝൧୅Λग़ͨ͠ 3.

    ݁ہɺB͞Μ͸A͞Μʹ500ԁฦͨ͠ ͜ΕΛͰ͖ΔΑ͏ʹ͢ΔೋऀʹΑΔ࠷খߏ੒୯ҐΛνϟωϧͱ͍͏ɻ νϟωϧ͸HTLC(Hashed Time Lock Contractɺϋογϡ෇੍͖࣌ؒݶίϯτϥΫτ)Λ࢖ͬͯ ࡞Δ ࠷ऴঢ়ଶΛϒϩοΫνΣʔϯʹॻ͖ࠐΉ·Ͱ͸ɺ྆ऀͷ߹ҙͷ্Ͱঢ়ଶͷߋ৽Λ͢Δ
  16. ϥΠτχϯάωοτϫʔΫʁ جຊతͳΞΠσΞ̍ νϟωϧΛ࡞ͬͨยํͷਓ͕ѱਓͰɺࣗ෼ͷૹۚΛͳ͔ͬͨ͜ͱʹ͍͕ͨͨ͠Ίʹɺ࠷ऴ ঢ়ଶͰ͸ͳ͍΋ͷΛҰํతʹϒϩοΫνΣʔϯʹॻ͖ࠐΜͩΒͲ͏͢Δͷʁ ࠷ऴঢ়ଶͰ͸ͳ͍τϥϯβΫγϣϯʹ͸ɺѱਓଆʹର͢Δࢿۚ࢖༻੍࣌ؒݶ͕͔͔ͬ ͍ͯ·͢ɻ ରͯ͠ɺળਓଆ͸ѱਓଆ͔Β΋ΒͬͨγʔΫϨοτΩʔΛ࠷ऴঢ়ଶͰ͸ͳ͍τϥϯβ Ϋγϣϯʹରͯ͠࢖͏ͱɺνϟωϧ্ʹ͋ͬͨѱਓͷࢿۚΛ௚ͪʹશͯୣ͑ΔΑ͏ʹ ͳ͍ͬͯ·͢ɻ γʔΫϨοτΩʔ͸࠷ऴঢ়ଶʹ྆ऀ͕߹ҙ͢Δࡍʹɺ྆ऀ͕औΓަΘ̍͢ݸલͷ

    ΋ͷΛແޮԽ͢ΔͨΊͷΩʔ ͜ͷΑ͏ͳϖφϧςΟʔ͕͋ΔͨΊɺѱਓଆʹ͸૬खΛཪ੾ΔΠϯηϯςΟϒ͕ͳ͍ ѱਓଆͷཪ੾Γʹର͙ͯ͢͠ʹϖφϧςΟʔΛߦ࢖Ͱ͖ΔΑ͏ʹɺτϥϯβΫγϣϯΛৗ ʹ؂ࢹ͓͔ͯ͠ͳ͚Ε͹͍͚ͳ͍
  17. ϥΠτχϯάωοτϫʔΫʁ جຊతͳΞΠσΞ̎ ϒϩοΫνΣʔϯ΁ͷෛՙΛԼ͛ɺख਺ྉΛ҆͘͢ΔͨΊɺνϟωϧΛෳ਺ ͭͳ͍Ͱૹۚ͢Δ

  18. ϥΠτχϯάωοτϫʔΫʁ ஥հऀ͕͓ۚΛ౪ΊΔͷͰ͸ʁ ஥հऀBob͕͓ۚΛಘΔͨΊʹ͸ϓϨΠϝʔδͱݺ͹ΕΔจࣈྻ͕ͳ͍ͱ͍͚ ͳ͍ Bob͸͓ۚΛ஥հ͢Δͱ͍͏໿ଋ͸͢Δ͕ɺ໿ଋͨ࣌͠఺Ͱ͸ϓϨΠϝʔδΛ ϋογϡԽͨ͠ϓϨΠϝʔδϋογϡ͔࣋ͬͯ͠ͳ͍ͨΊɺ͓ۚΛ౪Ίͳ͍ ͜ΕΛ࣮ߦ͢ΔͨΊʹHTLCΛ࢖͏ ૹۚऀ डۚऀ "MJDF

    #PC $BSPM
  19. ϥΠτχϯάωοτϫʔΫʁ ૹۚऀ डۚऀ "MJDF #PC $BSPM $BSPMϓϨΠϝʔδ 3 $BSPMϓϨΠϝʔδϋογϡ )

  20. ϥΠτχϯάωοτϫʔΫʁ ૹۚऀ डۚऀ "MJDF #PC $BSPM $BSPM ϓϨΠϝʔδϋογϡ ) ᶃϓϨΠϝʔδϋογϡ)ૹ෇

    UYXJUI) OFFE3 UPVTF UYXJUI) OFFE3 UPVTF ᶄ59XJUI)ૹ෇ UYXJUI) OFFE3 UPVTF ᶅ59XJUI)ૹ෇ ᶆϓϨΠϝʔδ3ૹ෇ 3 ᶇϓϨΠϝʔδ3ૹ෇ 3 $BSPM ϓϨΠϝʔδ 3 ໿ଋ͸͢Δ͚Ͳ౪Ίͳ͍ Carol͸ R͕͋Δ͔Β ड͚औΕΔ
  21. ϥΠτχϯάωοτϫʔΫʁ ϊʔυ ϊʔυ ϊʔυ*% ϊʔυ νϟωϧ ϊʔυ νϟωϧ νϟωϧ νϟωϧ

    ϊʔυ ϊʔυ*% ϊʔυ*% ϊʔυ*% ϊʔυ νϟωϧ ϊʔυ*% νϟωϧ ϊʔυ ϊʔυ*% ͷେ͖͞͸νϟωϧʹ৐͍ͬͯΔϏοτίΠϯͷྔ
  22. ϥΠτχϯάωοτϫʔΫ ϊʔυϓϩδΣΫτҰཡ $PNQBOZ 0SHBOJ[BUJPO -JHIUOJOH -BCT .*5%$* #MPDLTUSFBN "$*/2 CDPJOPSH

    /BZVUB OPUIJOH 1SPEVDU /BNF MOE MJU MJHIUOJOHE FDMBJS QMBTNB QUBSNJHBO MOXBMMFU $PNNJUPST 5IBEEFVT %SZKB  +PTFQI 1PPO  0MBPMVXB 0TVOUPLVO 5IBEEFVT %SZKB 3VTUZ3VTTFM  $ISJTUJBO %FDLFS 1JFSSF.BSJF 1BEJPV  'BCSJDF %SPVJO  EQBE $ISJTUPQIFS +F⒎SFZ OBZVUBVFOP "OUPO ,VNBJHPSPET LJ -BOHVBHF (P (P $ 4DBMB /PEFKT $ 4DBMB pSTUDPNNJU +45        MBTUFTU DPNNJU +45        HJUIVC IUUQT HJUIVCDPN MJHIUOJOHOFU XPSLMOE IUUQT HJUIVCDPN NJUEDJMJU IUUQT HJUIVCDPN &MFNFOUT1SPK FDUMJHIUOJOH IUUQT HJUIVCDPN "$*/2FDMBJS IUUQT HJUIVCDPN CDPJOPSH QMBTNB IUUQT HJUIVCDPN OBZVUBDP QUBSNJHBO IUUQT HJUIVCDPN CUDPOUSBDU MOXBMMFU PUIFST BOESPJEBQQ
  23. ςετωοτ ࢲͷϊʔυ: btctest.lnetwork.tokyo (160.16.233.215)

  24. ϝΠϯωοτ ϦΞϧͳ͓͕ۚྲྀΕΔϥΠτχϯάωοτϫʔΫ

  25. ࢲͷϊʔυ: btc.lnetwork.tokyo (153.126.136.98) pubkey: 028dcc199be86786818c8c32bffe9db8855c5fca98951eec99d1fa335d841605c2

  26. ٕज़ৄࡉ ٕज़ৄࡉʹ͍ͭͯ͸ͪ͜ΒΛࢀর͍ͩ͘͞(ӳޠ) 2017೥6݄ʹΠεϥΤϧͷςϧΞϏϒͰࢲ͕࿩ͨ࣌͠ ͷࢿྉ https://www.slideshare.net/takayaimai/lightning- network-in-tel-aviv-israel ࠷৽࣮૷͔Β͸গ͠ဃ཭͕͋Γ·͕͢ɺجຊతͳಈ࡞ ݪཧ͸ಉ͡Ͱ͢ɻ

  27. ஫໨͍ͯ͠Δ ϥΠτχϯάٕज़̍

  28. ஫໨͍ͯ͠Δ ϥΠτχϯάٕज़̍ AMP: Atomic Multi-Path Payments(ΞτϛοΫෳ਺ܦ࿏ࢧ෷͍) ݱঢ় ૹۚऀ͔Βडۚऀ΁ͷૹۚܦ࿏͸̍ͭ ྫ͑͹ɺ100ԁΛૹΓ͍ͨ৔߹ɺૹۚऀ͔Βडۚऀ΁ͷܦ࿏ͷશͯͷνϟωϧ͕100ԁૹۚՄೳͰͳ͍ͱ ͍͚ͳ͍

    ໰୊఺ ·ͱ·͓ͬͨۚΛૹΕͳ͍ ̍ສԁͳͲ͋Δఔ౓·ͱ·͓ͬͨۚ͸ɺϥΠτχϯάωοτϫʔΫΛ࢖Θͳ͍΄͏͕͍͍ͱ͸ࢥ͍ ·͢ νϟωϧʹଟ͘ͷ͓ۚΛஔ͍͓ͯ͘ͷ͸ࢿ͕ۚ๛͔ͳਓ -> தԝूݖԽ 1ͭͷૹۚܦ࿏ʹґଘͯ͠͠·͏ ૹۚܦ࿏্ͷϊʔυ͕ૹۚதʹ൓Ԡ͠ͳ͘ͳΔͳͲ໰୊͕ى͖ͨ৔߹ɺૹ్͕ۚதͰࢭ·ͬͯ͠·ͬ ͯಈ͔ͳ͘ͳΔͱ͍͏͜ͱ͸ͳ͍͕ɺૹۚ׬ྃ·Ͱ͕͔͔࣌ؒͬͯ͠·͏
  29. ஫໨͍ͯ͠Δ ϥΠτχϯάٕज़̍ AMP: Atomic Multi-Path Payments(ΞτϛοΫෳ਺ܦ࿏ࢧ෷͍) ղܾํ๏ ̍ճͷૹۚΛɺෳ਺ͷૹۚܦ࿏ʹ෼ׂͯ͠ૹΔ ྑ͍఺ ૹۚܦ࿏ͷબ୒ࢶ͕΋ͬͱ૿͑ɺϥΠχϯάωοτϫʔΫશମͷϦιʔεΛ͏·͘࢖͑Δ

    νϟωϧʹେ͖ͳ͓ۚΛஔ͍͓͔ͯͳͯ͘΋ɺϥΠτχϯάωοτϫʔΫʹߩݙͰ͖Δ ѱ͍఺ ϥΠτχϯάωοτϫʔΫશମͰͷૹۚॲཧ਺͸૿͑ΔͨΊɺ෼ׂ਺Λେ͖͗͘͢͠ΔͱϥΠτ χϯάωοτϫʔΫ͕๞࿨ͯ͠͠·͏
  30. ஫໨͍ͯ͠Δ ϥΠτχϯάٕज़̍ AMP: Atomic Multi-Path Payments(ΞτϛοΫෳ਺ܦ࿏ࢧ෷͍) ਐల۩߹ ΞτϛοΫੑͷఆٛ΍࠷దͳ࣮૷ํ๏ʹ͍ͭͯɺlightning-devϝʔϦϯάϦετͰٞ࿦த ·ͩϥΠτχϯάωοτϫʔΫRFCʹ͸ͳ͍ͬͯͳ͍ ͜Ε͸ɺݸਓతʹScaling

    Bitcoin Workshop 2017 @ Stanford Univ. ʹఏҊ͍ͯͨ͠΋ͷ(࢒೦ͳ͕ΒτʔΫ ʹ͸࠾༻͞Ε·ͤΜͰ͕ͨ͠ɻɻ) https://github.com/takaya-imai/packetization_for_paymentchannel
  31. ஫໨͍ͯ͠Δ ϥΠτχϯάٕज़̎ εϚϗΞϓϦΛϥΠτχϯάωοτϫʔΫʹ डۚ΋Ͱ͖Δ lnwallet http://lightning-wallet.com

  32. ஫໨͍ͯ͠Δ ϥΠτχϯάٕज़̎ ໘ന͍఺ τϥϯβΫγϣϯͷ؂ࢹόοΫΤϯυ͕࣮૷ͯ͋͠Γɺ؂ࢹͷ෼ࢄҕ೚͕Ͱ͖Δ ୯७ʹ͸ɺεϚϗΞϓϦ͸ϥΠτχϯάωοτϫʔΫʹࢀՃͰ͖·ͤΜ εϚϗͷి஑͕੾ΕΔɺΠϯλʔωοτʹ઀ଓͰ͖ͳ͘ͳΔͳͲͯ͠ɺτϥϯβΫγϣϯͷ؂ࢹ͕ Ͱ͖ͳ͘ͳΔͨΊɻ ૹ͚ۚͩͰ͋Ε͹Ͱ͖·͕͢ɺϥΠτχϯάωοτϫʔΫͷҰ෦ͱͯ͠ૹۚܦ࿏ʹߩݙ͢Δʹ͸ૹ ۚͱडۚͷ྆ํ͕ඞཁ ݱঢ়·ͩ׬શͳ෼ࢄҕ೚Ͱ͸ͳ͍Ͱ͢

    ؂ࢹͷ෼ࢄҕ೚Λड͚ΔଆʹͱͬͯͷΠϯηϯςΟϒ͕͢Ͱʹ࣮૷ͯ͋͠Δ εϚϗ্ͷτϥϯβΫγϣϯσʔλ͕յΕͯ͠·ͬͨ౳ͳ͘ͳͬͯ͠·ͬͨͱ͖ͷͨΊʹɺόοΫΞοϓΛ औ͓ͬͯ͘͜ͱ͕Ͱ͖Δ ͜ΕΒΛߦ͏ͷ͕ɺOlympusαʔόͰ͢ɻ εϚϗΞϓϦϋϯζΦϯΛ΍͍ͬͯΔͷͰɺͦ͜Ͱਐల۩߹͸ެ։͍͖ͯ͠·͢ɻ
  33. ڵຯ͕͋Δํ͸͝ࢀՃ͍ͩ͘͞ɻ

  34. ϏοτίΠϯɾϒϩοΫνΣʔϯεΫʔϧ΍ͬͯ·͢ ͝ڵຯ͋Δํ͸ࢀՃ͍͚ͨͩΕ͹ͱࢥ͍·͢ɻ

  35. د෇͸ҎԼ΁: ͪ͜Β͕ϥΠτχϯάͷࢧ෷͍ʹ࢖͏invoice ϝΠϯωοτͰ1000satoshi(ݱ࣌఺Ͱ10ԁఔ౓) ༗ޮظؒ͸2018/4/22·Ͱ lnbc10u1pdt8qnhpp5uqjcf32 auwseejg0ej54tzqqvpf7g6q2 mxcqewqh3xy7mu97ptssdqq cqzysxq9z3h5qtglaa8zgnng9j nq5xn2qs30te9hyfnm0y4lmr4 ckmde2gg9l90rxh5rn8umzay

    s2px053l6ra7kwgjmjwem4j72 lg35wasxlt3xjamqprz0a2e
  36. fin.