<oembed><type>rich</type><version>1.0</version><title>Lloyd Fournier [ARCHIVE] wrote</title><author_name>Lloyd Fournier [ARCHIVE] (npub1kh…y05yp)</author_name><author_url>https://yabu.me/npub1khlhcuz0jrjwa0ayznq2q9agg4zvxfvx5x7jljrvwnpfzngrcf0q7y05yp</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2020-12-17&#xA;📝 Original message:&#xA;On Thu, Dec 17, 2020 at 1:56 AM ZmnSCPxj &lt;ZmnSCPxj at protonmail.com&gt; wrote:&#xA;&gt; A common occurrence is that hardware failure is not detected until when&#xA;the hardware is used, especially when used by casual users.&#xA;&gt;&#xA;&gt; Consider the sequence of events:&#xA;&gt;&#xA;&gt; * Part of the storage device fails.&#xA;&gt;   * Due to being a casual user, the user does not use state-of-the-art&#xA;checksumming filesystems like ZFS and does not monitor disk health by&#xA;S.M.A.R.T.&#xA;&gt; * A high-onchain-fee condition exists.&#xA;&gt; * The casual user attempts to send out a payment consisting of almost all&#xA;funds in their LN channels via several HTLCs on MPP or other multipath.&#xA;&gt; * Because of the activity generated, the filesystem assigns the LN&#xA;database to the failing part.&#xA;&gt; * Storage fails with most funds in outgoing HTLCs.&#xA;&#xA;Note that this is fine if the payment goes through. Their counterparty will&#xA;have to go on-chain to claim the payment (since your node is down due to&#xA;data-loss) and then you claim whatever is left from your seed.&#xA;The main risk here is for routing nodes which are hopefully only using this&#xA;technique as a very poor last resort.&#xA;If you actually manage to get online and try to restore before the on-chain&#xA;settlement then just attaching outgoing HTLCs to the mutual close would be&#xA;fine -- that way the peer can still claim the money from you if the payment&#xA;goes through and you can get the refund if not.&#xA;&#xA;The same could apply to incoming HTLCs as long as you can reproduce your&#xA;HTLC pre-image deterministically.&#xA;&#xA;PS good to hear you are a ZFS user too&#xA;&#xA;&gt;&#xA;&gt; Thus, merely activating the wallet and using HTLCs may result in a&#xA;*detectable* failure of the hardware (which was already failing before,&#xA;just not noticed by the casual user).&#xA;&gt;&#xA;&gt; On the other hand, we can consider this situation as having a complexity&#xA;penalty.&#xA;&gt;&#xA;&gt; As someone who has seen a lot of storage devices slowly fail in unique&#xA;and interesting (and data-losing) ways, I am always going to assume that&#xA;storage devices are going to fail at any time, including a few hours after&#xA;installation.&#xA;&gt;&#xA;&gt; It would be preferable if HTLCs and PTLCs are not gifted.&#xA;&#xA;Yes I am convinced.&#xA;&#xA;&gt; &gt;&#xA;&gt; &gt; &gt; Using static-key channels (i.e. channel keys are our node keys)&#xA;allows us to recover even the outgoing channel with outgoing HTLC that has&#xA;been forgotten by the outgoing peer.&#xA;&gt; &gt;&#xA;&gt; &gt; Right. I think this doesn&#39;t work with PTLCs though.&#xA;&gt;&#xA;&gt; Yes, loss of the adaptor signature means we cannot recover in this case.&#xA;&#xA;Let&#39;s think about this again. There is no reason why the oblivious mutual&#xA;close has to be the only thing the peer sends you upon connection. They can&#xA;also send you the necessary signatures for each PTLC output on the mutual&#xA;close because you can&#39;t do anything with this unless you choose to receive&#xA;the mutual close signature. You verify these each time you connect without&#xA;data loss so optimistically you should be able to recover both incoming and&#xA;outgoing PTLCs&#xA;&#xA;&gt; Right, that would work.&#xA;&gt;&#xA;&gt; How about just using a multiplicative tweak of your own privkey and the&#xA;pubkey of the other node (i.e. just use the &#34;raw&#34; ECDH point), that would&#xA;work as 2-of-2 in 2p-ECDSA, and I believe (but do not know) should also be&#xA;signable using MuSig/MuSig2 under taproot?&#xA;&#xA;I think multiplicative combination of keys does *not* work for Schnorr&#xA;multisignatures.&#xA;&#xA;&gt;&#xA;&gt; &#34;Peer selling private information&#34; is always going to be an issue with&#xA;unpublished channels, and this seems to be an inherent issue with that&#xA;model.&#xA;&gt;&#xA;&gt; Note that due to the existence of proof-of-discrete-log-equivalence, a&#xA;node operator can *prove* to someone buying private information that a&#xA;particular outpoint onchain is actually an unpublished channel.&#xA;&gt; If I have privkey `z` and you have pubkey `L`, I can show `z * G` (my&#xA;node pubkey), `L` (your &#34;unpublished&#34; (ha, ha) node pubkey), and `z * L`&#xA;(our ECDH secret), plus a proof-of-discrete-log-equivalence that the `z` in&#xA;`z * G` is the same `z` in `z * L`, in order to convice them of the ECDH&#xA;secret.&#xA;&gt; I suspect part of the proof-of-discrete-log-equivalance can be gated as&#xA;well by a ZKCP on payment point+scalar the proof is provided only on&#xA;payment.&#xA;&gt; The selling node operator does not even need to reveal `z`.&#xA;&gt;&#xA;&gt; As the ECDH secret is what tweaks the channel keys, that is enough to&#xA;convince any surveilling buyer.&#xA;&gt; Further, `z` is not revealed, and channel funds cannot be stolen by just&#xA;knowledge of the ECDH secret, thus protecting the interests of the selling&#xA;forwarding node.&#xA;&gt;&#xA;&gt; Now of course, I could just be making up `L` (i.e. LL could be a&#xA;sockpuppet of mine).&#xA;&gt; However, between these two choices:&#xA;&gt;&#xA;&gt; * I lock up a set number of millisatoshi in a Z + L channel where L is a&#xA;sockpuppet, and sell this fake information to surveillors.&#xA;&gt; * I lock up a set number of millisatoshi in a Z + L channel where L is a&#xA;genuine user node that thinks unpublished channels are private, and sell&#xA;this genuine information to surveillors.&#xA;&gt;&#xA;&gt; Which is more lucrative for me?&#xA;&gt; The latter case would be more lucrative for me, as I not only earn from&#xA;selling your data to surveillors, I also earn routing fees.&#xA;&gt; The former case can only earn me selling fake data to surveillors, with&#xA;no opportunity to earn forwarding fees.&#xA;&#xA;Correct and interesting analysis. I agree that you don&#39;t want to&#xA;accidentally opt in to having your peer have a way to cryptographically&#xA;prove you have a channel with them.&#xA;Except in the situation where you are already cryptographically proving to&#xA;everyone you have a channel with them in the channel announcement.&#xA;&#xA;&gt;&#xA;&gt; &gt; A mitigation of this problem&#xA;&gt; &gt; would be for users who want unpublished channels to turn the&#xA;&gt; &gt; use-node-key-as-channel-key feature off for their keys in the channel&#xA;&gt; &gt; so they would still be able to do a backup-free channel scan but the&#xA;&gt; &gt; well-established node would lose the ability to do so.&#xA;&gt;&#xA;&gt; If the user has all channels unpublished, it is not (normally) gossiped.&#xA;&gt; So the well-established node would not have the ability to recover *all*&#xA;channels by backup-free scans of published nodes in the first place, only&#xA;those that are to published nodes.&#xA;&gt;&#xA;&gt; Or do you refer to something else?&#xA;&#xA;I was thinking about public nodes with un-announced channels.&#xA;For completely private/unpublished nodes then I agree with your statement&#xA;that there is no hope no matter how you compute the keys to recover&#xA;automatically.&#xA;&#xA;&gt;&#xA;&gt; It might be easier for the &#34;client&#34; here to make up different node IDs&#xA;for each &#34;server&#34; it connects to, by e.g. hashing its base privkey with the&#xA;server pubkey and using the hash as the privkey for its fake node ID with&#xA;that server.&#xA;&gt;&#xA;&#xA;Right. Something like this is what I was suggesting for public nodes who&#xA;want to have unpublished channels that they want to be able to channel scan&#xA;for but *do not want the other party* to be able to do so (to avoid&#xA;concerns you made clear earlier).&#xA;I think there&#39;s no strong reason to make up a new node id -- it can just be&#xA;an option in open_channel  like &#34;use this key instead of my node id for&#xA;everything in this channel&#34;.&#xA;&#xA;Cheers,&#xA;&#xA;LL&#xA;&#xA;&#xA;&#xA;On Thu, Dec 17, 2020 at 1:56 AM ZmnSCPxj &lt;ZmnSCPxj at protonmail.com&gt; wrote:&#xA;&#xA;&gt; Good morning LL,&#xA;&gt;&#xA;&gt; &gt; &gt; &gt; -   What do you do if the channel state has HTLCs in flight? I don&#39;t&#xA;&gt; know -- I guess you can just put them onto the settlement tx? That way it&#39;s&#xA;&gt; possible the payment could still go through. Alternatively you could just&#xA;&gt; gift the money to the party offering the recovery settlement.&#xA;&gt; &gt; &gt;&#xA;&gt; &gt; &gt; Gifting the money is not a good option --- we allow HTLCs to be almost&#xA;&gt; as high as the total channel value minus fees and reserve.&#xA;&gt; &gt; &gt; Thus all the claimable value could potentially be in an outgoing HTLC.&#xA;&gt; &gt; &gt; Worse, if our node is a forwarding node, it would be easy for a third&#xA;&gt; party to arrange to have our funds in various HTLCs.&#xA;&gt; &gt;&#xA;&gt; &gt; Hopefully this recovery system is used by people whose channels are in&#xA;&gt; &gt; a HTLC free state 99.9999% of the time (and hopefully hardware&#xA;&gt; &gt; failures do not somehow coincide with HTLCs!).&#xA;&gt; &gt; As a user, it would be cool to be able to just lock up all my Bitcoin&#xA;&gt; &gt; into channels with well-established lightning nodes. That way if fees&#xA;&gt; &gt; go ballistic I can still move money around cheaply.&#xA;&gt; &gt; One of the main concerns for this pattern of user behaviour is the&#xA;&gt; &gt; recovery story I think. The first line of defence for routing nodes&#xA;&gt; &gt; (people who are taking their role in LN seriously) has to be redundant&#xA;&gt; &gt; data storage.&#xA;&gt; &gt; This would be a poor last-resort solution for routing nodes.&#xA;&gt;&#xA;&gt; A common occurrence is that hardware failure is not detected until when&#xA;&gt; the hardware is used, especially when used by casual users.&#xA;&gt;&#xA;&gt; Consider the sequence of events:&#xA;&gt;&#xA;&gt; * Part of the storage device fails.&#xA;&gt;   * Due to being a casual user, the user does not use state-of-the-art&#xA;&gt; checksumming filesystems like ZFS and does not monitor disk health by&#xA;&gt; S.M.A.R.T.&#xA;&gt; * A high-onchain-fee condition exists.&#xA;&gt; * The casual user attempts to send out a payment consisting of almost all&#xA;&gt; funds in their LN channels via several HTLCs on MPP or other multipath.&#xA;&gt; * Because of the activity generated, the filesystem assigns the LN&#xA;&gt; database to the failing part.&#xA;&gt; * Storage fails with most funds in outgoing HTLCs.&#xA;&gt;&#xA;&gt; Thus, merely activating the wallet and using HTLCs may result in a&#xA;&gt; *detectable* failure of the hardware (which was already failing before,&#xA;&gt; just not noticed by the casual user).&#xA;&gt;&#xA;&gt; On the other hand, we can consider this situation as having a complexity&#xA;&gt; penalty.&#xA;&gt;&#xA;&gt; As someone who has seen a lot of storage devices slowly fail in unique and&#xA;&gt; interesting (and data-losing) ways, I am always going to assume that&#xA;&gt; storage devices are going to fail at any time, including a few hours after&#xA;&gt; installation.&#xA;&gt;&#xA;&gt; It would be preferable if HTLCs and PTLCs are not gifted.&#xA;&gt; On the other hand, it might not be possible (as you note about PTLCs).&#xA;&gt;&#xA;&gt; &gt;&#xA;&gt; &gt; &gt; Using static-key channels (i.e. channel keys are our node keys) allows&#xA;&gt; us to recover even the outgoing channel with outgoing HTLC that has been&#xA;&gt; forgotten by the outgoing peer.&#xA;&gt; &gt;&#xA;&gt; &gt; Right. I think this doesn&#39;t work with PTLCs though.&#xA;&gt;&#xA;&gt; Yes, loss of the adaptor signature means we cannot recover in this case.&#xA;&gt;&#xA;&gt; &gt;&#xA;&gt; &gt; &gt; Using static-key channels does have slightly weaker privacy:&#xA;&gt; &gt; &gt;&#xA;&gt; &gt; &gt; -   Published nodes reveal all their channels with other published&#xA;&gt; nodes on the blockchain.&#xA;&gt; &gt; &gt;     -   While it is true that published nodes already reveal their&#xA;&gt; channels with published nodes, they are currently only revealed on the LN&#xA;&gt; gossip network, which is not archived; historical channels that are now&#xA;&gt; closed are not informed to current surveillors.&#xA;&gt; &gt; &gt;         -   On the other hand, all it takes is one &#34;LN wayback&#xA;&gt; machine&#34; to record all LN gossip, which are self-attesting and include a&#xA;&gt; signature from the node.&#xA;&gt; &gt; &gt; -   Unpublished nodes risk revealing their channels with published&#xA;&gt; nodes via the blockchain.&#xA;&gt; &gt; &gt;     -   Invoices created by unpublished nodes currently reveal their&#xA;&gt; public key.&#xA;&gt; &gt; &gt;         Payers can then uncover all the channels of that node.&#xA;&gt; &gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; I don&#39;t think so? You need to know the private key of the node to&#xA;&gt; &gt; discover its channels! The points actually used in the channels would&#xA;&gt; &gt; be randomized with shared secret from Diffie-Hellman so are unlinkable&#xA;&gt; &gt; to the public keys of the two nodes under decisional Diffie-Hellman&#xA;&gt; &gt; assumption.&#xA;&gt;&#xA;&gt; Right, that would work.&#xA;&gt;&#xA;&gt; How about just using a multiplicative tweak of your own privkey and the&#xA;&gt; pubkey of the other node (i.e. just use the &#34;raw&#34; ECDH point), that would&#xA;&gt; work as 2-of-2 in 2p-ECDSA, and I believe (but do not know) should also be&#xA;&gt; signable using MuSig/MuSig2 under taproot?&#xA;&gt;&#xA;&gt;&#xA;&gt; &gt;&#xA;&gt; &gt; There is more minor but still real concern of &#34;deniability&#34; of&#xA;&gt; &gt; unpublished closed channels if a large node operator later becomes&#xA;&gt; &gt; corrupted or coerced by a malicious actor. Since the node operator&#xA;&gt; &gt; still knows their secret key (obviously) they can still do a scan&#xA;&gt; &gt; (same as you would do in recovery) on the whole chain and find any&#xA;&gt; &gt; past channels they had with any nodes.&#xA;&gt;&#xA;&gt; &#34;Peer selling private information&#34; is always going to be an issue with&#xA;&gt; unpublished channels, and this seems to be an inherent issue with that&#xA;&gt; model.&#xA;&gt;&#xA;&gt; Note that due to the existence of proof-of-discrete-log-equivalence, a&#xA;&gt; node operator can *prove* to someone buying private information that a&#xA;&gt; particular outpoint onchain is actually an unpublished channel.&#xA;&gt; If I have privkey `z` and you have pubkey `L`, I can show `z * G` (my node&#xA;&gt; pubkey), `L` (your &#34;unpublished&#34; (ha, ha) node pubkey), and `z * L` (our&#xA;&gt; ECDH secret), plus a proof-of-discrete-log-equivalence that the `z` in `z *&#xA;&gt; G` is the same `z` in `z * L`, in order to convice them of the ECDH secret.&#xA;&gt; I suspect part of the proof-of-discrete-log-equivalance can be gated as&#xA;&gt; well by a ZKCP on payment point+scalar the proof is provided only on&#xA;&gt; payment.&#xA;&gt; The selling node operator does not even need to reveal `z`.&#xA;&gt;&#xA;&gt; As the ECDH secret is what tweaks the channel keys, that is enough to&#xA;&gt; convince any surveilling buyer.&#xA;&gt; Further, `z` is not revealed, and channel funds cannot be stolen by just&#xA;&gt; knowledge of the ECDH secret, thus protecting the interests of the selling&#xA;&gt; forwarding node.&#xA;&gt;&#xA;&gt; Now of course, I could just be making up `L` (i.e. LL could be a&#xA;&gt; sockpuppet of mine).&#xA;&gt; However, between these two choices:&#xA;&gt;&#xA;&gt; * I lock up a set number of millisatoshi in a Z + L channel where L is a&#xA;&gt; sockpuppet, and sell this fake information to surveillors.&#xA;&gt; * I lock up a set number of millisatoshi in a Z + L channel where L is a&#xA;&gt; genuine user node that thinks unpublished channels are private, and sell&#xA;&gt; this genuine information to surveillors.&#xA;&gt;&#xA;&gt; Which is more lucrative for me?&#xA;&gt; The latter case would be more lucrative for me, as I not only earn from&#xA;&gt; selling your data to surveillors, I also earn routing fees.&#xA;&gt; The former case can only earn me selling fake data to surveillors, with no&#xA;&gt; opportunity to earn forwarding fees.&#xA;&gt;&#xA;&gt; &gt; A mitigation of this problem&#xA;&gt; &gt; would be for users who want unpublished channels to turn the&#xA;&gt; &gt; use-node-key-as-channel-key feature off for their keys in the channel&#xA;&gt; &gt; so they would still be able to do a backup-free channel scan but the&#xA;&gt; &gt; well-established node would lose the ability to do so.&#xA;&gt;&#xA;&gt; If the user has all channels unpublished, it is not (normally) gossiped.&#xA;&gt; So the well-established node would not have the ability to recover *all*&#xA;&gt; channels by backup-free scans of published nodes in the first place, only&#xA;&gt; those that are to published nodes.&#xA;&gt;&#xA;&gt; Or do you refer to something else?&#xA;&gt;&#xA;&gt; It might be easier for the &#34;client&#34; here to make up different node IDs for&#xA;&gt; each &#34;server&#34; it connects to, by e.g. hashing its base privkey with the&#xA;&gt; server pubkey and using the hash as the privkey for its fake node ID with&#xA;&gt; that server.&#xA;&gt;&#xA;&gt;&#xA;&gt; &gt; This means that&#xA;&gt; &gt; after the channel is closed there would be no way for the large node&#xA;&gt; &gt; to find the channel again assuming they honestly delete the data.&#xA;&gt;&#xA;&gt; If forwarding nodes are expected to have storage redundancy, deletion of&#xA;&gt; data could be difficult as well --- there may be lots of replicas of that&#xA;&gt; data in various places (including obsolete replicas that the node operator&#xA;&gt; might not particularly care about, being obsolete), and deletion might not&#xA;&gt; catch them all.&#xA;&gt; &#34;Honestly delete&#34; seems like a best-effort to me.&#xA;&gt;&#xA;&gt; On the other hand, if the model is that privacy is to be trusted to your&#xA;&gt; peers, then this is no worse than unpublished channels, which has the same&#xA;&gt; model.&#xA;&gt;&#xA;&gt; Regards,&#xA;&gt; ZmnSCPxj&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20201218/d47a1446/attachment-0001.html&gt;</html></oembed>