Sphinx
roasbeefが最近開発している新機能。
New "Sphinx" send mode in @lightning LND (work in progress) enables spontaneous payments without invoice. It can include user or API data, simplifying monetized interfaces & enabling new use cases. https://t.co/BbWuw9spk1
— Stadicus (@Stadicus3000) 2019年1月12日
請求書なしで支払いできる機能を提供する。
Sphinx
このbranch。 これを使うと、こんな感じのコマンドで送金できる。
lncli --network=simnet sendpayment --dest=02788242941915ed5a101511b8dfeb6db81e0fcd7546f6a55ef4dedf590a7d7ff4 --final_cltv_delta=144 --amt=100 --sphinx
{
"payment_error": "",
"payment_preimage": "0b1661fb77071fa5efd2217e380c93068bc3dc6e40e302673ff6373ecd8997b5",
"payment_route": {
"total_time_lock": 3299,
"total_amt": 100,
"hops": [
{
"chan_id": 3610796185681920,
"chan_capacity": 15000000,
"amt_to_forward": 100,
"expiry": 3299,
"amt_to_forward_msat": 100000,
"pub_key": "02788242941915ed5a101511b8dfeb6db81e0fcd7546f6a55ef4dedf590a7d7ff4"
}
],
"total_amt_msat": 100000
}
}
How it works
これを理解するためには、そもそもなぜbitcoinと違い、lightningはinvoiceなのか、を理解する必要がある。 これは基礎的な説明で理解できる。
Concretely, Suppose Alice has a channel with Bob, who has a channel with Carol, who has a channel with Dave: A<->B<->C<->D. How can Alice pay Dave? Alice first notifies Dave that she wants to send him some money.
In order for Dave to accept this payment, he must generate a random number R. He keeps R secret, but hashes it and gives the hash H to Alice.
preimage hashを事前にわたすことで、multihop paymentは成立しているので、これが必要なのだ。atomic multi path paymentは請求書不要にするらしい。
sphinxはこの仕組の応用なのだろうか。AMPと比較してみよう。