<p>The length in a TLV uses the same variable integer representation used in Bitcoin (<code>CompactSize</code>). It effectively supports up to 64bit lengths, so there is no meaningful limitation there.</p>

<p>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.</p>

<p>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.</p>

CC BY-SA 4.0
2019-10-30T04:04:16.773Z
I thought the [LND 0.8 release](https://github.com/lightningnetwork/lnd/releases) actually included support for TLV based onion format.
Ugam Kamat
CC BY-SA 4.0
2019-10-30T00:10:22.467Z
2019-10-30T00:10:22.467Z
Mark H
<p>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?</p>

<lightning-network>
Is there a limit to the TLV size?
Murch
# Is there a limit to the TLV size?

(Asked by: username_0 on 2019-10-29)

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?

**Tags:** lightning-network


---

## 1 answers

### Answer by username_1 on 2019-10-30. Score: 2 | Accepted 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.

> **Comments:**
> **username_2**: I thought the [LND 0.8 release](https://github.com/lightningnetwork/lnd/releases) actually included support for TLV based onion format.  

---

