Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Covert channel recovery with Oblivious Signatures

15 messages, Dec 11 to 22, 2020. Started by Lloyd Fournier.

Lloyd Fournier (8), ZmnSCPxj (4), David A. Harding (2), Ariel Lorenzo-Luaces

Permalink First message in the Wayback Machine

Lloyd Fournier permalink original

Hi list,

Currently, if your lightning node has data loss there are two ways of recovering your funds once you have established which channels you had with which peers:

1. Wait until your peer closes the channel. The downside is that you have no control over when this happens. 2. Connect to your peer and ask them to close it. The downside is that to a malicious actor this request reads like "now is a good time to steal my money or extort me".

What if instead we could somehow covertly get a signed cooperative settlement transaction for the most recent state without your peer knowing that you've received it? Luckily this mystical and almost incoherent requirement is provided by one of the oldest and well developed cryptographic primitives: the so called "Oblivious Transfer" (OT).

https://en.wikipedia.org/wiki/Oblivious_transfer

The idea might go something like this: every time you connect to your peer they present you with an unsigned cooperative settlement transaction for all channels you have with them. You and your peer then do an oblivious transfer where they send you their signatures on the transaction or nothing (whichever you choose). If you want to carry on with the channel you reveal to the sender that you chose nothing. If you are recovering funds you choose the signatures and broadcast the transaction.

For this to be useful we have an extra requirement over typical OT which is that we can verify the contents of the message we didn't choose. i.e. even if we are not doing a recovery we have to be able to verify that the signatures we were offered were valid (wihout actually ever being able to use them!). Otherwise a malicious party could just be sending us invalid signatures in the OT the whole time. The name for this oblivious signatures.

## Constructing

Oblivious signatures can be created using any verifiable encrypted signature scheme where the encryption key is a group element (this includes adaptor signatures). In [1] they actually use adaptor signatures without calling them that to create a Schnorr oblivious signature scheme that is similar to what you would do with BIP340 Schnorr in practice. I used this in [2] to create scriptless lotteries in Bitcoin.

To start assume that you have three functions (which can be instantiated with adaptor signatures):

- `encrypted_sign(x, m, Y) -> e`
- `encrypted_signature_verify(X, m, Y) -> true/false`
- `decrypt_signature(e, y) -> s`

Where X is the public signing key Y is the encryption key and (x,y) are their corresponding secret keys. In our case x can be thought of as a secret key on a funding output.

First, the party receiving the offer decides whether they want to receive the settlement tx signature by setting c = 0 or otherwise c = 1 and then creates a pedersen commitment Y to c by choosing a random y:

Y = y *G + c * H

and sends the commitment Y to its peer.

The peer then sends `e = encrypted_sign(x, settlement_tx, Y)` back.

If c = 0 (i.e. it is doing a covert recovery) it does `s = decrypt_signature(e, y)` and attaches to the settlement transaction and broadcasts it. The channel is now successfully closed assuming the encrypted signature was valid.

If c = 1 (i.e. the node is fine and it wants to continue the channel) then it checks `encrypted_signature_verify(X, settlement_tx, Y)`. If it passes it sends the commitment blinding y back to prove that it doesn't have the signature (i.e. prove c = 1). If verification fails then the node is malicious and it fails the channel. Note that it is not possible to decrypt the signature if c = 1 since the discrete logarithm of H with respect to G is unknown.

## Misc Q&A

- Does this require crazy crypto magic? No with the exception of Pedersen commitments it only requires what is being planned to be included in lightning anyway i.e. adaptor signatures.

- Who is receiver and who is sender? In my imagination this works by the peer that is opening the connection being the receiver. This seems more useful since users who are likely to not have redundant storage and generally mess things up and need to recover are often behind NAT or on phone networks without a public ip. There are cases where a public node may want to recover by having people connect to them but I don't know what to do about that. It looks like you have to choose one or the other.

- Can't they still steal money? Yes but this is still a strictly better than the current situation. The attacker has to guess precisely which connection you make is after data loss. This is tricky task especially because if they ever guess wrongly you close your channel with them and block them. Right now you are the one who tells them you've lost data!

- Are these oblivious signatures secure? Yes. Sender security (receiver only gets the signature if c = 0) is based on discrete log assumption. Hint: if you instantiate the above algorithms with adaptor signatures we can extract the discrete log of H from a receiver who knows an opening of Y where c = 1 and also successfully decrypts the signature. Receiver security is unconditional (Pedersen commitments are unconditionally hiding).

- Does this work for multiple signatures? Yes you can choose to receive N signatures to close N channels or nothing. The signer just sends multiple e_1, e_2 produced the same way and the receiver can decrypt them all if c = 0.

- Does it work for key aggregated signatures i.e. MuSig2? -- Yes `encrypted_sign` just becomes a two round protocol to produce `e`.

- What do you do if the channel state has HTLCs in flight? I don't know -- I guess you can just put them onto the settlement tx? That way it's possible the payment could still go through. Alternatively you could just gift the money to the party offering the recovery settlement.

[1] http://www.cs.nccu.edu.tw/~raylin/UndergraduateCourse/ComtenporaryCryptography/Spring2009/TSOINSPET2007.pdf [2] https://telaviv2019.scalingbitcoin.org/files/scriptless-lotteries-on-bitcoin-from-oblivious-transfer.pdf

Cheers,

LL

David A. Harding in reply to Lloyd Fournier permalink original

On Fri, Dec 11, 2020 at 01:02:04PM +1100, Lloyd Fournier wrote:

Quoted text (5 lines)
> If c = 1 (i.e. the node is fine and it wants to continue the channel) then
> it checks `encrypted_signature_verify(X, settlement_tx, Y)`. If it passes
> it sends the commitment blinding y back to prove that it doesn't have the
> signature (i.e. prove c = 1). If verification fails then the node is
> malicious and it fails the channel.

This is really cool! However, I don't understand why it's needed. Your goal seems to be for the sender to provide the commitment transaction and signatures before he learns whether the receiver actually needs them. That's just as easily accomplished by sending the data upfront in plain text. For example, it seems to me that both of the following protocols provide identical utility:

1. On every reconnection, request the plain text unsigned commitment
   transaction, send a pedersen commitment, and receive the encrypted
   signature(s).  If c=1, verify the encrypted signature(s) and (on
   success) send the blinding factor or (on failure) fail the channel
   and ban the peer.  If c=0, decrypt the signature(s), apply them to
   the commitment transaction, and broadcast.
2. On every reconnection, request the plain text unsigned commitment
   transaction with all of its signatures, also in plain text.  If our
   database is intact, verify the commitment transaction and its
   signatures are valid and (on success) continue or (on failure) fail
   and ban.  If we lost data, broadcast the commitment transaction.

Unless I'm forgetting something, there's no reason a node shouldn't send its latest commitment transaction to its counterparty in plain text (over the regular BOLT8 P2P encrypted and authenticated link).

I think the challenge in either protocol above is deciding which peer goes first, because whoever sends the commitment transaction reveals what they think the current state is. Any node that refuses to go first can then be suspected of having lost data. BOLT2 option_static_remotekey has this same problem, which is reasonably mitigated IMO by LN's penalty mechanism forcing any would-be thief to risk their own funds; this doesn't work for basic eltoo, though.

-Dave

Lloyd Fournier in reply to David A. Harding permalink original

Hi Dave,

Thanks for taking a read. You brought up really good points that need addressing.

Quoted text (6 lines)
This is really cool!  However, I don't understand why it's needed.  Your
> goal seems to be for the sender to provide the commitment transaction
> and signatures before he learns whether the receiver actually needs
> them.  That's just as easily accomplished by sending the data upfront in
> plain text.
>

To be clear: The goal is to offer a cooperative settlement transaction up front to the (possibly) recovering party -- *not a commitment transaction*. Note we cannot send a cooperative settlement tx up front for each connection since they are not revocable -- the channel is over once it has been received.

I admit I didn't properly consider just sending commitment transactions over. This is probably because it exposes the recovering party to the punishment mechanism and in my most recent line of research you *really* don't want to do this. The idea I'm working with in revocable signature based channels [1] is to make the node lose its static secret key if it posts a revoked commitment tx. This means they could lose ALL funds from ALL their channels with ALL their peers if they ever broadcast a single revoked commitment transaction. This would be a very bad thing to happen while you're trying to recover funds.

I agree with your core point that in LN as it exists today the security assumption of both methods is that the adversary will be unable to distinguish a connection attempt after data loss from an ordinary one. If they can reliably do this then both methods can lead to loss of funds so why bother with the wonky crypto?

I think there is a subtle reason why oblivious settlement signatures are still preferable: it is difficult to provide a coherent UX for recovery when just sending YOLO commitment transactions. It would be best if the recovery UX was "hey user I've found 0.367 Bitcoin across these three channels would you like to recover them?". The user can then accept this or cancel the recovery process and go through some extra trouble to recover their data (in practice, data is often not completely lost but recoverable with some effort). This is how it could work using the oblivious settlement txs I proposed.

Using YOLO commitment transactions this becomes "hey user I've found 0.523 Bitcoin across three channels" which may actually be more than you are owed to entice you to shoot yourself in the foot. Even if it's exactly what you are owed, when you confirm the recovery your next message might be "aaaand it's gone" because one of the commit txs was revoked.

It seems difficult to recommend YOLO commitment transactions becoming the standard way to recover funds. It could be preferable to the current system but even that is up for debate I guess. I feel like I can recommend oblivious settlements because (i) it's covert (like YOLO commitments txs unlike current system) and (ii) it's "what you see is what you get" -- you are guaranteed to recover the funds that you are presented with once you finally trigger the recovery.

Although I do think oblivious settlement txs is a good idea I am working on yet *another* recovery idea for doing peer provided encrypted backup and full channel restoration in a way that provides another guarantee: If the peer sends you an outdated encrypted backup (perhaps in the hope that it has a revoked commitment tx in it) -- you can punish them immediately upon receiving the backup (if you haven't actually had data loss). Unfortunately, It looks like this will use more heavy cryptographic primitives.

Quoted text (8 lines)
I think the challenge in either protocol above is deciding which peer
> goes first, because whoever sends the commitment transaction reveals
> what they think the current state is.  Any node that refuses to go first
> can then be suspected of having lost data.  BOLT2
> option_static_remotekey has this same problem, which is reasonably
> mitigated IMO by LN's penalty mechanism forcing any would-be thief to
> risk their own funds; this doesn't work for basic eltoo, though.
>

What is the story with option_static_remotekey? I am interested to know how the negotiation of that option has a security issue but I don't see how it could.

[1]: https://github.com/LLFourn/witness-asymmetric-channel

Cheers,

LL

Ariel Lorenzo-Luaces in reply to David A. Harding permalink original

I don't think it's so clear that any party refusing to go go first can be assumed to have lost data.

If the rule is that the party receiving the connection is the one that must send the oblivious signatures then a party that has both lost data and is receiving a connection can just ignore the connection request.

There is plausible denyability because knowingly not answering a request can't be distinguished from just having connection issues or distinguished from a machine is just turned off.

This reasoning should work well into the future because as long as machine failures are common, the node with data loss can hide in that anonymity set. And if human kind resolves all machine failures then by definition there shouldn't be lightning channel data loss.

Cheers Ariel Lorenzo-Luaces

On Dec 13, 2020, 10:12 AM, at 10:12 AM, "David A. Harding" <dave at dtrt.org> wrote:

Quoted text (55 lines)
>On Fri, Dec 11, 2020 at 01:02:04PM +1100, Lloyd Fournier wrote:
>> If c = 1 (i.e. the node is fine and it wants to continue the channel)
>then
>> it checks `encrypted_signature_verify(X, settlement_tx, Y)`. If it
>passes
>> it sends the commitment blinding y back to prove that it doesn't have
>the
>> signature (i.e. prove c = 1). If verification fails then the node is
>> malicious and it fails the channel.
>
>This is really cool!  However, I don't understand why it's needed.
>Your
>goal seems to be for the sender to provide the commitment transaction
>and signatures before he learns whether the receiver actually needs
>them.  That's just as easily accomplished by sending the data upfront
>in
>plain text.  For example, it seems to me that both of the following
>protocols provide identical utility:
>
>1. On every reconnection, request the plain text unsigned commitment
>   transaction, send a pedersen commitment, and receive the encrypted
>   signature(s).  If c=1, verify the encrypted signature(s) and (on
>   success) send the blinding factor or (on failure) fail the channel
>   and ban the peer.  If c=0, decrypt the signature(s), apply them to
>   the commitment transaction, and broadcast.
>
>2. On every reconnection, request the plain text unsigned commitment
>   transaction with all of its signatures, also in plain text.  If our
>   database is intact, verify the commitment transaction and its
>   signatures are valid and (on success) continue or (on failure) fail
>   and ban.  If we lost data, broadcast the commitment transaction.
>
>Unless I'm forgetting something, there's no reason a node shouldn't
>send
>its latest commitment transaction to its counterparty in plain text
>(over the regular BOLT8 P2P encrypted and authenticated link).
>
>I think the challenge in either protocol above is deciding which peer
>goes first, because whoever sends the commitment transaction reveals
>what they think the current state is.  Any node that refuses to go
>first
>can then be suspected of having lost data.  BOLT2
>option_static_remotekey has this same problem, which is reasonably
>mitigated IMO by LN's penalty mechanism forcing any would-be thief to
>risk their own funds; this doesn't work for basic eltoo, though.
>
>-Dave
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Lightning-dev mailing list
>Lightning-dev at lists.linuxfoundation.org
>https://www.learnbitcoin.com/archive/lists/lightning-dev
David A. Harding in reply to Lloyd Fournier permalink original

On Mon, Dec 14, 2020 at 04:31:23PM +1100, Lloyd Fournier wrote:

Quoted text (2 lines)
> To be clear: The goal is to offer a cooperative settlement transaction up
> front to the (possibly) recovering party -- *not a commitment transaction*.

Ah, what BOLT0 calls a "mutual close". That makes a lot more sense and makes the protocol even cooler than I thought. Thanks for clarifying!

Quoted text (6 lines)
> The idea I'm working with in revocable signature based channels [1] is
> to make the node lose its static secret key if it posts a revoked
> commitment tx. This means they could lose ALL funds from ALL their
> channels with ALL their peers if they ever broadcast a single revoked
> commitment transaction. This would be a very bad thing to happen while
> you're trying to recover funds.

Yikes! A very bad thing indeed. I'll have to re-read about witness asymmetric channels; I don't think I realized that was a consequence of using them.

Quoted text (3 lines)
> What is the story with option_static_remotekey? I am interested to know how
> the negotiation of that option has a security issue but I don't see how it
> could.

Whoops, I got myself confused. I meant option_data_loss_protect, which LND calls "static channel backups". I just git greped the bolts for "static" and copied the first plausible seeming result. :facepalm:

On Mon, Dec 14, 2020 at 12:08:27AM -0800, Ariel Lorenzo-Luaces wrote:

Quoted text (2 lines)
> I don't think it's so clear that any party refusing to go go first can
> be assumed to have lost data.

Oh, I agree, it's definitely not clear. I just said they could "be *suspected* of having lost data".

On Mon, Dec 14, 2020 at 12:08:27AM -0800, Ariel Lorenzo-Luaces wrote:

Quoted text (8 lines)
> If the rule is that the party receiving the connection is the one that
> must send the oblivious signatures then a party that has both lost
> data and is receiving a connection can just ignore the connection
> request.
>
> There is plausible denyability because knowingly not answering a
> request can't be distinguished from just having connection issues or
> distinguished from a machine is just turned off.

In many cases, the network does behave differently in different cases:

    $ nmap -p 80 dtrt.org  ## online and port available
    80/tcp open  http
    $ nmap -p 80 newmail.dtrt.org  ## online but no service listening
    80/tcp closed http
    $ nmap -p 22 10.0.0.1  ## online but connection refused
    22/tcp filtered ssh
    $ nmap -p 80 10.0.0.200  ## not online
    Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn

Moreover, there's the case where Bob tries to open a connection with Mallory, but Mallory immediately turns around and tries to open a connection with Bob. In that case, Bob's unavailability might look suspicious (although it could just be NAT or something else innocuous).

However, beyond IP network activity, there's potentially a lot of evidence a dishonest counterparty can gather about a recently-reconnected node to evaluate the probability that it suffered a data loss. Perhaps most persuasive would be seeing what happened to that node's other channels. Were they all closed? Did the node fail to promptly broadcast a transaction with preimages trying to claim any pending HTLCs (which can be especially strong evidence if the dishonest counterparty was along the routing path for any of those HTLCs and so knows that the preimage was disclosed).

The reason option_data_loss_protects works in theory is that the only way attacker Mallory can test her hypothesis that victim Bob lost data is by Mallory broadcasting an old state that Bob, if he didn't actually lose data, can use to penalize Mallory in a way that may profit Bob. In an ideal world, for every victim node that actually lost data there'd be several honeypot nodes that faked losing data in order to profit from dishonest counterparties. Unfortunately, I doubt that's the case, for two reasons:

  1. You can only operate a data loss honeypot by causing a channel to
     be closed onchain, which is going to waste someone's fees.
  2. A dishonest node may only try broadcasting an old state when their
     channel balance is low, near the minimum allowed by the channel
     reserve.  The guidelines for channel reserve amounts were chosen
     (I believe) under the assumption that Mallory can be highly
     confident that Bob has the latest state, so the reserve is just
     the bare amount needed to prevent some annoying griefing.  The
     reserve is probably not large enough to compensate for the work and
     fee-paying costs of operating data loss honeypots.

That said, most nodes seem to be honest and hopefully the nodes playing with high-value channels are using some sort of live replication, so I don't think there have been any issues so far.

-Dave

Lloyd Fournier in reply to David A. Harding permalink original
Quoted text (1 line)
> It seems difficult to recommend YOLO commitment transactions becoming

the standard way to recover funds. It could be preferable to the current system but even that is up for debate I guess.

Quoted text (1 line)
> I feel like I can recommend oblivious settlements because (i) it's covert

(like YOLO commitments txs unlike current system) and (ii) it's "what you see is what you get" -- you are guaranteed to recover the funds that you are presented with once you finally trigger the recovery

Off list Dave correctly pointed out to me that this wasn't a very clear picture of the situation. After some thought, I came up with these claims that I think I can make strongly:

1. Before you reveal that you are doing recovery you are guaranteed to have
a tx in hand that:
     i. You can broadcast first
     ii. You can choose the fee to be as high as you like
     iii. Is not replaceable.
2. If the malicious party is *not* willing to risk broadcasting a revoked
tx then you are guaranteed to recover the face value of the transaction(s)
you have in hand.
3. An honest party is never at risk of broadcasting a revoked commitment tx.
4. You never have to reveal that you were doing a recovery i.e. the channel
can continue (strictly preferable to 1)

Current system has: 3 Oblivious mutual close has: 1,2,3 YOLO commitments has: 1,5

So I think the question of YOLO commitments vs oblivious mutual close is whether paying the price of losing (2,3) is worth the upgrade from (1) to (5). The concern with (1) is that once you broadcast to the network the obliviously transferred "mutual close" transaction, the malicious party then has a hint that you have lost data and they can try and broadcast a favourable revoked transaction. This should be very hard since in (1) you broadcast first, can choose as large a fee as you like and the tx does not signal replaceability whereas the revoked tx *will* signal replaceability. I'm also personally trying to avoid losing (3) because to keep [1] applicable.

As a side note: in YOLO commitment transactions you have to recover some additional metadata from the other party -- in particular the compressed revocation keys that you *should* know otherwise the channel cannot continue to operate. So a signature on the compressed revocation keys must be given to the other party before you lose data and returned to you when you are given the commitment transaction upon reconnection. This should be easy enough to do though.

[1] https://github.com/LLFourn/witness-asymmetric-channel#scorched-earth-punishments

On Tue, Dec 15, 2020 at 12:13 AM David A. Harding <dave at dtrt.org> wrote:

Quoted text (11 lines)
> > The idea I'm working with in revocable signature based channels [1] is
> > to make the node lose its static secret key if it posts a revoked
> > commitment tx. This means they could lose ALL funds from ALL their
> > channels with ALL their peers if they ever broadcast a single revoked
> > commitment transaction. This would be a very bad thing to happen while
> > you're trying to recover funds.
>
> Yikes!  A very bad thing indeed.  I'll have to re-read about witness
> asymmetric channels; I don't think I realized that was a consequence of
> using them.
>

It's an optional feature -- see link[1] above where I just added an explanation of it. I actually see no reason why you couldn't apply revocable signatures to transaction asymmetric channels (LN as it is today) you just have to overhaul the revocation mechanism.

In general I agree with your points that side-channels may be effective tools to reveal whether a node has had data loss or not. I think in both YOLO commitments and oblivious mutual close it is easy enough to simulate data-loss up to a point to try and catch malicious peers using side channels. At least you don't have to ask the peer to broadcast a tx to find out!

Cheers,

LL

Lloyd Fournier in reply to Lloyd Fournier permalink original

Errr please replace 5 with 4 in the previous post. Thanks to devrandom.

LL

On Tue, Dec 15, 2020 at 2:43 PM Lloyd Fournier <lloyd.fourn at gmail.com> wrote:

Quoted text (53 lines)
>
> > It seems difficult to recommend YOLO commitment transactions becoming the standard way to recover funds. It could be preferable to the current system but even that is up for debate I guess.
> > I feel like I can recommend oblivious settlements because (i) it's covert (like YOLO commitments txs unlike current system) and (ii) it's  "what you see is what you get" -- you are guaranteed to recover the funds that you are presented with once you finally trigger the recovery
>
> Off list Dave correctly pointed out to me that this wasn't a very clear picture of the situation.
> After some thought, I came up with these claims that I think I can make strongly:
>
> 1. Before you reveal that you are doing recovery you are guaranteed to have a tx in hand that:
>      i. You can broadcast first
>      ii. You can choose the fee to be as high as you like
>      iii. Is not replaceable.
> 2. If the malicious party is *not* willing to risk broadcasting a revoked tx then you are guaranteed to recover the face value of the transaction(s) you have in hand.
> 3. An honest party is never at risk of broadcasting a revoked commitment tx.
> 4. You never have to reveal that you were doing a recovery i.e. the channel can continue (strictly preferable to 1)
>
> Current system has: 3
> Oblivious mutual close has: 1,2,3
> YOLO commitments has: 1,5
>
> So I think the question of YOLO commitments vs oblivious mutual close is whether paying the price of losing (2,3) is worth the upgrade from (1) to (5).
> The concern with (1) is that once you broadcast to the network the obliviously transferred "mutual close" transaction, the malicious party then has a hint that you have lost data and they can try and broadcast a favourable revoked transaction.
> This should be very hard since in (1) you broadcast first, can choose as large a fee as you like and the tx does not signal replaceability whereas the revoked tx *will* signal replaceability.
> I'm also personally trying to avoid losing (3) because to keep [1] applicable.
>
> As a side note: in YOLO commitment transactions you have to recover some additional metadata from the other party -- in particular the compressed revocation keys that you *should* know otherwise the channel cannot continue to operate. So a signature on the compressed revocation keys must be given to the other party before you lose data and returned to you when you are given the commitment transaction upon reconnection.
> This should be easy enough to do though.
>
> [1] https://github.com/LLFourn/witness-asymmetric-channel#scorched-earth-punishments
>
> On Tue, Dec 15, 2020 at 12:13 AM David A. Harding <dave at dtrt.org> wrote:
>>
>> > The idea I'm working with in revocable signature based channels [1] is
>> > to make the node lose its static secret key if it posts a revoked
>> > commitment tx. This means they could lose ALL funds from ALL their
>> > channels with ALL their peers if they ever broadcast a single revoked
>> > commitment transaction. This would be a very bad thing to happen while
>> > you're trying to recover funds.
>>
>> Yikes!  A very bad thing indeed.  I'll have to re-read about witness
>> asymmetric channels; I don't think I realized that was a consequence of
>> using them.
>
>
> It's an optional feature -- see link[1] above where I just added an explanation of it.
> I actually see no reason why you couldn't apply revocable signatures to transaction asymmetric channels (LN as it is today) you just have to overhaul the revocation mechanism.
>
> In general I agree with your points that side-channels may be effective tools to reveal whether a node has had data loss or not.
> I think in both YOLO commitments and oblivious mutual close it is easy enough to simulate data-loss up to a point to try and catch malicious peers using side channels.
> At least you don't have to ask the peer to broadcast a tx to find out!
>
> Cheers,
>
> LL
ZmnSCPxj in reply to Lloyd Fournier permalink original

Good morning LL,

Quoted text (1 line)
> - What do you do if the channel state has HTLCs in flight? I don't know -- I guess you can just put them onto the settlement tx? That way it's possible the payment could still go through. Alternatively you could just gift the money to the party offering the recovery settlement.

Gifting the money is not a good option --- we allow HTLCs to be almost as high as the total channel value minus fees and reserve. Thus all the claimable value could potentially be in an outgoing HTLC. Worse, if our node is a forwarding node, it would be easy for a third party to arrange to have our funds in various HTLCs.

If we allow HTLCs to keep going on even while we are in recovery, we need to be able to "bind" as well incoming and outgoing HTLCs if our node was a forwarding node.

In particular, consider this situation:

* We are a forwarding node.
* We forward a payment whose outgoing expires in 1 day and whose incoming expires in 2 days.
  * This means we have at least two channels, one with the incoming HTLC and another with the outgoing HTLC.
* We hit our head and get amnesia.
* It takes us a day to realize we were formerly a Lightning Network forwarding node.
* The peer with the outgoing HTLC knows or learns the preimage.
  * Since we were unresponsive (i.e. still recovering from whatever gave us amnesia) that peer has dropped the channel onchain.
  * The peer has resolved the onchain HTLC with the hashlock branch.
* Because the outgoing peer has resolved everything it cares about, it forgets about the channel.
* We call all public nodes and ask about channels we might have with them.
* The incoming peer claims we have a channel with them containing an HTLC going to us.
* The outgoing peer has forgotten about us and does not tell us about the channel.

Thus, we cannot recover the outgoing channel, since the peer has already closed it and resolved everything it is interested in. (let us suppose that the `to_self_delay` is smaller than our `cltv_delta` setting)

Using static-key channels (i.e. channel keys are our node keys) allows us to recover even the outgoing channel with outgoing HTLC that has been forgotten by the outgoing peer.

Using static-key channels does have slightly weaker privacy:

* Published nodes reveal all their channels with other published nodes on the blockchain.
  * While it is true that published nodes already reveal their channels with published nodes, they are currently only revealed on the LN gossip network, which is not archived; historical channels that are now closed are not informed to current surveillors.
    * On the other hand, all it takes is one "LN wayback machine" to record all LN gossip, which are self-attesting and include a signature from the node.
* Unpublished nodes risk revealing their channels with published nodes via the blockchain.
  * Invoices created by unpublished nodes currently reveal their public key.
    Payers can then uncover all the channels of that node.
  * An unpublished node could use a faked node id, by combining the payment hash/point with its privkey to generate a new keypair to use as faked node id (I AM NOT A CRYPTOGRAPHER AND THIS TECHNIQUE IS POTENTIALLY GOING TO LOSE ALL YOUR FUNDS AND PRIVACY AND KILL YOUR DOG).
    On receiving an unparseable onion, it could try combining its privkey with the payment hash/point and try to open the onion that way, in case it is an incoming payment with the faked node id.

Regards, ZmnSCPxj

Lloyd Fournier in reply to ZmnSCPxj permalink original

Hey Z,

On Tue, Dec 15, 2020 at 9:21 PM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (9 lines)
>
> Good morning LL,
>
>
> > - What do you do if the channel state has HTLCs in flight? I don't know -- I guess you can just put them onto the settlement tx? That way it's possible the payment could still go through. Alternatively you could just gift the money to the party offering the recovery settlement.
>
> Gifting the money is not a good option --- we allow HTLCs to be almost as high as the total channel value minus fees and reserve.
> Thus all the claimable value could potentially be in an outgoing HTLC.
> Worse, if our node is a forwarding node, it would be easy for a third party to arrange to have our funds in various HTLCs.

Hopefully this recovery system is used by people whose channels are in a HTLC free state 99.9999% of the time (and hopefully hardware failures do not somehow coincide with HTLCs!). As a user, it would be cool to be able to just lock up all my Bitcoin into channels with well-established lightning nodes. That way if fees go ballistic I can still move money around cheaply. One of the main concerns for this pattern of user behaviour is the recovery story I think. The first line of defence for routing nodes (people who are taking their role in LN seriously) has to be redundant data storage. This would be a poor last-resort solution for routing nodes.

Quoted text (1 line)
> Using static-key channels (i.e. channel keys are our node keys) allows us to recover even the outgoing channel with outgoing HTLC that has been forgotten by the outgoing peer.

Right. I think this doesn't work with PTLCs though.

Quoted text (8 lines)
> Using static-key channels does have slightly weaker privacy:
>
> * Published nodes reveal all their channels with other published nodes on the blockchain.
>   * While it is true that published nodes already reveal their channels with published nodes, they are currently only revealed on the LN gossip network, which is not archived; historical channels that are now closed are not informed to current surveillors.
>     * On the other hand, all it takes is one "LN wayback machine" to record all LN gossip, which are self-attesting and include a signature from the node.
> * Unpublished nodes risk revealing their channels with published nodes via the blockchain.
>   * Invoices created by unpublished nodes currently reveal their public key.
>     Payers can then uncover all the channels of that node.

I don't think so? You need to know the private key of the node to discover its channels! The points actually used in the channels would be randomized with shared secret from Diffie-Hellman so are unlinkable to the public keys of the two nodes under decisional Diffie-Hellman assumption.

There is more minor but still real concern of "deniability" of unpublished closed channels if a large node operator later becomes corrupted or coerced by a malicious actor. Since the node operator still knows their secret key (obviously) they can still do a scan (same as you would do in recovery) on the whole chain and find any past channels they had with any nodes. A mitigation of this problem would be for users who want unpublished channels to turn the use-node-key-as-channel-key feature off for their keys in the channel so they would still be able to do a backup-free channel scan but the well-established node would lose the ability to do so. This means that after the channel is closed there would be no way for the large node to find the channel again assuming they honestly delete the data.

Cheers,

LL

ZmnSCPxj in reply to Lloyd Fournier permalink original

Good morning LL,

Quoted text (17 lines)
> > > -   What do you do if the channel state has HTLCs in flight? I don't know -- I guess you can just put them onto the settlement tx? That way it's possible the payment could still go through. Alternatively you could just gift the money to the party offering the recovery settlement.
> >
> > Gifting the money is not a good option --- we allow HTLCs to be almost as high as the total channel value minus fees and reserve.
> > Thus all the claimable value could potentially be in an outgoing HTLC.
> > Worse, if our node is a forwarding node, it would be easy for a third party to arrange to have our funds in various HTLCs.
>
> Hopefully this recovery system is used by people whose channels are in
> a HTLC free state 99.9999% of the time (and hopefully hardware
> failures do not somehow coincide with HTLCs!).
> As a user, it would be cool to be able to just lock up all my Bitcoin
> into channels with well-established lightning nodes. That way if fees
> go ballistic I can still move money around cheaply.
> One of the main concerns for this pattern of user behaviour is the
> recovery story I think. The first line of defence for routing nodes
> (people who are taking their role in LN seriously) has to be redundant
> data storage.
> This would be a poor last-resort solution for routing nodes.

A common occurrence is that hardware failure is not detected until when the hardware is used, especially when used by casual users.

Consider the sequence of events:

* Part of the storage device fails.
  * Due to being a casual user, the user does not use state-of-the-art checksumming filesystems like ZFS and does not monitor disk health by S.M.A.R.T.
* A high-onchain-fee condition exists.
* The casual user attempts to send out a payment consisting of almost all funds in their LN channels via several HTLCs on MPP or other multipath.
* Because of the activity generated, the filesystem assigns the LN database to the failing part.
* Storage fails with most funds in outgoing HTLCs.

Thus, merely activating the wallet and using HTLCs may result in a *detectable* failure of the hardware (which was already failing before, just not noticed by the casual user).

On the other hand, we can consider this situation as having a complexity penalty.

As someone who has seen a lot of storage devices slowly fail in unique and interesting (and data-losing) ways, I am always going to assume that storage devices are going to fail at any time, including a few hours after installation.

It would be preferable if HTLCs and PTLCs are not gifted. On the other hand, it might not be possible (as you note about PTLCs).

Quoted text (4 lines)
>
> > Using static-key channels (i.e. channel keys are our node keys) allows us to recover even the outgoing channel with outgoing HTLC that has been forgotten by the outgoing peer.
>
> Right. I think this doesn't work with PTLCs though.

Yes, loss of the adaptor signature means we cannot recover in this case.

Quoted text (16 lines)
>
> > Using static-key channels does have slightly weaker privacy:
> >
> > -   Published nodes reveal all their channels with other published nodes on the blockchain.
> >     -   While it is true that published nodes already reveal their channels with published nodes, they are currently only revealed on the LN gossip network, which is not archived; historical channels that are now closed are not informed to current surveillors.
> >         -   On the other hand, all it takes is one "LN wayback machine" to record all LN gossip, which are self-attesting and include a signature from the node.
> > -   Unpublished nodes risk revealing their channels with published nodes via the blockchain.
> >     -   Invoices created by unpublished nodes currently reveal their public key.
> >         Payers can then uncover all the channels of that node.
> >
>
> I don't think so? You need to know the private key of the node to
> discover its channels! The points actually used in the channels would
> be randomized with shared secret from Diffie-Hellman so are unlinkable
> to the public keys of the two nodes under decisional Diffie-Hellman
> assumption.

Right, that would work.

How about just using a multiplicative tweak of your own privkey and the pubkey of the other node (i.e. just use the "raw" ECDH point), that would work as 2-of-2 in 2p-ECDSA, and I believe (but do not know) should also be signable using MuSig/MuSig2 under taproot?

Quoted text (7 lines)
>
> There is more minor but still real concern of "deniability" of
> unpublished closed channels if a large node operator later becomes
> corrupted or coerced by a malicious actor. Since the node operator
> still knows their secret key (obviously) they can still do a scan
> (same as you would do in recovery) on the whole chain and find any
> past channels they had with any nodes.

"Peer selling private information" is always going to be an issue with unpublished channels, and this seems to be an inherent issue with that model.

Note that due to the existence of proof-of-discrete-log-equivalence, a node operator can *prove* to someone buying private information that a particular outpoint onchain is actually an unpublished channel. If I have privkey `z` and you have pubkey `L`, I can show `z * G` (my node pubkey), `L` (your "unpublished" (ha, ha) node pubkey), and `z * L` (our ECDH secret), plus a proof-of-discrete-log-equivalence that the `z` in `z * G` is the same `z` in `z * L`, in order to convice them of the ECDH secret. I suspect part of the proof-of-discrete-log-equivalance can be gated as well by a ZKCP on payment point+scalar the proof is provided only on payment. The selling node operator does not even need to reveal `z`.

As the ECDH secret is what tweaks the channel keys, that is enough to convince any surveilling buyer. Further, `z` is not revealed, and channel funds cannot be stolen by just knowledge of the ECDH secret, thus protecting the interests of the selling forwarding node.

Now of course, I could just be making up `L` (i.e. LL could be a sockpuppet of mine). However, between these two choices:

* I lock up a set number of millisatoshi in a Z + L channel where L is a sockpuppet, and sell this fake information to surveillors.
* I lock up a set number of millisatoshi in a Z + L channel where L is a genuine user node that thinks unpublished channels are private, and sell this genuine information to surveillors.

Which is more lucrative for me? The latter case would be more lucrative for me, as I not only earn from selling your data to surveillors, I also earn routing fees. The former case can only earn me selling fake data to surveillors, with no opportunity to earn forwarding fees.

Quoted text (5 lines)
> A mitigation of this problem
> would be for users who want unpublished channels to turn the
> use-node-key-as-channel-key feature off for their keys in the channel
> so they would still be able to do a backup-free channel scan but the
> well-established node would lose the ability to do so.

If the user has all channels unpublished, it is not (normally) gossiped. So the well-established node would not have the ability to recover *all* channels by backup-free scans of published nodes in the first place, only those that are to published nodes.

Or do you refer to something else?

It might be easier for the "client" here to make up different node IDs for each "server" it connects to, by e.g. hashing its base privkey with the server pubkey and using the hash as the privkey for its fake node ID with that server.

Quoted text (3 lines)
> This means that
> after the channel is closed there would be no way for the large node
> to find the channel again assuming they honestly delete the data.

If forwarding nodes are expected to have storage redundancy, deletion of data could be difficult as well --- there may be lots of replicas of that data in various places (including obsolete replicas that the node operator might not particularly care about, being obsolete), and deletion might not catch them all. "Honestly delete" seems like a best-effort to me.

On the other hand, if the model is that privacy is to be trusted to your peers, then this is no worse than unpublished channels, which has the same model.

Regards, ZmnSCPxj

Lloyd Fournier in reply to ZmnSCPxj permalink original

On Thu, Dec 17, 2020 at 1:56 AM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (15 lines, sent without quote marks)
> A common occurrence is that hardware failure is not detected until when
the hardware is used, especially when used by casual users.
>
> Consider the sequence of events:
>
> * Part of the storage device fails.
>   * Due to being a casual user, the user does not use state-of-the-art
checksumming filesystems like ZFS and does not monitor disk health by
S.M.A.R.T.
> * A high-onchain-fee condition exists.
> * The casual user attempts to send out a payment consisting of almost all
funds in their LN channels via several HTLCs on MPP or other multipath.
> * Because of the activity generated, the filesystem assigns the LN
database to the failing part.
> * Storage fails with most funds in outgoing HTLCs.

Note that this is fine if the payment goes through. Their counterparty will have to go on-chain to claim the payment (since your node is down due to data-loss) and then you claim whatever is left from your seed. The main risk here is for routing nodes which are hopefully only using this technique as a very poor last resort. If you actually manage to get online and try to restore before the on-chain settlement then just attaching outgoing HTLCs to the mutual close would be fine -- that way the peer can still claim the money from you if the payment goes through and you can get the refund if not.

The same could apply to incoming HTLCs as long as you can reproduce your HTLC pre-image deterministically.

PS good to hear you are a ZFS user too

Quoted text (14 lines)
>
> Thus, merely activating the wallet and using HTLCs may result in a
*detectable* failure of the hardware (which was already failing before,
just not noticed by the casual user).
>
> On the other hand, we can consider this situation as having a complexity
penalty.
>
> As someone who has seen a lot of storage devices slowly fail in unique
and interesting (and data-losing) ways, I am always going to assume that
storage devices are going to fail at any time, including a few hours after
installation.
>
> It would be preferable if HTLCs and PTLCs are not gifted.

Yes I am convinced.

Quoted text (8 lines)
> >
> > > Using static-key channels (i.e. channel keys are our node keys)
allows us to recover even the outgoing channel with outgoing HTLC that has
been forgotten by the outgoing peer.
> >
> > Right. I think this doesn't work with PTLCs though.
>
> Yes, loss of the adaptor signature means we cannot recover in this case.

Let's think about this again. There is no reason why the oblivious mutual close has to be the only thing the peer sends you upon connection. They can also send you the necessary signatures for each PTLC output on the mutual close because you can't do anything with this unless you choose to receive the mutual close signature. You verify these each time you connect without data loss so optimistically you should be able to recover both incoming and outgoing PTLCs

Quoted text (6 lines)
> Right, that would work.
>
> How about just using a multiplicative tweak of your own privkey and the
pubkey of the other node (i.e. just use the "raw" ECDH point), that would
work as 2-of-2 in 2p-ECDSA, and I believe (but do not know) should also be
signable using MuSig/MuSig2 under taproot?

I think multiplicative combination of keys does *not* work for Schnorr multisignatures.

Quoted text (39 lines)
>
> "Peer selling private information" is always going to be an issue with
unpublished channels, and this seems to be an inherent issue with that
model.
>
> Note that due to the existence of proof-of-discrete-log-equivalence, a
node operator can *prove* to someone buying private information that a
particular outpoint onchain is actually an unpublished channel.
> If I have privkey `z` and you have pubkey `L`, I can show `z * G` (my
node pubkey), `L` (your "unpublished" (ha, ha) node pubkey), and `z * L`
(our ECDH secret), plus a proof-of-discrete-log-equivalence that the `z` in
`z * G` is the same `z` in `z * L`, in order to convice them of the ECDH
secret.
> I suspect part of the proof-of-discrete-log-equivalance can be gated as
well by a ZKCP on payment point+scalar the proof is provided only on
payment.
> The selling node operator does not even need to reveal `z`.
>
> As the ECDH secret is what tweaks the channel keys, that is enough to
convince any surveilling buyer.
> Further, `z` is not revealed, and channel funds cannot be stolen by just
knowledge of the ECDH secret, thus protecting the interests of the selling
forwarding node.
>
> Now of course, I could just be making up `L` (i.e. LL could be a
sockpuppet of mine).
> However, between these two choices:
>
> * I lock up a set number of millisatoshi in a Z + L channel where L is a
sockpuppet, and sell this fake information to surveillors.
> * I lock up a set number of millisatoshi in a Z + L channel where L is a
genuine user node that thinks unpublished channels are private, and sell
this genuine information to surveillors.
>
> Which is more lucrative for me?
> The latter case would be more lucrative for me, as I not only earn from
selling your data to surveillors, I also earn routing fees.
> The former case can only earn me selling fake data to surveillors, with
no opportunity to earn forwarding fees.

Correct and interesting analysis. I agree that you don't want to accidentally opt in to having your peer have a way to cryptographically prove you have a channel with them. Except in the situation where you are already cryptographically proving to everyone you have a channel with them in the channel announcement.

Quoted text (13 lines)
>
> > A mitigation of this problem
> > would be for users who want unpublished channels to turn the
> > use-node-key-as-channel-key feature off for their keys in the channel
> > so they would still be able to do a backup-free channel scan but the
> > well-established node would lose the ability to do so.
>
> If the user has all channels unpublished, it is not (normally) gossiped.
> So the well-established node would not have the ability to recover *all*
channels by backup-free scans of published nodes in the first place, only
those that are to published nodes.
>
> Or do you refer to something else?

I was thinking about public nodes with un-announced channels. For completely private/unpublished nodes then I agree with your statement that there is no hope no matter how you compute the keys to recover automatically.

Quoted text (6 lines)
>
> It might be easier for the "client" here to make up different node IDs
for each "server" it connects to, by e.g. hashing its base privkey with the
server pubkey and using the hash as the privkey for its fake node ID with
that server.
>

Right. Something like this is what I was suggesting for public nodes who want to have unpublished channels that they want to be able to channel scan for but *do not want the other party* to be able to do so (to avoid concerns you made clear earlier). I think there's no strong reason to make up a new node id -- it can just be an option in open_channel like "use this key instead of my node id for everything in this channel".

Cheers,

LL

On Thu, Dec 17, 2020 at 1:56 AM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (181 lines)
> Good morning LL,
>
> > > > -   What do you do if the channel state has HTLCs in flight? I don't
> know -- I guess you can just put them onto the settlement tx? That way it's
> possible the payment could still go through. Alternatively you could just
> gift the money to the party offering the recovery settlement.
> > >
> > > Gifting the money is not a good option --- we allow HTLCs to be almost
> as high as the total channel value minus fees and reserve.
> > > Thus all the claimable value could potentially be in an outgoing HTLC.
> > > Worse, if our node is a forwarding node, it would be easy for a third
> party to arrange to have our funds in various HTLCs.
> >
> > Hopefully this recovery system is used by people whose channels are in
> > a HTLC free state 99.9999% of the time (and hopefully hardware
> > failures do not somehow coincide with HTLCs!).
> > As a user, it would be cool to be able to just lock up all my Bitcoin
> > into channels with well-established lightning nodes. That way if fees
> > go ballistic I can still move money around cheaply.
> > One of the main concerns for this pattern of user behaviour is the
> > recovery story I think. The first line of defence for routing nodes
> > (people who are taking their role in LN seriously) has to be redundant
> > data storage.
> > This would be a poor last-resort solution for routing nodes.
>
> A common occurrence is that hardware failure is not detected until when
> the hardware is used, especially when used by casual users.
>
> Consider the sequence of events:
>
> * Part of the storage device fails.
>   * Due to being a casual user, the user does not use state-of-the-art
> checksumming filesystems like ZFS and does not monitor disk health by
> S.M.A.R.T.
> * A high-onchain-fee condition exists.
> * The casual user attempts to send out a payment consisting of almost all
> funds in their LN channels via several HTLCs on MPP or other multipath.
> * Because of the activity generated, the filesystem assigns the LN
> database to the failing part.
> * Storage fails with most funds in outgoing HTLCs.
>
> Thus, merely activating the wallet and using HTLCs may result in a
> *detectable* failure of the hardware (which was already failing before,
> just not noticed by the casual user).
>
> On the other hand, we can consider this situation as having a complexity
> penalty.
>
> As someone who has seen a lot of storage devices slowly fail in unique and
> interesting (and data-losing) ways, I am always going to assume that
> storage devices are going to fail at any time, including a few hours after
> installation.
>
> It would be preferable if HTLCs and PTLCs are not gifted.
> On the other hand, it might not be possible (as you note about PTLCs).
>
> >
> > > Using static-key channels (i.e. channel keys are our node keys) allows
> us to recover even the outgoing channel with outgoing HTLC that has been
> forgotten by the outgoing peer.
> >
> > Right. I think this doesn't work with PTLCs though.
>
> Yes, loss of the adaptor signature means we cannot recover in this case.
>
> >
> > > Using static-key channels does have slightly weaker privacy:
> > >
> > > -   Published nodes reveal all their channels with other published
> nodes on the blockchain.
> > >     -   While it is true that published nodes already reveal their
> channels with published nodes, they are currently only revealed on the LN
> gossip network, which is not archived; historical channels that are now
> closed are not informed to current surveillors.
> > >         -   On the other hand, all it takes is one "LN wayback
> machine" to record all LN gossip, which are self-attesting and include a
> signature from the node.
> > > -   Unpublished nodes risk revealing their channels with published
> nodes via the blockchain.
> > >     -   Invoices created by unpublished nodes currently reveal their
> public key.
> > >         Payers can then uncover all the channels of that node.
> > >
> >
> > I don't think so? You need to know the private key of the node to
> > discover its channels! The points actually used in the channels would
> > be randomized with shared secret from Diffie-Hellman so are unlinkable
> > to the public keys of the two nodes under decisional Diffie-Hellman
> > assumption.
>
> Right, that would work.
>
> How about just using a multiplicative tweak of your own privkey and the
> pubkey of the other node (i.e. just use the "raw" ECDH point), that would
> work as 2-of-2 in 2p-ECDSA, and I believe (but do not know) should also be
> signable using MuSig/MuSig2 under taproot?
>
>
> >
> > There is more minor but still real concern of "deniability" of
> > unpublished closed channels if a large node operator later becomes
> > corrupted or coerced by a malicious actor. Since the node operator
> > still knows their secret key (obviously) they can still do a scan
> > (same as you would do in recovery) on the whole chain and find any
> > past channels they had with any nodes.
>
> "Peer selling private information" is always going to be an issue with
> unpublished channels, and this seems to be an inherent issue with that
> model.
>
> Note that due to the existence of proof-of-discrete-log-equivalence, a
> node operator can *prove* to someone buying private information that a
> particular outpoint onchain is actually an unpublished channel.
> If I have privkey `z` and you have pubkey `L`, I can show `z * G` (my node
> pubkey), `L` (your "unpublished" (ha, ha) node pubkey), and `z * L` (our
> ECDH secret), plus a proof-of-discrete-log-equivalence that the `z` in `z *
> G` is the same `z` in `z * L`, in order to convice them of the ECDH secret.
> I suspect part of the proof-of-discrete-log-equivalance can be gated as
> well by a ZKCP on payment point+scalar the proof is provided only on
> payment.
> The selling node operator does not even need to reveal `z`.
>
> As the ECDH secret is what tweaks the channel keys, that is enough to
> convince any surveilling buyer.
> Further, `z` is not revealed, and channel funds cannot be stolen by just
> knowledge of the ECDH secret, thus protecting the interests of the selling
> forwarding node.
>
> Now of course, I could just be making up `L` (i.e. LL could be a
> sockpuppet of mine).
> However, between these two choices:
>
> * I lock up a set number of millisatoshi in a Z + L channel where L is a
> sockpuppet, and sell this fake information to surveillors.
> * I lock up a set number of millisatoshi in a Z + L channel where L is a
> genuine user node that thinks unpublished channels are private, and sell
> this genuine information to surveillors.
>
> Which is more lucrative for me?
> The latter case would be more lucrative for me, as I not only earn from
> selling your data to surveillors, I also earn routing fees.
> The former case can only earn me selling fake data to surveillors, with no
> opportunity to earn forwarding fees.
>
> > A mitigation of this problem
> > would be for users who want unpublished channels to turn the
> > use-node-key-as-channel-key feature off for their keys in the channel
> > so they would still be able to do a backup-free channel scan but the
> > well-established node would lose the ability to do so.
>
> If the user has all channels unpublished, it is not (normally) gossiped.
> So the well-established node would not have the ability to recover *all*
> channels by backup-free scans of published nodes in the first place, only
> those that are to published nodes.
>
> Or do you refer to something else?
>
> It might be easier for the "client" here to make up different node IDs for
> each "server" it connects to, by e.g. hashing its base privkey with the
> server pubkey and using the hash as the privkey for its fake node ID with
> that server.
>
>
> > This means that
> > after the channel is closed there would be no way for the large node
> > to find the channel again assuming they honestly delete the data.
>
> If forwarding nodes are expected to have storage redundancy, deletion of
> data could be difficult as well --- there may be lots of replicas of that
> data in various places (including obsolete replicas that the node operator
> might not particularly care about, being obsolete), and deletion might not
> catch them all.
> "Honestly delete" seems like a best-effort to me.
>
> On the other hand, if the model is that privacy is to be trusted to your
> peers, then this is no worse than unpublished channels, which has the same
> model.
>
> Regards,
> ZmnSCPxj
>
Lloyd Fournier in reply to Lloyd Fournier permalink original
Quoted text (4 lines)
> I suspect part of the proof-of-discrete-log-equivalance can be gated as
well by a ZKCP on payment point+scalar the proof is provided only on
payment.
> The selling node operator does not even need to reveal `z`.

Actually no -- the fact that you were able to create a secure conditional payment for the proof would always prove the proof existed. You wouldn't need to pay for the proof then!

LL

ZmnSCPxj in reply to Lloyd Fournier permalink original

Good morning LL,

Quoted text (5 lines)
> > I suspect part of the proof-of-discrete-log-equivalance can be gated as well by a ZKCP on payment point+scalar the proof is provided only on payment.
> > The selling node operator does not even need to reveal `z`.
>
> Actually no -- the fact that you were able to create a secure conditional payment for the proof would always prove the proof existed.
> You wouldn't need to pay for the proof then!

That depends on the proof.

For example, one pay-for-proof scheme would be somebody to provide you an `(R, S)` for a public key `P = p * G`, where `S = s * G` (i.e. a signature, or a proof that you know `p` where `P = p * G`), and it would not prove anything until you pay for the scalar `s` and the prover can provide `s`, since `S` is computable from public information that anyone can have. So it really depends on what you want to prove; a mere ZKCP is not always enough.

Regards, ZmnSCPxj

PS I am dabbling in BTRFS now though, so ---

Lloyd Fournier in reply to ZmnSCPxj permalink original

On Sat, Dec 19, 2020 at 6:48 PM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (27 lines)
> Good morning LL,
>
> > > I suspect part of the proof-of-discrete-log-equivalance can be gated
> as well by a ZKCP on payment point+scalar the proof is provided only on
> payment.
> > > The selling node operator does not even need to reveal `z`.
> >
> > Actually no -- the fact that you were able to create a secure
> conditional payment for the proof would always prove the proof existed.
> > You wouldn't need to pay for the proof then!
>
> That depends on the proof.
>
> For example, one pay-for-proof scheme would be somebody to provide you an
> `(R, S)` for a public key `P = p * G`,  where `S = s * G` (i.e. a
> signature, or a proof that you know `p` where `P = p * G`), and it would
> not prove anything until you pay for the scalar `s` and the prover can
> provide `s`, since `S` is computable from public information that anyone
> can have.
> So it really depends on what you want to prove; a mere ZKCP is not always
> enough.
>
> Regards,
> ZmnSCPxj
>
> PS I am dabbling in BTRFS now though, so ---
>

You're right. I stand corrected. It is possible to construct ZKCP payments where the messages sent by the prover up until the point the prover claims the payment (and reveals the witness) could have been simulated by someone who doesn't know the witness. You give a good example of this. After thinking about your post I recalled that I used a similar argument about the security of my protocol for buying an opening of a Pedersen commitment with Bitcoin [1].

[1] https://github.com/LLFourn/buying-pedersen-commitment/blob/master/main.pdf

LL

ZmnSCPxj in reply to Lloyd Fournier permalink original

Good morning LL,

Quoted text (19 lines)
> > > > I suspect part of the proof-of-discrete-log-equivalance can be gated as well by a ZKCP on payment point+scalar the proof is provided only on payment.
> > > > The selling node operator does not even need to reveal `z`.
> > >
> > > Actually no -- the fact that you were able to create a secure conditional payment for the proof would always prove the proof existed.
> > > You wouldn't need to pay for the proof then!
> >
> > That depends on the proof.
> >
> > For example, one pay-for-proof scheme would be somebody to provide you an `(R, S)` for a public key `P = p * G`,  where `S = s * G` (i.e. a signature, or a proof that you know `p` where `P = p * G`), and it would not prove anything until you pay for the scalar `s` and the prover can provide `s`, since `S` is computable from public information that anyone can have.
> > So it really depends on what you want to prove; a mere ZKCP is not always enough.
> >
> > Regards,
> > ZmnSCPxj
> >
> > PS I am dabbling in BTRFS now though, so ---
>
> You're right. I stand corrected. It is possible to construct ZKCP payments where the messages sent by the prover up until the point the prover claims the payment (and reveals the witness) could have been simulated by someone who doesn't know the witness. You give a good example of this. After thinking about your post I recalled that I used a similar argument about the security of my protocol for buying an opening of a Pedersen commitment with Bitcoin [1].
>
> [1] https://github.com/LLFourn/buying-pedersen-commitment/blob/master/main.pdf

Yes, but on the other hand --- as pointed out, the seller could be lying and just made up the "other node" in the channel. Proof that the "other node" is in fact the actual "other node" on that channel is relatively worthless if there is no proof that the "other node" is at all something other than the seller.

On the other other hand --- if the buyer has additional information that the "other node" here is "of interest" (i.e. it has other data about the "other node" that makes it focus its attention on this "other node", and it suspects the seller is not a sockpuppet of the "other node" here) then this kind of proof just became very valuable.