<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; * Add `to_remote_delay OP_CHECKSEQUENCEVERIFY OP_DROP` to the `to_remote`<br>
&gt; output. `to_remote_delay` is the csv delay that the remote party accepted<br>
&gt; in the funding flow for their outputs. This not only ensures that the<br>
&gt; carve-out works as intended, but also removes the incentive to game the<br>
&gt; other party into force-closing. If desired, both parties can still agree =<br>
to<br>
&gt; have different `to_self_delay` values.<br>
<br>
I think we should unify to_self_delay if we&#39;re doing this.  Otherwise<br>
the game returns.<br></blockquote><div><br></div><div>The game returns, but both parties will be aware of the game they are playing. They agreed to their peer&#39;s to_self_delay up front. (This is different from the current situation where both peers are forced to accept a remote_to_self_delay of 0.) With validation on the open/accept_channel message, a node can still enforce both to_self_delays to be equal. We could simplify this to a single to_self_delay that is proposed by the initiator, but what was the original reason to allow distinct values?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; For the anchor outputs we consider:<br>
&gt;<br>
&gt; * Output type: normal P2WKH. At one point, an additional spending path was<br>
&gt; proposed that was unconditional except for a 10 block csv lock. The<br>
&gt; intention of this was to prevent utxo set pollution by allowing anyone to<br>
&gt; clean up. This however also opens up the possibility for an attacker to<br>
&gt; &#39;use up&#39; the cpfp carve-out after those 10 blocks. If the user A is offli=<br>
ne<br>
&gt; for that period of time, a malicious peer B may already have broadcasted<br>
&gt; the commitment tx and pinned down user A&#39;s anchor output with a low fee<br>
&gt; child. That way, the commitment tx could still remain unconfirmed while an<br>
&gt; important htlc expires.<br>
<br>
Agreed, this doesn&#39;t really work.  We actually needed a bitcoin rule<br>
that allowed a single anyone-can-spend output.  Seems like we didn&#39;t get<br>
that.<br></blockquote><div><br></div><div>With the mempool acceptance carve-out in bitcoind 0.19, we indeed won&#39;t be able to safely produce a single OP_TRUE output for anyone to spend. An attacker could attach low fee child transactions, reach the limits and block further fee bumping.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; * For the keys to use for `to_remote_anchor` and `to_local_anchor`, we=E2=<br>
=80=99d<br>
&gt; like to introduce new addresses that both parties communicate in the<br>
&gt; `open_channel` and `accept_channel` messages. We don=E2=80=99t want to re=<br>
use the<br>
&gt; main commitment output addresses, because those may (at some point) be co=<br>
ld<br>
&gt; storage addresses and the cpfp is likely to happen from a hot wallet.<br>
<br>
This is horribly spammy.  At the moment we see ~ one unilateral close<br>
every 3 blocks.  Hopefully that will reduce, but there&#39;ll always be<br>
some.<br></blockquote><div><br></div><div>It seems there isn&#39;t another way to do the anchor outputs given the mempool limitations that exist? Each party needs to have their own anchor, protected by a key. Otherwise it would open up these attack scenarios where an attacker blocks the commitment tx confirmation until htlcs time out. Even with the script OP_DEPTH OP_IF &lt;pubkey&gt; OP_CHECKSIG OP_ELSE 10 OP_CSV OP_ENDIF, the &quot;anyones&quot; don&#39;t know the pubkey and still can&#39;t sweep after 10 blocks.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; * Within each version of the commitment transaction, both anchors always<br>
&gt; have equal values and are paid for by the initiator.<br>
<br>
Who pays if they can&#39;t afford it?  What if they push_msat everything to<br>
the other side?<br></blockquote><div><br></div><div>Similar to how it currently works. There should never be a commitment transaction in which the initiator cannot pay the fee. With anchor outputs there should never be a commitment tx in which the initiator cannot pay the fee and the anchors. Also currently you cannot push everything to the other side with push_msat. The initiator still needs to have enough balance to pay for the on-chain costs (miner fee and anchors).</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; The value of the<br>
&gt; anchors is the dust limit that was negotiated in the `open_channel` or<br>
&gt; `accept_channel` message of the party that publishes the transaction.<br>
<br>
Now initiator has to care about the other side&#39;s dust limit, which is<br>
bad.  And as accepter I now want this much higher, since I get those<br>
funds instantly.  I don&#39;t think we gain anything by making this<br>
configurable at all; just pick a number and be done.<br>
<br>
Somewhere between 1000 and 10,000 sat is a good idea.<br></blockquote><div><br></div><div>Yes, it is free money. Therefore we need to validate the dust limit in the funding flow. Check whether it is reasonable. That should also be done in the current implementation. Otherwise your peer can set a really high dust limit that lets your htlc disappear on-chain (although that is only free money for the miner).</div><div><br></div><div>If we hard-code a constant, we won&#39;t be able to adapt to changes of `dustRelayFee` in the bitcoin network. And we&#39;d also need to deal with a peer picking a value higher than that constant for its regular funding flow dust limit parameter.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
There are several design constraints in the original watchtowers:<br>
<br>
1. A watchtower shouldn&#39;t be able to guess the channel history.<br>
2. ... even if it sees a unilateral tx.<br>
3. ... even if it sees a revoked unilateral tx it has a penalty for.<br>
4. A watchtower shouldn&#39;t be able to tell if it&#39;s being used for both<br>
   parties in the same channel.<br>
<br>
If you don&#39;t rotate keys, a watchtower can brute-force the HTLCs for all<br>
previous transactions it was told about, and previous channel balances.<br>
<br>
We removed key rotation on the to-remote output because you can simply<br>
not tell the watchtower about txs which don&#39;t have anything but an<br>
output to you.<br>
<br>
Here are the options I see:<br>
<br>
1. Abandon privacy from watchtowers and don&#39;t rotate keys.  Watchtowers<br>
   will be able to brute-force your history if they see a unilateral<br>
   close.<br>
<br>
2. Remove HTLC output key rotation, and assume watchtowers don&#39;t handle<br>
   HTLCs (so you don&#39;t tell them about early txs where the peer has no<br>
   output but there are HTLCs pending).  This seems less useful, since<br>
   HTLC txs require metadata anyway.<br>
<br>
3. Change to-local key rotation to use BIP32 (unhardened).  We could<br>
   also take some of the 48 bits (maybe 24?) we currently use to encode<br>
   the commitment number, to encode a BIP32 sub-path for this channel.<br>
   This would make it easier for hardware wallets to reconstruct.<br></blockquote><div><br></div><div>Interesting. I wasn&#39;t aware of the brute-force method that watchtowers could potentially use. I wanted to bring up the removal of key rotation just in case everyone would agree we don&#39;t need it anymore. It isn&#39;t required for the anchor outputs, but it would have been one (future) commitment format less. But it seems we do need it.</div><div><br></div><div>In the light of this forgotten insight, is there a reason why the anchor output would need key rotation? Having no rotation makes it easier to let those anchors go straight into the wallet, which may mitigate the dust utxo problem a bit. At least then they can be easily coin-selected for any on-chain spent, if the market fees are low enough.</div><div> </div><div>Joost</div></div></div>