Trampoline routing.
- trampoline is enabled by default in config, to prevent download of `gossip_db`.
(if disabled, `gossip_db` will be downloaded, regardless of the existence of channels)
- if trampoline is enabled:
- the wallet can only open channels with trampoline nodes
- already-existing channels with non-trampoline nodes are frozen for sending.
- there are two types of trampoline payments: legacy and end-to-end (e2e).
- we decide to perform legacy or e2e based on the invoice:
- we use trampoline_routing_opt in features to detect Eclair and Phoenix invoices
- we use trampoline_routing_hints to detect Electrum invoices
- when trying a legacy payment, we add a second trampoline to the path to preserve privacy.
(we fall back to a single trampoline if the payment fails for all trampolines)
- the trampoline list is hardcoded, it will remain so until `trampoline_routing_opt` feature flag is in INIT.
- there are currently only two nodes in the hardcoded list, it would be nice to have more.
- similar to Phoenix, we find the fee/cltv by trial-and-error.
- if there is a second trampoline in the path, we use the same fee for both.
- the final spec should add fee info in error messages, so we will be able to fine-tune fees
This commit is contained in:
@@ -7,6 +7,17 @@ tlvdata,tlv_payload,short_channel_id,short_channel_id,short_channel_id,
|
||||
tlvtype,tlv_payload,payment_data,8
|
||||
tlvdata,tlv_payload,payment_data,payment_secret,byte,32
|
||||
tlvdata,tlv_payload,payment_data,total_msat,tu64,
|
||||
tlvtype,tlv_payload,invoice_features,66097
|
||||
tlvdata,tlv_payload,invoice_features,invoice_features,u64,
|
||||
tlvtype,tlv_payload,outgoing_node_id,66098
|
||||
tlvdata,tlv_payload,outgoing_node_id,outgoing_node_id,byte,33
|
||||
tlvtype,tlv_payload,invoice_routing_info,66099
|
||||
tlvdata,tlv_payload,invoice_routing_info,invoice_routing_info,byte,...
|
||||
tlvtype,tlv_payload,trampoline_onion_packet,66100
|
||||
tlvdata,tlv_payload,trampoline_onion_packet,version,byte,1
|
||||
tlvdata,tlv_payload,trampoline_onion_packet,public_key,byte,33
|
||||
tlvdata,tlv_payload,trampoline_onion_packet,hops_data,byte,400
|
||||
tlvdata,tlv_payload,trampoline_onion_packet,hmac,byte,32
|
||||
msgtype,invalid_realm,PERM|1
|
||||
msgtype,temporary_node_failure,NODE|2
|
||||
msgtype,permanent_node_failure,PERM|NODE|2
|
||||
|
||||
|
Reference in New Issue
Block a user