lightninglabs / lightning-terminal

Lightning Terminal: Your Home for Lightning Liquidity
MIT License
488 stars 82 forks source link

firewall: session-dependent privacy flags #746

Closed bitromortac closed 1 month ago

bitromortac commented 2 months ago

This PR adds functionality for the autopilot privacy mapper that enables to selectively reveal data that otherwise is obfuscated by default. This is necessary in order to support more advanced autopilot features, such as the soon to be added automatic channel open service. In this case it is necessary to communicate litd's node pubkey to the service (via GetInfo) in order for it to be able to make high-quality node suggestions, taking the nodes's position within the graph into account. Uncovering pubkeys will also be necessary in order to know the peers with which force closes have happened, to not open new channels, or to check whether channels with liquidity already exist. It is nevertheless important to still obfuscate precise channel balances and other information. This is why privacy flags are introduced (in the auto open example it is the ClearPubkeys flag), which define the precise deobfuscation within a session for the following interaction points:

Privacy obfuscation remains on by default and AutoFee's privacy properties remain unaltered. Features can be registered together in a single session, whereby the session's privacy flags will be the union of privacy flags of all the features (which is why feature registration is recommended to be done in individual sessions). When linking sessions, privacy flags must be preserved accross the linked sessions, which is checked by autopilot.