Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Peer Swap
Search
shigeyuki azuchi
March 23, 2022
Technology
100
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
SLH-DSA (SPHINCS+)
azuchi
0
19
Hyper Tree
azuchi
0
22
FORS
azuchi
0
34
クラスターmempool
azuchi
0
44
W-OTS+
azuchi
0
50
Shorのアルゴリズム
azuchi
0
72
DahLIAS: Discrete Logarithm-Based Interactive Aggregate Signatures
azuchi
0
58
Fiat-Shamir変換と注意点
azuchi
0
260
AssumeUTXOを利用したブロックチェーンの同期
azuchi
0
71
Other Decks in Technology
See All in Technology
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
200
Metadata - Section 1: HTML Basics
mohab1
0
120
How to Design Configuration for Rails Applications
willnet
1
790
USB PDを使ってスマホを労わりたい
raspython3
0
180
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
460
Browser Spec: Testing Hotwire with Ruby
takahashim
1
120
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
サブエージェントと Claude Mods で作る独自 Advisor ツールの話
kenichiodo
2
160
Running Kotlin + Quarkus with Lambda
nealle
1
3.7k
Kiro Crewをはじめよう
kizawa2020
1
160
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
590
会社説明資料
persolserverworks
0
9.8k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Marketing to machines
jonoalderson
1
5.9k
Navigating Team Friction
lara
192
16k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
550
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Practical Orchestrator
shlominoach
192
12k
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 アリスがオンチェーン資金と交換で、チャネル残高を購入 ② 公開鍵ハッシュを返信 ⑤ プリイメージを公開し、 オフチェーン支払いを受け入れる ⑥ 開示されたプリイメージを使って、 オンチェーンの資金を入手