[docs]: Confusion in code comments regarding the encryption of justice-kit #9169
Labels
inline documentation
documentation within the code
P4
low prio
question
Support questions, not issues with the code
watchtower
Milestone
Background
I recently started learning about watchtowers. Many online papers explain that watchtowers receive from clients the parameters for the revocation transaction (a.k.a justice-kit?) in the following way:
This is useful for privacy reasons - no need for the watchtower to know about the revocation transaction in the optimistic use-case, where the breach transaction is not submitted.
However, I've noticed from your code that:
SHA256
of the trasnaction-id:lnd/watchtower/blob/derivation.go
Lines 18 to 26 in 0dd58ee
SHA256(txid || txid)
:lnd/watchtower/blob/derivation.go
Lines 53 to 71 in 0dd58ee
This makes sense from a cryptographic viewpoint, because revealing to the watchtower even half of the encryption-key is a bad practice, and its better to have both the hint and the encryption-key derived from hashing the transaction-id. However, I think there are some comments left from the old implementation that don't make sense:
lnd/watchtower/wtclient/backup_task.go
Lines 342 to 343 in 0dd58ee
SHA256(txid || txid)
, and says nothing about the hint that is also calculated there.lnd/watchtower/wtclient/backup_task_internal_test.go
Line 655 in 0dd58ee
SHA256
of the full txid, not only the txid's prefix.lnd/watchtower/lookout/lookout.go
Lines 203 to 208 in 0dd58ee
SHA256(txid || txid)
The text was updated successfully, but these errors were encountered: