Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Trustless WatchTowers?

11 messages, Apr 16 to 18, 2018. Started by ZmnSCPxj.

ZmnSCPxj (6), Conner Fromknecht (4), Olaoluwa Osuntokun

Permalink First message in the Wayback Machine

ZmnSCPxj permalink original

Hi all,

Nicolas Dorier was requesting additional hooks in c-lightning for a simple WatchTower system: https://github.com/ElementsProject/lightning/issues/1353

Unfortunately I was only able to provide an interface which requires a *trusted* WatchTower. Trust is of course a five-letter word and should not be used in polite company.

My key problem is that I provide enough information to the WatchTower for the WatchTower to be able to create the justice transaction by itself. If so, the WatchTower could just make the justice transaction output to itself and the counterparty, so that the WatchTower and the counterparty can cooperate to steal the channel funds: the counterparty publishes a revoked transaction, the WatchTower writes a justice transaction on it that splits the earnings between itself and the counterparty.

It seems to me, that the only safe way to implement a trustless WatchTower, is for the node to generate a fully-signed justice transaction, IMMEDIATELY after every commitment transaction is revoked, and transmit it to the WatchTower. The WatchTower would have to store each and every justice transaction it received, and would not be able to compress it or use various techniques to store data efficiently. The WatchTower would not have enough information to regenerate justice transactions (and in particular would not be able to create a travesty-of-justice transaction that pays out to itself rather than the protected party). In practice this would require that node software also keep around those transactions until some process has ensured that the WatchTower has received the justice transactions.

Is there a good way to make trustless WatchTowers currently or did this simply not reach BOLT v1.0?

Regards, ZmnSCPxj

Olaoluwa Osuntokun in reply to ZmnSCPxj permalink original

Hi ZmnSCPxj,

Quoted text (6 lines)
> It seems to me, that the only safe way to implement a trustless
WatchTower,
> is for the node to generate a fully-signed justice transaction,
IMMEDIATELY
> after every commitment transaction is revoked, and transmit it to the
> WatchTower.

No, one doesn't need to transmit the entire justice transaction. Instead, the client simply sends out the latest items in the script template, and a series of _signatures_ for the various breach outputs. The pre-generated signature means that the server is *forced* to reproduce the justice transaction that satisfies the latest template and signature. Upfront, free parameters such as breach bonus (or w/e else) can be negotiated.

Quoted text (4 lines)
> The WatchTower would have to store each and every justice transaction it
> received, and would not be able to compress it or use various techniques
to
> store data efficiently.

In our current implementation, we've abandoned the "savings" from compressing the shachain/elkrem tree. When one factors in the space complexity due the *just* the commitment signatures, the savings from compression become less attractive. Going a step father, once you factor in the space complexity of the 2-stage HTLC claims, then the savings from compressing the revocation tree become insignificant.

It's also worth pointing out that if the server is able to compress the revocation tree, then their necessarily linking new breach payloads with a particular channel. Another downside, is that if you go to revocation tree compression, then all updates *must* be sent in order, and updates cannot be *skipped*.

As a result of these downside, our current implementation goes back to the ol' "encrypted blob" approach. One immediate benefit with this approach is that the outsourcing protocol isn't so coupled with the current _commitment protocol_. Instead, the internal payload can be typed, allowing the server to dispatch the proper breach protocol based on the commitment type. The blob approach can also support a "swap" protocol which is required for commitment designs that allow for O(1) outsourcer state per-client, like the scheme I presented at the last Scaling Bitcoin.

-- Laolu

On Sun, Apr 15, 2018 at 8:32 PM ZmnSCPxj via Lightning-dev < lightning-dev at lists.linuxfoundation.org> wrote:

Quoted text (41 lines)
> Hi all,
>
> Nicolas Dorier was requesting additional hooks in c-lightning for a simple
> WatchTower system:
> https://github.com/ElementsProject/lightning/issues/1353
>
> Unfortunately I was only able to provide an interface which requires a
> *trusted* WatchTower.  Trust is of course a five-letter word and should not
> be used in polite company.
>
> My key problem is that I provide enough information to the WatchTower for
> the WatchTower to be able to create the justice transaction by itself.  If
> so, the WatchTower could just make the justice transaction output to itself
> and the counterparty, so that the WatchTower and the counterparty can
> cooperate to steal the channel funds: the counterparty publishes a revoked
> transaction, the WatchTower writes a justice transaction on it that splits
> the earnings between itself and the counterparty.
>
> It seems to me, that the only safe way to implement a trustless
> WatchTower, is for the node to generate a fully-signed justice transaction,
> IMMEDIATELY after every commitment transaction is revoked, and transmit it
> to the WatchTower.  The WatchTower would have to store each and every
> justice transaction it received, and would not be able to compress it or
> use various techniques to store data efficiently.  The WatchTower would not
> have enough information to regenerate justice transactions (and in
> particular would not be able to create a travesty-of-justice transaction
> that pays out to itself rather than the protected party).  In practice this
> would require that node software also keep around those transactions until
> some process has ensured that the WatchTower has received the justice
> transactions.
>
> Is there a good way to make trustless WatchTowers currently or did this
> simply not reach BOLT v1.0?
>
> Regards,
> ZmnSCPxj
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
ZmnSCPxj in reply to Olaoluwa Osuntokun permalink original

Good morning Laolu,

Quoted text (13 lines)
> Hi ZmnSCPxj,
>
>> It seems to me, that the only safe way to implement a trustless WatchTower,
>> is for the node to generate a fully-signed justice transaction, IMMEDIATELY
>> after every commitment transaction is revoked, and transmit it to the
>> WatchTower.
>
> No, one doesn't need to transmit the entire justice transaction. Instead,
> the client simply sends out the latest items in the script template, and a
> series of _signatures_ for the various breach outputs. The pre-generated
> signature means that the server is *forced* to reproduce the justice
> transaction that satisfies the latest template and signature. Upfront, free
> parameters such as breach bonus (or w/e else) can be negotiated.

Thank you, I understand.

Quoted text (8 lines)
> As a result of these downside, our current implementation goes back to the
> ol' "encrypted blob" approach. One immediate benefit with this approach is
> that the outsourcing protocol isn't so coupled with the current _commitment
> protocol_. Instead, the internal payload can be typed, allowing the server
> to dispatch the proper breach protocol based on the commitment type. The
> blob approach can also support a "swap" protocol which is required for
> commitment designs that allow for O(1) outsourcer state per-client, like the
> scheme I presented at the last Scaling Bitcoin.

Can you describe the "encrypted blob" approach to me? Or point me to materials?

I imagine that in this case, the protected node hands a (txid, blob) pair to the WatchTower. If the WatchTower sees a transaction that matches the given txid, it gets some information from the actual transaction to decrypt the blob (e.g. use the encrypted commitment index in `nLockTime` and `nSequence` as a decryption key); the blob is the justice transaction (or just a template type and its signatures as you describe above).

Do you have a description of the WatchTower protocol used in lnd? It may be useful to be intercompatible.

Regards, ZmnSCPxj

Conner Fromknecht in reply to ZmnSCPxj permalink original

Hi ZmnSCPxj,

Quoted text (2 lines)
> Can you describe the "encrypted blob" approach to me? Or point me to
> materials?

There's an awesome watchtower thread on the mailing list from 2016 that starts here [1]. It covers a broader range of possibilities than just the encrypted blob approach, and also considers other revocation schemes, e.g. elkrem.

Similar to what you described, one encrypted blob approached discussed in that thread is: 1. hint = tixd[:16] 2. blob = Enc(data, txid[16:]) 3. Send (hint, blob) to watchtower.

Whenever a new block is mined, the watchtower checks if it has an entry for each txid[:16]. If so, it decrypts using txid[16:], assembles the justice txn, and broadcasts (assuming the reward output matches what was negotiated).

Quoted text (3 lines)
> Do you have a description of the WatchTower protocol used in lnd? It may
be
> useful to be intercompatible.

We don't have anything written up formally, though what we have currently operates on the design above.

There are more complex proposals discussed allowing an encrypted blob to reference data stored in a prior encrypted blob. Primary advantage would be reducing the storage costs of HTLCs present on multiple successive commitment transactions; primary disadvantage is that it's significantly more complex, in addition to the other points brought up by Laolu.

I'm not positive as to the extent this approach was implemented/fleshed out, or if any other pros/cons may have been realized in the process. I haven't done nearly as much research as Tadge on that front, he's probably got some extensive thoughts on the tradeoffs.

=======

I'll also take this time to brain dump some recent investigations I've been doing on watchtowers. TL;DR @ fin.

FWIW, I've been thinking about this in the context of the simple encrypted blob approach, though the observations can generalize to other schemes.

As Laolu mentioned, the storage requirement for the watchtower is dominated by the number of HTLC signatures included in the encrypted blob. Due to independence of the second stage transactions, there is a combinatoric blowup in the number of signatures that would need to be pre-signed under the revocation private key _if sweeping of HTLC outputs is batched_.

If we want to batch sweep without more liberal sighash flags, I think we'd need to pre-sign n*2^n signatures. There are 2^n possible ways that n HTLCs can straddle the first and second stages, and each permutation would require n distinct signatures since the set of inputs is unique to each permutation. Needless to say, this isn't feasible with the maximum number of HTLCs allowed in the protocol.

However, I have some observations that might inform an efficient set of signatures we can choose to include in the encrypted blobs.

The first is that the HTLC timeout or HTLC success transaction _must_ be broadcast before the attacker can move funds back into their wallet. If these transactions are never mined, it is actually fine to do nothing and leave those outputs in the breached state.

If/when the victim comes back online, they themselves can sign and broadcast a justice transaction that executes the revocation clause of either the offered or received HTLC scripts, based on the observed spentness of the various commitment HLTC outputs at that time. So, we can save on signature data by only requiring the watchtower to act if second stage transactions are confirmed.

One reallyyy nice thing about not having the watchtower sweep the HTLC outputs on the commitment txn directly is that it doesn't need to know how to reconstruct the more complex HTLC redeem scripts. It only needs to reconstruct commitment to-local and second-stage to-local scripts and witnesses. This means the blob primarily contains: - 1 revocation pubkey - 1 local delay pubkey - 1 CSV delay - 2 commitment signatures - n HTLC signatures and we don't have to bother sending CLTVs, local/remote htlc pubkeys, or payment hashes at all.

The storage for this ends up being something like ~100 + 64*(2+nhtlcs) when you include other things like the sweep address.

The second observation is that the second stage transactions could be broadcast sequentially such that the CSV delays don't overlap at all. In this event, the watchtower needs to sweep the HTLCs iteratively to prevent the attacker from sweeping any of the outputs as the relative timelocks expire.

One minimal solution could be to send signatures for independent sweep transactions, allowing the watchtower to sweep each HTLC output individually. This is nice because it permits the watchtower to sweep exactly the subset of HTLCs that ever transition into the second stage, and under any permutation wrt. ordering of confirmed second stage transactions.

With the single transaction per HTLC approach, the total number of signatures that are sent to the watchtower remains linear in the number HTLCs on the commitment transaction. This approach does have the downside of consuming slightly more fees, since each output is swept with a distinct transaction.

However, this approach is fairly efficient in preventing the attacker entirely from moving funds from the channel into their wallet wrt. to the amount of data stored. Considering that the majority of the channel balance is expected to be in the commitment outputs and that hypothetically on-chains fees are offset by the remote balance, this could be an acceptable tradeoff.

I suspect that in practice, most second stage transactions will be valid by the time an attacker would drop to chain. Because of this, it's possible that they could be mined in the same block as the breach transaction.

If everything is mined in the same block or in quick succession, it might be worthwhile to also pre-sign a justice txn that batch sweeps all HTLCs directly from the second layer, requiring one additional signature/HTLC.

This could be a plausible scenario if the offender breached unintentionally, and their implementation tries to proceed normally. However it does require all of the CSV delays to conincide. If that doesn't happen, the watchtower can always resort to sweeping the outputs individually.

All in all, I think the ability to sweep each HTLC independently is more-or-less a requirement just given the complexity of how the on-chain state-space can manifest, especially if CLTVs have already expired. Other scenarios may be worth including on a case by case basis or if we feel they are justified. This could be handled dynamically by including some bitvector or some compact representation of how to reconstruct the transactions for any additional, included signatures.

TL;DR: We can get away with just sweeping the second stage outputs. Sweeping each in a distinct txn avoids combinatoric blowup of trying to batch the sweeps. The storage is linear in the number of HTLC outputs, and also reduces the data required to reconstruct the individual redeem scripts.

Any feedback or additional insights would be greatly appreciated! Let me know if I've overlooked anything critical :)

Cheers, Conner

[1] https://www.learnbitcoin.com/archive/lists/lightning-dev /2016-August/000565.html

On Mon, Apr 16, 2018 at 11:30 PM ZmnSCPxj via Lightning-dev < lightning-dev at lists.linuxfoundation.org> wrote:

Quoted text (53 lines)
> Good morning Laolu,
>
>
> Hi ZmnSCPxj,
>
> > It seems to me, that the only safe way to implement a trustless
> WatchTower,
> > is for the node to generate a fully-signed justice transaction,
> IMMEDIATELY
> > after every commitment transaction is revoked, and transmit it to the
> > WatchTower.
>
> No, one doesn't need to transmit the entire justice transaction. Instead,
> the client simply sends out the latest items in the script template, and a
> series of _signatures_ for the various breach outputs. The pre-generated
> signature means that the server is *forced* to reproduce the justice
> transaction that satisfies the latest template and signature. Upfront, free
> parameters such as breach bonus (or w/e else) can be negotiated.
>
>
> Thank you, I understand.
>
> As a result of these downside, our current implementation goes back to the
> ol' "encrypted blob" approach. One immediate benefit with this approach is
> that the outsourcing protocol isn't so coupled with the current _commitment
> protocol_. Instead, the internal payload can be typed, allowing the server
> to dispatch the proper breach protocol based on the commitment type. The
> blob approach can also support a "swap" protocol which is required for
> commitment designs that allow for O(1) outsourcer state per-client, like
> the
> scheme I presented at the last Scaling Bitcoin.
>
>
> Can you describe the "encrypted blob" approach to me? Or point me to
> materials?
>
> I imagine that in this case, the protected node hands a (txid, blob) pair
> to the WatchTower.  If the WatchTower sees a transaction that matches the
> given txid, it gets some information from the actual transaction to decrypt
> the blob (e.g. use the encrypted commitment index in `nLockTime` and
> `nSequence` as a decryption key); the blob is the justice transaction (or
> just a template type and its signatures as you describe above).
>
> Do you have a description of the WatchTower protocol used in lnd? It may
> be useful to be intercompatible.
>
> Regards,
> ZmnSCPxj
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
ZmnSCPxj in reply to Conner Fromknecht permalink original

Good morning Conner,

Quoted text (14 lines)
> Hi ZmnSCPxj,
>
>> Can you describe the "encrypted blob" approach to me? Or point me to
>> materials?
>
> There's an awesome watchtower thread on the mailing list from 2016 that starts
> here [1]. It covers a broader range of possibilities than just the encrypted
> blob approach, and also considers other revocation schemes, e.g. elkrem.
>
> Similar to what you described, one encrypted blob approached discussed in
> that thread is:1. hint = tixd[:16]2. blob = Enc(data, txid[16:])3. Send (hint, blob) to watchtower.
>
> Whenever a new block is mined, the watchtower checks if it has an entry for each
> txid[:16]. If so, it decrypts using txid[16:], assembles the justice txn, andbroadcasts (assuming the reward output matches what was negotiated).

Thank you, that is indeed similar to what I was thinking given the name "encrypted blob".

Also, thank you for the link. I have not had much time to back-read anything older than 2017 in the archives. I observe that neither Poon nor Dryja seem to strongly participate in this list from 2017 onwards.

Quoted text (3 lines)
>> Do you have a description of the WatchTower protocol used in lnd? It may be> useful to be intercompatible.
> We don't have anything written up formally, though what we have currently
> operates on the design above.

I understand. It would be good to know what you have, and perhaps consider planning a new BOLT document for such.

Nicolas Dorier mentioned plans for BTCPay to somehow host "merchant support networks" where merchants may expose WatchTower endpoints, which other merchants may post revocation information for their channels to.

Quoted text (14 lines)
> I'll also take this time to brain dump some recent investigations I've been doing on
>
> watchtowers. TL;DR @ fin.
>
> FWIW, I've been thinking about this in the context of the simple encrypted
> blob approach, though the observations can generalize to other schemes.
>
> As Laolu mentioned, the storage requirement for the watchtower is dominated bythe number of HTLC signatures included in the encrypted blob. Due toindependence of the second stage transactions, there is a combinatoric blowup inthe number of signatures that would need to be pre-signed under the revocationprivate key _if sweeping of HTLC outputs is batched_.
>
> If we want to batch sweep without more liberal sighash flags, I think we'd need to
> pre-sign n*2^n signatures. There are 2^n possible ways that n HTLCs can straddle
> the first and second stages, and each permutation would require n distinct signatures
> since the set of inputs is unique to each permutation. Needless to say, this isn't feasible
> with the maximum number of HTLCs allowed in the protocol.

Yes, I thought this too.

Quoted text (10 lines)
> However, I have some observations that might inform an efficient set of
> signatures we can choose to include in the encrypted blobs.
>
> The first is that the HTLC timeout or HTLC success transaction _must_ bebroadcast before the attacker can move funds back into their wallet. If
> these transactions are never mined, it is actually fine to do nothing and leave
> those outputs in the breached state.
>
> If/when the victim comes back online, they themselves can sign and broadcast
> a justice transaction that executes the revocation clause of either the offered or
> received HTLC scripts, based on the observed spentness of the various commitmentHLTC outputs at that time. So, we can save on signature data by only requiring thewatchtower to act if second stage transactions are confirmed.

This is a good observation! I initially thought that we would have to provide both the first-stage and second-stage revocation signatures.

Quoted text (10 lines)
> One reallyyy nice thing about not having the watchtower sweep the HTLC outputson the commitment txn directly is that it doesn't need to know how toreconstruct the more complex HTLC redeem scripts. It only needs to reconstructcommitment to-local and second-stage to-local scripts and witnesses. This means
> the blob primarily contains:
>  - 1 revocation pubkey
>  - 1 local delay pubkey
>  - 1 CSV delay
>  - 2 commitment signatures - n HTLC signatures
> and we don't have to bother sending CLTVs, local/remote htlc pubkeys, or payment hashes at all.
>
> The storage for this ends up being something like ~100 + 64*(2+nhtlcs) when you
> include other things like the sweep address.

Thank you, that seems like a start at something that can be implemented.

Quoted text (3 lines)
> The second observation is that the second stage transactions could be broadcast
> sequentially such that the CSV delays don't overlap at all. In this event, thewatchtower needs to sweep the HTLCs iteratively to prevent the attacker from
> sweeping any of the outputs as the relative timelocks expire.

Sorry, I seem confused this idea. Can you give example for commitment with 2x HTLC?

Quoted text (3 lines)
> One minimal solution could be to send signatures for independent sweep
> transactions, allowing the watchtower to sweep each HTLC output individually.
> This is nice because it permits the watchtower to sweep exactly the subset ofHTLCs that ever transition into the second stage, and under any permutationwrt. ordering of confirmed second stage transactions.

Yes, this seems like a good general idea.

Quoted text (22 lines)
> With the single transaction per HTLC approach, the total number of signatures thatare sent to the watchtower remains linear in the number HTLCs on the commitmenttransaction. This approach does have the downside of consuming slightly more
> fees, since each output is swept with a distinct transaction.
>
> However, this approach is fairly efficient in preventing the attacker entirely from
> moving funds from the channel into their wallet wrt. to the amount of data stored.
> Considering that the majority of the channel balance is expected to be in
> the commitment outputs and that hypothetically on-chains fees are offset by the
> remote balance, this could be an acceptable tradeoff.
>
> I suspect that in practice, most second stage transactions will be valid by the time an attacker would drop to chain. Because of this, it's possible that they
> could be mined in the same block as the breach transaction.
>
> If everything is mined in the same block or in quick succession, it might be
> worthwhile to also pre-sign a justice txn that batch sweeps all HTLCs directlyfrom the second layer, requiring one additional signature/HTLC.
> This could be a plausible scenario if the offender breached unintentionally, and their implementation tries to proceed normally. However it does require all of the
> CSV delays to conincide. If that doesn't happen, the watchtower can alwaysresort to sweeping the outputs individually.
>
> All in all, I think the ability to sweep each HTLC independently is more-or-lessa requirement just given the complexity of how the on-chain state-space can manifest, especially if CLTVs have already expired. Other scenarios may
> be worth including on a case by case basis or if we feel they are justified. This
> could be handled dynamically by including some bitvector or some compact
> representation of how to reconstruct the transactions for any additional, included
> signatures.

Okay. So it seems, the blob contains:

1.  Revocation pubkey (from our revocation basepoint and per-commitment basepoint)
2.  Their delayed payment pubkey (needed in scripts)
3.  Our imposed to_self_delay (the setting we indicate, that we impose on the remote side)
4.  Our payment pubkey
5.  0 or 1 or 2 signatures for the main outputs. These sign a single transaction that claims only the main outputs.
6.  0 or more second-stage HTLC revocation signatures.  These sign individual transactions (one per HTLC) that claims only the second-stage HTLC output.
7.  scriptpubkey to put all the funds in.

When the commitment txid is found onchain, the WatchTower creates a single main output claim transaction using the 1 or 2 signatures for the main outputs. And for each HTLC outpoint on the commitment transaction, if it gets spent, the WatchTower creates one HTLC justice transaction from the second-stage HTLC transaction.

Is that approximately what is needed? Have I missed anything?

Regards, ZmnSCPxj

Conner Fromknecht in reply to ZmnSCPxj permalink original

Good evening ZmnSCPxj,

Quoted text (1 line)
> Also, thank you for the link.

Definitely! I had to do some digging myself to recover these hidden gems.

Quoted text (2 lines)
> I understand. It would be good to know what you have, and perhaps consider
> planning a new BOLT document for such.

Yes, that is the ultimate goal. I think it might be a little to soon to have a full-on BOLT spec. There are still some implementation details that we would like to address before formalizing everything. I am working to have something written up in the short-term documenting the approach[es] that ends up being solidified. Hopefully that can get some eyes during development, and perhaps serve as working document/rough draft.

Quoted text (3 lines)
> Sorry, I seem confused this idea.  Can you give example for commitment
with 2x
> HTLC?

Sure thing! The confirmation of second level HTLC txns can be separated by arbitrary delays. This is particularly true if the CLTVs have already expired, offering an attacker total control over when the txns appear on the network. One way this can happen is if the attacker iteratively broadcasts a single second-level txn, waits for confirmation and CSV to expire, then repeat with another second-level txn.

Since the CSVs begin ticking as soon as they are included in the chain, the attacker could try to sweep each one immediately after its CSV expires. If the watchtower doesn't have the ability to sweep outputs independently, it would have no way to intercept this behavior, and prevent the breacher from sweeping individual HTLCs sequentially.

Quoted text (6 lines)
> When the commitment txid is found onchain, the WatchTower creates a single
> main output claim transaction using the 1 or 2 signatures for the main
> outputs.  And for each HTLC outpoint on the commitment transaction, if it
gets
> spent, the WatchTower creates one HTLC justice transaction from the
> second-stage HTLC transaction.

Yes, this is how it would work in context of what I was suggesting. Certainly, there are other ways to accomplish the same thing. I don't wish to claim that this is the best solution available, there are a lot of tradeoffs that need to be evaluated. I'm hoping that you and others can bring any shortcomings to light and help us sift through them.

Quoted text (2 lines)
> 5.  0 or 1 or 2 signatures for the main outputs. These sign a single
> transaction that claims only the main outputs.

Yes, it seems necessary to separate the commitment outpoints from the HTLC outpoints in case the commitment txn is broadcasted before the CLTVs expire. You could try to batch these with the HTLCs, but then we get back into exponential territory.

Quoted text (1 line)
> Is that approximately what is needed?  Have I missed anything?

Nope, I think your understanding is on point. IMO this seems to be a reasonable compromise of the tradeoffs at hand, and definitely something that could serve as an initial iteration due to its simplicity. In the future, there are definitely ways to improve on this on make it even more efficient! Though having a solid/workable v0 is important if it is to be deployed. I enjoy hearing your thoughts on this, thank you for your responses!

Best, Conner

On Tue, Apr 17, 2018 at 6:14 AM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (245 lines)
> Good morning Conner,
>
>
>
>
> Hi ZmnSCPxj,
> > Can you describe the "encrypted blob" approach to me? Or point me to
> > materials?
>
> There's an awesome watchtower thread on the mailing list from 2016 that
> starts
> here [1]. It covers a broader range of possibilities than just the
> encrypted
> blob approach, and also considers other revocation schemes, e.g. elkrem.
>
> Similar to what you described, one encrypted blob approached discussed in
> that thread is:
> 1. hint = tixd[:16]
> 2. blob = Enc(data, txid[16:])
> 3. Send (hint, blob) to watchtower.
>
> Whenever a new block is mined, the watchtower checks if it has an entry
> for each
> txid[:16]. If so, it decrypts using txid[16:], assembles the justice txn,
> and
> broadcasts (assuming the reward output matches what was negotiated).
>
>
> Thank you, that is indeed similar to what I was thinking given the name
> "encrypted blob".
>
> Also, thank you for the link. I have not had much time to back-read
> anything older than 2017 in the archives. I observe that neither Poon nor
> Dryja seem to strongly participate in this list from 2017 onwards.
>
>
>
> > Do you have a description of the WatchTower protocol used in lnd? It
> may be
> > useful to be intercompatible.
> We don't have anything written up formally, though what we have currently
> operates on the design above.
>
>
> I understand. It would be good to know what you have, and perhaps consider
> planning a new BOLT document for such.
>
> Nicolas Dorier mentioned plans for BTCPay to somehow host "merchant
> support networks" where merchants may expose WatchTower endpoints, which
> other merchants may post revocation information for their channels to.
>
>
>
> I'll also take this time to brain dump some recent investigations I've
> been doing on
>
>
>
> watchtowers. TL;DR @ fin.
>
>
>
> FWIW, I've been thinking about this in the context of the simple encrypted
> blob approach, though the observations can generalize to other schemes.
>
>
>
> As Laolu mentioned, the storage requirement for the watchtower is
> dominated by
> the number of HTLC signatures included in the encrypted blob. Due to
> independence of the second stage transactions, there is a combinatoric
> blowup in
> the number of signatures that would need to be pre-signed under the
> revocation
> private key _if sweeping of HTLC outputs is batched_.
>
> If we want to batch sweep without more liberal sighash flags, I think we'd
> need to
> pre-sign n*2^n signatures. There are 2^n possible ways that n HTLCs can
> straddle
> the first and second stages, and each permutation would require n distinct
> signatures
> since the set of inputs is unique to each permutation. Needless to say,
> this isn't feasible
> with the maximum number of HTLCs allowed in the protocol.
>
>
> Yes, I thought this too.
>
>
>
> However, I have some observations that might inform an efficient set of
> signatures we can choose to include in the encrypted blobs.
>
>
>
> The first is that the HTLC timeout or HTLC success transaction _must_ be
> broadcast before the attacker can move funds back into their wallet. If
> these transactions are never mined, it is actually fine to do nothing and
> leave
> those outputs in the breached state.
>
> If/when the victim comes back online, they themselves can sign and
> broadcast
> a justice transaction that executes the revocation clause of either the
> offered or
> received HTLC scripts, based on the observed spentness of the various
> commitment
> HLTC outputs at that time. So, we can save on signature data by only
> requiring the
> watchtower to act if second stage transactions are confirmed.
>
>
> This is a good observation!  I initially thought that we would have to
> provide both the first-stage and second-stage revocation signatures.
>
>
> One reallyyy nice thing about not having the watchtower sweep the HTLC
>  outputs
> on the commitment txn directly is that it doesn't need to know how to
> reconstruct the more complex HTLC redeem scripts. It only needs to
> reconstruct
> commitment to-local and second-stage to-local scripts and witnesses. This
> means
> the blob primarily contains:
>  - 1 revocation pubkey
>  - 1 local delay pubkey
>  - 1 CSV delay
>  - 2 commitment signatures
>  - n HTLC signatures
> and we don't have to bother sending CLTVs, local/remote htlc pubkeys, or
> payment hashes at all.
>
> The storage for this ends up being something like ~100 + 64*(2+nhtlcs)
> when you
> include other things like the sweep address.
>
>
> Thank you, that seems like a start at something that can be implemented.
>
>
> The second observation is that the second stage transactions could be
> broadcast
> sequentially such that the CSV delays don't overlap at all. In this
> event, the
> watchtower needs to sweep the HTLCs iteratively to prevent the attacker
> from
> sweeping any of the outputs as the relative timelocks expire.
>
>
> Sorry, I seem confused this idea.  Can you give example for commitment
> with 2x HTLC?
>
>
> One minimal solution could be to send signatures for independent sweep
> transactions, allowing the watchtower to sweep each HTLC output
> individually.
> This is nice because it permits the watchtower to sweep exactly the
> subset of
> HTLCs that ever transition into the second stage, and under any
> permutation
> wrt. ordering of confirmed second stage transactions.
>
>
> Yes, this seems like a good general idea.
>
>
> With the single transaction per HTLC approach, the total number of
> signatures that
> are sent to the watchtower remains linear in the number HTLCs on the
> commitment
> transaction. This approach does have the downside of consuming slightly
> more
> fees, since each output is swept with a distinct transaction.
>
>
>
> However, this approach is fairly efficient in preventing the attacker
> entirely from
> moving funds from the channel into their wallet wrt. to the amount of data
> stored.
> Considering that the majority of the channel balance is expected to be in
> the commitment outputs and that hypothetically on-chains fees are offset
> by the
> remote balance, this could be an acceptable tradeoff.
>
>
>
> I suspect that in practice, most second stage transactions will be valid
> by the
> time an attacker would drop to chain. Because of this, it's possible that
> they
> could be mined in the same block as the breach transaction.
>
> If everything is mined in the same block or in quick succession, it might
> be
> worthwhile to also pre-sign a justice txn that batch sweeps all HTLCs
> directly
> from the second layer, requiring one additional signature/HTLC.
> This could be a plausible scenario if the offender breached
> unintentionally, and
> their implementation tries to proceed normally. However it does require
> all of the
> CSV delays to conincide. If that doesn't happen, the watchtower can always
> resort to sweeping the outputs individually.
>
> All in all, I think the ability to sweep each HTLC independently is
> more-or-less
> a requirement just given the complexity of how the on-chain state-space can
>
> manifest, especially if CLTVs have already expired. Other scenarios may
> be worth including on a case by case basis or if we feel they are
> justified. This
> could be handled dynamically by including some bitvector or some compact
> representation of how to reconstruct the transactions for any additional,
> included
> signatures.
>
>
> Okay.  So it seems, the blob contains:
>
> 1.  Revocation pubkey (from our revocation basepoint and per-commitment
> basepoint)
> 2.  Their delayed payment pubkey (needed in scripts)
> 3.  Our imposed to_self_delay (the setting we indicate, that we impose on
> the remote side)
> 4.  Our payment pubkey
> 5.  0 or 1 or 2 signatures for the main outputs. These sign a single
> transaction that claims only the main outputs.
> 6.  0 or more second-stage HTLC revocation signatures.  These sign
> individual transactions (one per HTLC) that claims only the second-stage
> HTLC output.
> 7.  scriptpubkey to put all the funds in.
>
> When the commitment txid is found onchain, the WatchTower creates a single
> main output claim transaction using the 1 or 2 signatures for the main
> outputs.  And for each HTLC outpoint on the commitment transaction, if it
> gets spent, the WatchTower creates one HTLC justice transaction from the
> second-stage HTLC transaction.
>
> Is that approximately what is needed?  Have I missed anything?
>
> Regards,
> ZmnSCPxj
>
ZmnSCPxj in reply to Conner Fromknecht permalink original

Good morning Conner,

Quoted text (8 lines)
>> I understand. It would be good to know what you have, and perhaps consider
>> planning a new BOLT document for such.
> Yes, that is the ultimate goal. I think it might be a little to soon to have a
> full-on BOLT spec. There are still some implementation details that we would
> like to address before formalizing everything. I am working to have something
> written up in the short-term documenting the approach[es] that ends up being
> solidified. Hopefully that can get some eyes during development, and perhaps
> serve as working document/rough draft.

I understand. For myself, I will also wait for comment from other c-lightning developers: this seems to require a bit of surgery on our code I think (currently construction of justice transactions is done in a separate process, and we always generate a justice transaction that claims all claimable outputs of the revoked commitment transaction), and we might decide to defer this feature for later (leaking revocation basepoint secret is easy and requires maybe a few dozen sloc, but that requires a trusted WatchTower).

Quoted text (5 lines)
>> Sorry, I seem confused this idea.  Can you give example for commitment with 2x
>> HTLC?
> Sure thing! The confirmation of second level HTLCtxns can be separated byarbitrary delays. This is particularly true if the CLTVs have already expired,offering an attacker total control over when the txns appear on the network. One way this can happen is if the attacker iteratively broadcasts a singlesecond-level txn, waits for confirmation and CSV to expire, then repeat withanother second-level txn.
> Since the CSVs begin ticking as soon as they are included in the chain, the attacker could try to sweep each one immediately after its CSV expires. If the watchtower doesn't have the ability to sweep outputs independently, it would
> have no way to intercept this behavior, and prevent the breacher from sweepingindividual HTLCs sequentially.

Ah, I thought you wanted to impose some kind of contract on HTLC-timeout/HTLC-success to enforce this behavior, you are referring to a technique that the attacker might attempt to use if we use only a single justice transaction that claims all HTLC outputs.

Quoted text (4 lines)
>> 5.  0 or 1 or 2 signatures for the main outputs. These sign a single
>> transaction that claims only the main outputs.
>
> Yes, it seems necessary to separate the commitment outpoints from the HTLCoutpoints in case the commitment txn is broadcasted before the CLTVs expire.You could try to batch these with the HTLCs, but then we get back intoexponential territory.

Agreed.

Quoted text (5 lines)
>> Is that approximately what is needed?  Have I missed anything?
>
> Nope, I think your understanding is on point. IMO this seems to be a reasonable
> compromise of the tradeoffs at hand, and definitely something that could serveas an initial iteration due to its simplicity. In the future, there are definitely ways
> to improve on this on make it even more efficient! Though having a solid/workable v0 is important if it is to be deployed. I enjoy hearing yourthoughts on this, thank you for your responses!

Thank you for this confirmation.

Regards, ZmnSCPxj

Conner Fromknecht in reply to ZmnSCPxj permalink original

Hi ZmnSCPxj,

Quoted text (11 lines)
> I understand.  For myself, I will also wait for comment from other
c-lightning
> developers: this seems to require a bit of surgery on our code I think
> (currently construction of justice transactions is done in a separate
process,
> and we always generate a justice transaction that claims all claimable
outputs
> of the revoked commitment transaction), and we might decide to defer this
> feature for later (leaking revocation basepoint secret is easy and
requires
> maybe a few dozen sloc, but that requires a trusted WatchTower).

Certainly, it will require changes to ours as well. Would also love to hear what the other implementations think of such a proposal. As of now, we detect if the commitment outputs have been spent, and if so, attempt to spend an aggregate of the commitment outputs and second-level outputs conditioned on which are reported as spent. To realize this fully, we would need to also detect the case in which the second-level txns have already been spent, and then forgo sweeping them entirely (on the assumption that it has already been done by a watchtower).

Quoted text (4 lines)
> Ah, I thought you wanted to impose some kind of contract on
> HTLC-timeout/HTLC-success to enforce this behavior, you are referring to a
> technique that the attacker might attempt to use if we use only a single
> justice transaction that claims all HTLC outputs.

Precisely, if the attacker knows that we can only sweep a particular sets of outputs when batched, they can choose other sets that the watchtower can't act on. Spending them independently seems to resolve this.

-Conner

On Tue, Apr 17, 2018 at 8:02 AM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (86 lines)
> Good morning Conner,
>
> > I understand. It would be good to know what you have, and perhaps
> consider
> > planning a new BOLT document for such.
> Yes, that is the ultimate goal. I think it might be a little to soon to
> have a
> full-on BOLT spec. There are still some implementation details that we
> would
> like to address before formalizing everything. I am working to have
> something
> written up in the short-term documenting the approach[es] that ends up
> being
> solidified. Hopefully that can get some eyes during development, and
> perhaps
> serve as working document/rough draft.
>
>
> I understand.  For myself, I will also wait for comment from other
> c-lightning developers: this seems to require a bit of surgery on our code
> I think (currently construction of justice transactions is done in a
> separate process, and we always generate a justice transaction that claims
> all claimable outputs of the revoked commitment transaction), and we might
> decide to defer this feature for later (leaking revocation basepoint secret
> is easy and requires maybe a few dozen sloc, but that requires a trusted
> WatchTower).
>
> > Sorry, I seem confused this idea.  Can you give example for commitment
> with 2x
> > HTLC?
>
> Sure thing! The confirmation of second level HTLC txns can be separated by
> arbitrary delays. This is particularly true if the CLTVs have already
> expired,
> offering an attacker total control over when the txns appear on the
> network. One
> way this can happen is if the attacker iteratively broadcasts a single
> second-level txn, waits for confirmation and CSV to expire, then repeat
> with
> another second-level txn.
>
> Since the CSVs begin ticking as soon as they are included in the chain,
> the
> attacker could try to sweep each one immediately after its CSV expires.
> If the
> watchtower doesn't have the ability to sweep outputs independently, it
> would
> have no way to intercept this behavior, and prevent the breacher from
> sweeping
> individual HTLCs sequentially.
>
> Ah, I thought you wanted to impose some kind of contract on
> HTLC-timeout/HTLC-success to enforce this behavior, you are referring to a
> technique that the attacker might attempt to use if we use only a single
> justice transaction that claims all HTLC outputs.
>
>
> > 5.  0 or 1 or 2 signatures for the main outputs. These sign a single
> > transaction that claims only the main outputs.
>
> Yes, it seems necessary to separate the commitment outpoints from the HTLC
> outpoints in case the commitment txn is broadcasted before the CLTVs
> expire.
> You could try to batch these with the HTLCs, but then we get back into
> exponential territory.
>
> Agreed.
>
> > Is that approximately what is needed?  Have I missed anything?
>
> Nope, I think your understanding is on point. IMO this seems to be a
> reasonable
> compromise of the tradeoffs at hand, and definitely something that could
> serve
> as an initial iteration due to its simplicity. In the future, there are definitely
> ways
> to improve on this on make it even more efficient! Though having a
> solid/workable v0 is important if it is to be deployed. I enjoy hearing
> your
> thoughts on this, thank you for your responses!
>
> Thank you for this confirmation.
>
> Regards,
> ZmnSCPxj
>
Conner Fromknecht in reply to Conner Fromknecht permalink original

The ability for a watchtower to spend them independently seems to resolve this* On Tue, Apr 17, 2018 at 01:30 Conner Fromknecht <conner at lightning.engineering> wrote:

Quoted text (138 lines)
> Hi ZmnSCPxj,
>
>
> > I understand.  For myself, I will also wait for comment from other
> c-lightning
> > developers: this seems to require a bit of surgery on our code I think
> > (currently construction of justice transactions is done in a separate
> process,
> > and we always generate a justice transaction that claims all claimable
> outputs
> > of the revoked commitment transaction), and we might decide to defer this
> > feature for later (leaking revocation basepoint secret is easy and
> requires
> > maybe a few dozen sloc, but that requires a trusted WatchTower).
>
> Certainly, it will require changes to ours as well. Would also love to
> hear what the
> other implementations think of such a proposal. As of now, we detect if the
>
> commitment outputs have been spent, and if so, attempt to spend an
> aggregate of
> the commitment outputs and second-level outputs conditioned on which are
> reported as spent. To realize this fully, we would need to also detect the
> case
> in which the second-level txns have already been spent, and then forgo
> sweeping
> them entirely (on the assumption that it has already been done by a
> watchtower).
>
>
>
> > Ah, I thought you wanted to impose some kind of contract on
> > HTLC-timeout/HTLC-success to enforce this behavior, you are referring
> to a
> > technique that the attacker might attempt to use if we use only a single
> > justice transaction that claims all HTLC outputs.
>
> Precisely, if the attacker knows that we can only sweep a particular sets
> of
> outputs when batched, they can choose other sets that the watchtower can't
> act
> on. Spending them independently seems to resolve this.
>
>
>
> -Conner
>
> On Tue, Apr 17, 2018 at 8:02 AM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:
>
>> Good morning Conner,
>>
>> > I understand. It would be good to know what you have, and perhaps
>> consider
>> > planning a new BOLT document for such.
>> Yes, that is the ultimate goal. I think it might be a little to soon to
>> have a
>> full-on BOLT spec. There are still some implementation details that we
>> would
>> like to address before formalizing everything. I am working to have
>> something
>> written up in the short-term documenting the approach[es] that ends up
>> being
>> solidified. Hopefully that can get some eyes during development, and
>> perhaps
>> serve as working document/rough draft.
>>
>>
>> I understand.  For myself, I will also wait for comment from other
>> c-lightning developers: this seems to require a bit of surgery on our code
>> I think (currently construction of justice transactions is done in a
>> separate process, and we always generate a justice transaction that claims
>> all claimable outputs of the revoked commitment transaction), and we might
>> decide to defer this feature for later (leaking revocation basepoint secret
>> is easy and requires maybe a few dozen sloc, but that requires a trusted
>> WatchTower).
>>
>> > Sorry, I seem confused this idea.  Can you give example for commitment
>> with 2x
>> > HTLC?
>>
>> Sure thing! The confirmation of second level HTLC txns can be separated
>> by
>> arbitrary delays. This is particularly true if the CLTVs have already
>> expired,
>> offering an attacker total control over when the txns appear on the
>> network. One
>> way this can happen is if the attacker iteratively broadcasts a single
>> second-level txn, waits for confirmation and CSV to expire, then repeat
>> with
>> another second-level txn.
>>
>> Since the CSVs begin ticking as soon as they are included in the chain,
>> the
>> attacker could try to sweep each one immediately after its CSV expires.
>> If the
>> watchtower doesn't have the ability to sweep outputs independently, it
>> would
>> have no way to intercept this behavior, and prevent the breacher from
>> sweeping
>> individual HTLCs sequentially.
>>
>> Ah, I thought you wanted to impose some kind of contract on
>> HTLC-timeout/HTLC-success to enforce this behavior, you are referring to a
>> technique that the attacker might attempt to use if we use only a single
>> justice transaction that claims all HTLC outputs.
>>
>>
>> > 5.  0 or 1 or 2 signatures for the main outputs. These sign a single
>> > transaction that claims only the main outputs.
>>
>> Yes, it seems necessary to separate the commitment outpoints from the
>> HTLC
>> outpoints in case the commitment txn is broadcasted before the CLTVs
>> expire.
>> You could try to batch these with the HTLCs, but then we get back into
>> exponential territory.
>>
>> Agreed.
>>
>> > Is that approximately what is needed?  Have I missed anything?
>>
>> Nope, I think your understanding is on point. IMO this seems to be a
>> reasonable
>> compromise of the tradeoffs at hand, and definitely something that could
>> serve
>> as an initial iteration due to its simplicity. In the future, there are definitely
>> ways
>> to improve on this on make it even more efficient! Though having a
>> solid/workable v0 is important if it is to be deployed. I enjoy hearing
>> your
>> thoughts on this, thank you for your responses!
>>
>> Thank you for this confirmation.
>>
>> Regards,
>> ZmnSCPxj
>>
>
ZmnSCPxj in reply to Conner Fromknecht permalink original

Good morning Conner,

I have an insane idea.

Quoted text (7 lines)
> One minimal solution could be to send signatures for independent sweep
> transactions, allowing the watchtower to sweep each HTLC output individually.
> This is nice because it permits the watchtower to sweep exactly the subset ofHTLCs that ever transition into the second stage, and under any permutationwrt. ordering of confirmed second stage transactions.
>
> With the single transaction per HTLC approach, the total number of signatures that
> are sent to the watchtower remains linear in the number HTLCs on the commitmenttransaction. This approach does have the downside of consuming slightly more
> fees, since each output is swept with a distinct transaction.

I consider the idea, to take this even further. Why have one blob contain data for multiple justice transactions? Since the WatchTower will make multiple justice transactions for each outpoint of the revoked commitment transaction, why not make it one-blob-one-justice?

Currently our basic idea is that a single blob is keyed to the revoked commitment txid, and contains how to claim the main outputs, and all the second-stage HTLCs from that commitment txid.

But I observe, that on the revoked commitment txid, there is exactly one output that needs to be claimed in a timely manner, and that is the output that goes to the stealing node. The output that goes to the protected node is safe, and if the second stage of the HTLC outputs are not yet claimed, those outputs are also safe.

And on the second-stage HTLC (HTLC-success or HTLC-timeout), there is also exactly one output that needs to be claimed in a timely manner.

So I consider the idea, that we create (txid[:16], blob) pairs for the commitment transaction, and separate (txid[:16], blob) pairs for each second-stage HTLC transaction, and upload all this to the WatchTower.

Each blob then only contains, encrypted:

1.  The outnum on the tx being watched for.
2.  The witness stack (signature plus witness script).
3.  The scriptpubkey to pay out to.

We could pad this so that the witness stack size does not leak whether the tx being watched is a revoked commitment transaction or a revoked HTLC-success or HTLC-timeout transaction, and also some extra padding so that if we add more possible transactions to watch (or Bitcoin makes some excessively long standard scriptpubkey), we have some space to expand into.

This greatly simplifies WatchTower construction, as justice transactions it has to synthesize are simple one-input, one-output transactions (or possibly two-output, with the other output being the WatchTower bounty; perhaps the revoking signature on the witness stack could be SIGHASH_SINGLE (is that safe???) and the first output goes to the protected node, with the rest of the value split between the WatchTower and the mining fee, and the justice transaction opt-in RBF, so that the WatchTower can balance between remaining CSV timelock available and mining fees; this would also allow the same blob to be given to different WatchTowers, for even more insurance).

We could possibly move the outnum outside the blob, and have (txid[:16], outnum, blob), with the key for lookup being (txid[:16], outnum), so that a single monitored transaction can trigger multiple justice transactions for each outnum given. This has the advantage that even if we completely change channel commitment structure, and the contracts we transport over channels (e.g. to support discreet log contracts), there will be no need to change existing WatchTowers: we always specify the entire witness stack of the justice transaction and the output of the justice transaction, and can freely change it. Whether this is a big enough advantage, I do not know.

Regards, ZmnSCPxj

ZmnSCPxj in reply to ZmnSCPxj permalink original

Good morning list,

A possible problem with the encrypted blob approach came to my mind.

A potential thief, knows the commitment transaction it will attempt to use to steal (obviously).

That potential thief, also knows the commitment transaction ID (obviously).

In the encrypted blob approach, the key is part of the commitment transaction ID.

Now it seems, that if I am a thief, and I wish to steal from (for example) Rusty while he is on vacation, I could identify the WatchTower(s) he is using, and send many (txid[16:], blob) with random blob to that WatchTower(s).

Now if the WatchTower is given a (txid[16:], blob) for a txid[16:] that it already has, but for a different blob, what should it do?

* If it ignores the new txid[16:], then I could send the invalid (txid[16:], blob) to the WatchTower before I send the revocation of the commitment to Rusty; Rusty can only send a valid (txid[16:], blob) after I send the revocation to him, after all.  Then I implcitly prevent the WatchTower from accepting the correct blob from Rusty,
* If it replaces the old txid[16:] and keeps the new pair, I could send txid[16:] to the WatchTower some time after I send the revocation to Rusty, hoping that Rusty behaves "politely" and does not spam the WatchTower repeatedly with its blob after I send my replacement.
* If it stores all the (txid[16:], blob) pairs it receives, then an obvious DoS is to flood the WatchTower with such pairs, preferably distributedly, in the hope of bringing down the WatchTower.

Now the WatchTower cannot know if it is Rusty who has the "right" to provide a given txid[16:], or me, or some other hardware I have "hired" to do my bidding. This is in fact the whole point of an encrypted blob: the WatchTower only learns about the channels (and indirectly the identity of the counterparties in the channel) if a theft attempt is actually made. Indeed, Rusty could have used Tor to contact the WatchTower (to obscure further who the WatchTower is protecting, in case the channel does not get stolen) and the WatchTower cannot know if it was actually Rusty or I (and it would leak privacy for the WatchTower to learn for certain who it is protecting, potentially allowing the WatchTower to profile Rusty spending habits).

The (txid[16:], blob) pairs I make in this attack need not have valid blob: either way the WatchTower cannot know, before I publish the entire commitment transaction, which blob came from Rusty correctly and which ones were invalid ones created by me and my army of fellow machines taking over the world.

---

An obvious solution is for the WatchTower to charge a tiny amount (micropayment, how apt) for each (txid[16:] blob) pairs it keeps. Then I cannot flood the WatchTower with poisoned blobs without at some point spending more than what I would earn by stealing.

Now Lightning itself is positioned as a micropayment platform, so the obvious logic is that the WatchTower will get paid on-Lightning. But every successful (and unsuccessful!) payment requires two channel updates, invalidating two commitment transactions and requiring two (txid[16:], blob) pairs that Rusty needs to get to a WatchTower. Obviously Rusty has to have two WatchTowers, so that he uses one WatchTower to watch the channel of the other WatchTower. But once Rusty pays to one WatchTower, he now has two (txid[16:], blob) pairs to send to the other WatchTower, which would charge for this service and require a payment. This emits two new (txid[16:], blob) pairs to send to the first WatchTower, ad infinitum, at least until Rusty runs out of money.

One way to break this loop would be for WatchTowers to provide a "prepaid watching" service,

1.  Rusty contacts two WatchTowers and gets invoices for prepaid watching.
2.  On paying an invoice for prepaid watching, Rusty gets a preimage that serves as a "ticket" (encryption key). The WatchTower who provided that preimage promises to watch up to N txids (with N much greater than 2) when presented using this ticket.  For example let us assume that an invoice for prepaid watching pays for 100 (txid[16:], blob) pairs.
3.  On paying both invoices, Rusty now has two tickets and four (txid[16:], blob) pairs.  Rusty can now put the blobs from one WatchTower to the other WatchTower, using the two tickets, and having 98 more blobs he can use on each ticket for his other Lightning activity.
4.  An obvious rule for the WatchTower to apply would be to require that, at least within a ticket, a txid[16:] cannot be duplicated.  Across tickets, txid[16:] can be duplicated.

The ticket partially obscures the privacy of Rusty: the WatchTower knows that all the blobs within a ticket are from the same node, but cannot correlate across tickets (well if Rusty always uses non-published channels to them, they can identify him easily; obviously he should publish those channels and let others route through them). Having multiple WatchTowers reduces how much each WatchTower learns about Rusty, and lets Rusty have one WatchTower watch the channel with a different WatchTower.

If I were to try stealing from Rusty, I would need to poison txid[16:] across multiple tickets. Since within a ticket, txid[16:] cannot be duplicated, I need to buy 1000 tickets to flood the WatchTowers with 1000 invalid (txid[16:],blob). Of course if I were to try stealing from all 1000 nodes on the mainnet network, I would be able to amortize that, but that would require greater preparation on my part.

Regards, ZmnSCPxj