Better privacy with SNARKs



Summary:

In a discussion over email, Anthony Towns suggested a method for translating pseudocode into script for the purpose of adding privacy to how hash time-locked contracts (HTLCs) are cleared on the blockchain. By revealing P/Q/R, it is possible to add privacy at the cost of an extra 236 bytes per HTLC per channel when cleared on the blockchain. The extra cost is approximately 3 cents per HTLC. Furthermore, in order to include commitments in transactions, a minimal HTLC would require 117 bytes plus another 67 bytes for the signature and branch code. To spend an HTLC, additional bits for a txin are necessary, which adds 42 bytes. When claiming an HTLC, this overhead amounts to around an extra 80% while refunding only requires an extra 11%. With these costs in mind, it may be more economical to forget a 2 cent HTLC than to commit it. However, if remaining open to very small microtransactions, accounting for at least 4 cents per HTLC for closing fees may still be worth it.


Updated on: 2023-05-18T15:48:00.589239+00:00