eltoo
LN は off chain で channel の state を更新していく。
しかし最新の state を blockchain に必ず反映させる仕組みはない。
そのため古い state を使おうとした場合は penalty として全額相手に取られてしまう仕組みで、そのような行為を牽制する。それがオリジナルの LN。LN penalty である。 State を確定させる Settlement Tx と、State を更新する Update Tx を使い分ける。
settlement tx が LN penalty の commitment tx と近いか?
Funding Tx および Update Tx の Output は、Timelock 付きで Settlement Tx が消費する場合と、即座に Update Tx が消費する2パターンにより消費できる。
state を変える時には、update tx と、それを unlock する settlement tx の両方を作る
update tx は、前回の settelement tx を double spend できる
古い Settlement Tx がブロードキャストされた場合、timelock があるため、timelock が解ける前に最新の Update Tx を使って先に Output を使ってしまうことができる。その後、その Update Tx を最新の Settlement Tx で消費すれば最新の state 通りに分配される。
state が更新されるたびに update tx + settlement tx が新しく作成される。どの update tx + settelement tx のペアが使われた場合でも、最新の update tx がその settlement tx を input にできる必要がある。SIGHASH_ANYPREVOUT が必要。 https://gyazo.com/f10acd070203162f8a2a95503f00a7a4
Update tx には順序を持たせる必要がある
3. On-chain update protocol
lock into multisig
create settlement (commitment) transaction
refund tx でもある
output of funding tx have if statement
OP_CSV で valid になるまでの timeout を設定する settelement tx 用 settelement tx は timeout しないと実行できない
else
update tx
The use of different key-pairs prevents an attacker from simply swapping out the branch selection and reusing the same signatures for the other branch.
3.2 Negotiation and Settlement phase
OP_CSV でロックされた settlement 用の output が有効になるまでは、update tx をつくって state を更新する
新しい state を反映する settlement tx をつくる
このタイミングでまた新たな csv のロックを設定できる
update tx は funding tx か前の update tx の output を消費し、prev tx と同じ output script
なぜ?
これは csv でロックされている settlement tx を doublespend する形になる
つまり前の settlement tx は csv のロックが開けても、もう消費できない
funding tx と settelement tx がペアであるように、update tx と settlement tx もペア
eltoo が解決しようとしている問題は、すでに有効である settlement tx を無効にすること
settlement tx の input になる output を update tx で先に unlock してしまうことで、settlement tx がその output を使えないようにする
4. Lifting the protocol off the chain
任意の update tx の input に任意の output を使うことができれば、すべての update tx を blockchain に commit する必要はない
sighash noinput
いまはまだない
最初の fundting tx だけでよいことになる
ただしそのままでは、古い tx が新しい tx を spend できる
update tx をスペンドするには 現在プラス 1以上のnlooktimeが必要
S は現在のステート
nLockTime に指定されている
However, the nLocktime field is already being used to invalidate transactions until some time.
nLockTime は状況によっていろいろな意味を持つので注意が必要
現時点では1billion以上の値が過去の値として使える=OP_CLTVで検証しても valid になる
これらの分だけ eltoo のステート管理の目的で使うことができる
この nlocktime の使い方はもう少し改善できるのではないか、という話。全然理解できていない、、、
settlement tx は特定の update tx しか input にできないようにしたいので、key pair を毎回変える
これはでかい
Resource
channel reserve もなくすことができる?
どちらの peer にもリザーブが必要だった。なぜなら、一方のバランが完全に 0 の場合、失うものがないので、penalty の意味がなくなってしまう
zero fee commitment が実現している必要があるか?