I hear that a TLV field was recently added to the payment format. This will allow the sender to attach a message to the recipient in the payment package. How much data can be included in the TLV field? Are there other restrictions that apply? When will this be available on mainnet?
1 Answer
The length in a TLV uses the same variable integer representation used in Bitcoin (CompactSize
). It effectively supports up to 64bit lengths, so there is no meaningful limitation there.
The limitation comes down to LN's message size limit, which is 64kb, as defined in BOLT#8. Any TLV will need to discount bytes already used in the message from this upper limit. Additionally, any TLV used in the onion layer will be limited by the maximum 1300 byte onion payload size, and bytes available to use for TLV fields will vary depending on the number of hops involved in the route.
Hard to say when it will be available. At this stage, the BOLTs are still a work in progress specification, and the plans for the 1.1 version could change.
-
I thought the LND 0.8 release actually included support for TLV based onion format. Commented Oct 30, 2019 at 4:04