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

The protocol stack of ILP

どら
February 22, 2019

The protocol stack of ILP

ILP の各プロトコルの関連性、責務を明らかにし、全体像を理解して頂くための資料です。

どら

February 22, 2019
Tweet

More Decks by どら

Other Decks in Programming

Transcript

  1. *-1ͷϓϩτίϧελοΫͱͦͷؔ࿈ੑ ࣗݾ঺հ! w 5FDIOPMPHZ%FTJHO%JWJTJPO4FOJPS&OHJOFFS w ιϑτ΢ΣΞΤϯδχΞ w খ͞ͳϕϯνϟʔˠौ୩ͷ*5ܥاۀˠ+BQBO%JHJUBM%FTJHO w ҰݴͰݴ͏ͱԿͰ΋԰͞Μɻاըɺઃܭɺ࣮૷ɺςετɺϦϦʔεɺӡ༻

    w αʔόʔαΠυɺΫϥΠΞϯταΠυͳͲͷܦݧ͋Γ w ۀ຿ܥ΍εϚϗήʔϜͷαʔόʔαΠυʢ+BWB1FSM.Z42-౳ʣ w εϚϗήʔϜͷΫϥΠΞϯταΠυʢ6OJUZ$ʣ w *-1͸Ұࡢ೥͘Β͍͔Βڵຯ͕͋ͬͯௐ΂ͨΓ͍ͯ͠Δ w 8$ͷ*OUFSMFEHFS$PNNVOJUZ(SPVQʹࢀՃ w 3'$ʹҰ෦ίϯτϦϏϡʔτ w ձࣾͰ͸ϒϩοΫνΣʔϯܥͷϓϩδΣΫτʹࢀՃ  
  2. *-1ͷϓϩτίϧελοΫͱͦͷؔ࿈ੑ "͞Μ͕ίωΫλʹࢧ෷͏ɺίωΫλ͸#͞Μʹࢧ෷͏ ࣮ࡍ͸"͞Μ͸໘౗ͳࣄΛߟ͑ͳͯ͘΋#͞ΜʹՁ஋Λಧ͚ΒΕΔ ࠷ۙ͸ίωΫλͷࣄΛʮϊʔυʯͱݺͿ͜ͱ΋ ۩ମతʹ͸ʜ ྆ํʹޱ࠲ͷ͋ΔʮίωΫλʯ͕खॿ͚   *-1ͱ͸ҰମԿͳͷ͔ʁ Ledger

    1 Account A Ledger 2 Account B Connector BTC/ԁ Bitcoin Ϩδϟʔ<#5$> ۜߦϨδϟʔ<ԁ> Account C1 Account C1 1BTC ૬౰ 0.9BTC ૬౰ A ͞ΜˠίωΫλ ίωΫλˠ#͞Μ ͜͜Ͱ͸ख਺ྉ͕ͱͳ͍ͬͯ·͕͢ɺ ͋͘·ͰྫͰ͋Γ΋ͬͱখ͘͞ͳΔ૝ఆͰ͢
  3. *-1ͷϓϩτίϧελοΫͱͦͷؔ࿈ੑ ίωΫλ͸૬ޓʹ઀ଓ͞Ε͓ͯΓɺ΢Σϒͷ༷ʹͳ͍ͬͯΔ ௚઀઀ଓ͞Ε͍ͯͳ͍ਓʹ΋Ձ஋Λಧ͚Δࣄ͕Ͱ͖Δ ͞Βʹʜ ඞཁʹԠͯ͡ෳ਺ͷίωΫλͰ࿈ଓతʹߦ͍ Ձ஋Λϗοϓ͍ͤͯ͘͞   *-1ͱ͸ҰମԿͳͷ͔ʁ Ledger

    1 Account A Ledger 3 Account B Ledger 2 Account C2 Connector 1 BTC/XRP Connector 2 XRP/A-Bank A͞Μ g.crypto.btc.abc B ͞Μ g.jp.banks.a-bank.efg Bitcoin Ϩδϟʔ<#5$> ۜߦ̖Ϩδϟʔ<=> 931Ϩδϟʔ<931> Connector 3 Connector 4 Account C1 Account C1 Account C2
  4. *-1ͷϓϩτίϧελοΫͱͦͷؔ࿈ੑ *-1ͱ͸ҰମԿͳͷ͔ʁ   ୆ாʹΑΒͣՁ஋ΛΠϯλʔωοτ্Ͱ ૬खʹಧ͚Δࣄ͕Ͱ͖Δɻ ͜ΕΛՁ஋ͷΠϯλʔωοτɺ *OUFSOFUPG7BMVFͱݺΜͰ͍Δɻ VALUE VALUE

    VALUE ࠃࡍతͳਤΛग़͢ͱ਎ۙʹײ͡ΒΕͳ͍͔΋͠Εͳ͍͕ɺࠃ಺Ͱ͋ͬͯ΋૬ख ͷ࢖͍ͬͯΔ୆ா͕ҧ͏ͱ͍͏͜ͱ͸Α͋͘Δ͠ɺΠϯλʔωοτ্Ͱࠃ֎ͷ αʔϏεΛڗड͢Δͱ͍͏ࣄ͸ී௨ʹ͋Δɻ
  5. *-1ͷϓϩτίϧελοΫͱͦͷؔ࿈ੑ " ૹ৴ऀ͸ϊʔυʢίωΫλʣͱ#51ͷίωΫγϣϯΛ8FC4PDLFU্ʹ։͘ w *-1ύέοτΛྡͷϊʔυʹసૹ͢Δ # ૹ৴ऀ͸ϨδϟʔͱϨδϟʔઐ༻ͷ"1*ίωΫγϣϯΛ։͘ w Ϩδϟʔ͝ͱʹητϧϝϯτΛߦ͏ $

    ૹ৴ऀ͸ड৴ऀͱ4141ͷίωΫγϣϯΛ)5514Ͱ։͘ w ҉߸ԽͷͨΊͷڞ௨ݤΛసૹͨ͠Γɺࢧ෷ઌͷ*-1ΞυϨεͳͲΛసૹ͢Δ   *-1ͷશମ૾ͱ੹຿ ϙΠϯτ ίωΫγϣϯ͸େ͖̏ͭ͘ଘࡏ͢Δ Receiver Sender Node A Ledger A Node C Ledger B SPSP Server Node B Application (C) SPSP over HTTPS (B) Ledger specific connection (A) BTP over WebSocket
  6. *-1ͷϓϩτίϧελοΫͱͦͷؔ࿈ੑ   *-1ͷશମ૾ͱ੹຿ Sender Node A: g.node-a (13) Routing

    Table Module Routing Table Account for Ledger B (11) Account Module (12) Bilateral Ledger IP layer connection (e.g. WebSocket) Interaction between programs Explanation of something Node B: g.node-a.child-b Routing Table Module Routing Table Account for Ledger B Account Module Bilateral Ledger (A) BTP over WebSocket (C) SPSP over HTTPS The identifier of nodes (g.xxx) is (3) ILP address Packet Data Structure BTP Packet ILP Packet (7) DCP Packet BTP Packet ILP Packet (8) RBP Packet The details (order, value type, length) are defined as (9) ASN.1. The ASN.1 structure is encoded in binary by (10) Canonical OER rule. (1) BTP Packet (2) ILP Packet (4) STREAM Packet (5) Application Packet Application Account for Ledger A Account Module Bilateral Ledger (4) STREAM Packet (14) Configuration Module (7) DCP Packet (6) SPSP information (8) RBP Packet Ledger B Account for Node A Account for Node B Payment Channel for Node A and B (B) Ledger specific connection (to receiver SPSP server) (1) BTP Packet (to Node C) (to Ledger A) ઌ΄Ͳͷશମ૾Λ֦େ͢Δͱ͜͏ͳΔ ͳΜ͚ͩͲɺશ෦આ໌͢Δͷ͸ݫ͍͠
 Ұ൪େࣄͳʢͩͱࢥ͏ʣ#51ʹϑΥʔΧε
  7. *-1ͷϓϩτίϧελοΫͱͦͷؔ࿈ੑ #51͸ྡͷϊʔυʹϖΠϝϯτ΍ητϧϝϯτͷ৘ใΛૹΔͨΊͷ΋ͷ #51ͷύέοτ͸಺෦ʹ*-1ύέοτΛ಺แ͍ͯ͠Δ
 *-1ύέοτ͸಺෦ʹ453&". %$1 3#1ͷύέοτΛ಺แ͍ͯ͠Δ ύέοτͷߏ଄͸"4/Ͱఆٛ͞Ε͓ͯΓɺ$BOPOJDBM0&3ͰΤϯίʔσΟϯά͞ΕΔ ϙΠϯτύέοτͷߏ଄͸͜͏ͩ  

    *-1ͷશମ૾ͱ੹຿ Packet Data Structure BTP Packet ILP Packet (7) DCP Packet BTP Packet ILP Packet (8) RBP Packet The details (order, value type, length) are defined as (9) ASN.1. The ASN.1 structure is encoded in binary by (10) Canonical OER rule. (1) BTP Packet (2) ILP Packet (4) STREAM Packet (5) Application Packet w 453&".ͷ੹຿ w *-1ύέοτ͸ඇৗʹখ͞ͳ୯ҐͷՁ஋Ͱ΍ΓऔΓ͞ΕΔલఏͰɺͦΕΒΛͻͱ·ͱΊ ʹͯ͠େ͖ͳ୯ҐΛૹۚ͢ΔͨΊͷ؅ཧ΍ΞϓϦέʔγϣϯ૚ͷσʔλΛ΍ΓऔΓ͢Δ w *-1ͷ੹຿ w ࠷΋جຊతͳࢧ෷͍ͷ࠷খ୯Ґͷ৘ใͷ΍ΓऔΓΛߦ͏ w %$1ͷ੹຿ w %ZOBNJD$POpHVSBUJPO1SPUPDPM w ϊʔυΛηοτΞοϓ͢ΔͨΊͷ৘ใͷ΍ΓऔΓΛߦ͏ʢ*-1ΞυϨεͷઃఆͳͲʣ w 3#1ͷ੹຿ w 3PVUF#SPBEDBTUJOH1SPUPDPM w ϧʔςΟϯά৘ใΛަ׵͢ΔͨΊʹར༻͞ΕΔ