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
Peer Swap
Search
shigeyuki azuchi
March 23, 2022
Technology
95
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Peer Swap
GBEC解説動画の資料です↓
https://goblockchain.network/2022/03/peer_swap/
shigeyuki azuchi
March 23, 2022
More Decks by shigeyuki azuchi
See All by shigeyuki azuchi
FORS
azuchi
0
15
クラスターmempool
azuchi
0
36
W-OTS+
azuchi
0
39
Shorのアルゴリズム
azuchi
0
64
DahLIAS: Discrete Logarithm-Based Interactive Aggregate Signatures
azuchi
0
48
Fiat-Shamir変換と注意点
azuchi
0
240
AssumeUTXOを利用したブロックチェーンの同期
azuchi
0
60
BIP-374 離散対数の等価性証明
azuchi
0
77
BIP-353 DNS Payment Instructions
azuchi
0
96
Other Decks in Technology
See All in Technology
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
1.8k
20260804_Q4AzureUpdateBite_FabricDataAgentの精度を高める設計.pdf
matayuuu
1
120
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
【CEDEC2026】ゲームシナリオライターを支援するAIツール開発の実践 ― 設計とプロンプトの工夫 ―
cygames
PRO
1
770
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
1
200
JavaScript 研修 (2026)
recruitengineers
PRO
2
470
取引先から届く 「セキュリティチェックシート」の読み解き方
kamadamakoto
0
140
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
12
8.4k
toio・myCobotでフィジカルAIっぽいことを行うための検討(とりあえず調査) / フィジカルAI LT(IoTLTによる開催)
you
PRO
0
300
【CEDEC2026】次世代デジタルカードゲームのサーバー設計と運用 〜『Shadowverse: Worlds Beyond』の舞台裏~
cygames
PRO
1
980
GitHub CopilotのFinOps- AI CreditのObservabilityと価値を生むためのエージェント設計
yuriemori
0
150
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
360
[SF Ruby Conf 2025] Rails X
palkan
2
1.3k
It's Worth the Effort
3n
188
29k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
650
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
400
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
230
Amusing Abliteration
ianozsvald
1
240
Statistics for Hackers
jakevdp
799
230k
Transcript
Peer Swap Lightning Network
1 LNチャネル残高のバランス Commitment Tx In Out アリスの残高 1,000,000 Funding UTXO
ボブの残高 5,000 チャネル参加者の一方の残高が極端に低い場合: • アリス→ボブのルーティングは可能だが、 逆のルーティングは失敗する。 ◦ 他のノードはチャネルのキャパシティは分かるが、 両者の残高のバランスは分からない。 • 失敗が続くと、ルーティングアルゴリズムが チャネルの評価を下げ、試行対象から除外される。 LN内の支払いの成功確率を上げるには、各チャネルの 残高が適切なバランスにあることが望ましい。
2 Circular Rebalance 1,000,000→500,000 5,000→505,000 700,000 250,000 1,250,000 2,000,000 1,200,000
1,000,000 650,000 350,000 500,040 500,030 500,020 500,010 500,000 自分が残高を持つ別のチャネルから、 残高を増やしたいチャネルへ支払いを実行し、 チャネル残高を調整する。 リバランスには課題も: • 希望する額のリバランスが可能な ルートが存在するか? • 通常のLN支払いと同様、 成功するかどうかはトライ&エラー • AMPにより支払いの分割も可能だが、 中間ホップが増える分手数料高に • バランスを調整可能なチャネルの有無
3 Peer Swap アリスの残高 1,000,000 ボブの残高 5,000 アリスの残高 500,000
ボブの残高 5,000 Onchain Tx In Out PeerSwap 500,000 ボブのUTXO カスタムメッセージを使って、 直接チャネルを開いている両者で、 チャネル残高とオンチェーン資金を Atomic Swap https://www.peerswap.dev / 直接チャネルを開いている相手との調整なので、 調整が付けば確実に低手数料でリバランスが可能 ※ただしオンチェーン手数料は発生する。 PeerSwap 500,000 PeerSwap Script or( and(pk(A), or(pk(B),sha256(H))), and(pk(B), after(N)) )
4 Swap-Out ① ネゴシエーションを開始 ③オンチェーン手数料をインボイスで支払い ④ Peer
Swap Scriptを含む オンチェーンTxをブロードキャスト ⑤ Txが承認されると、Peer Swap Scriptを 検証し、問題なければSwap Invoiceで支払い pre-mage アリスがオフチェーンで支払いをし、オンチェーン資金を得るケース ② オンチェーンTxの手数料を見積もり ⑥ プリイメージを公開し、 オフチェーン支払いを受け入れる ⑦ 開示されたプリイメージを使って、 オンチェーンの資金を入手
5 Swap-In ① ネゴシエーションを開始 (手数料の支払いステップは不要) ③ Peer
Swap Scriptを含む オンチェーンTxをブロードキャスト ④ Txが承認されると、Peer Swap Scriptを 検証し、問題なければSwap Invoiceで支払い pre-mage アリスがオンチェーン資金と交換で、チャネル残高を購入 ② 公開鍵ハッシュを返信 ⑤ プリイメージを公開し、 オフチェーン支払いを受け入れる ⑥ 開示されたプリイメージを使って、 オンチェーンの資金を入手