user97124: Why is the description field in a Lightning Network invoice limited to 639 bytes?
https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md#tagged-fields
https://github.com/lightningnetwork/lnd/blob/95502da7e87d7f1ae96e9d69fcdb2f1b038d6497/channeldb/invoices.go#L85 (LND limits it to 1024)
I would like to send data over the lightning network using the description field for the anonymizing aspects of onion routing in conjunction with the economic incentive for honest nodes.

user90837: 
Why is the description field limited to 639 bytes?

Every field in lightning invoice is of the form:

type (5 bits)
data_length (10 bits, big-endian)
data (data_length x 5 bits)

The data_length indicates the size of the data that is to be followed. Since data_length itself has a size of 10 bits, it can represent a number up to 1023 (210 -1). Thus the size of data can be at most 1023*5 bits or 639.375 bytes. This puts the upper limit of 639 bytes on the description field.

97124: <p>Why is the description field in a Lightning Network invoice limited to 639 bytes?</p>

<p><a href="https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md#tagged-fields" rel="nofollow noreferrer">https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md#tagged-fields</a></p>

<p><a href="https://github.com/lightningnetwork/lnd/blob/95502da7e87d7f1ae96e9d69fcdb2f1b038d6497/channeldb/invoices.go#L85" rel="nofollow noreferrer">https://github.com/lightningnetwork/lnd/blob/95502da7e87d7f1ae96e9d69fcdb2f1b038d6497/channeldb/invoices.go#L85</a> (LND limits it to 1024)</p>

<p>I would like to send data over the lightning network using the description field for the anonymizing aspects of onion routing in conjunction with the economic incentive for honest nodes.</p>
 90837: <blockquote>
  <p>Why is the description field limited to 639 bytes?</p>
</blockquote>

<p>Every field in lightning invoice is of the form:</p>

<ol>
<li><code>type</code> (5 bits)</li>
<li><code>data_length</code> (10 bits, big-endian)</li>
<li><code>data</code> (<code>data_length</code> x 5 bits)</li>
</ol>

<p>The <code>data_length</code> indicates the size of the <code>data</code> that is to be followed. Since <code>data_length</code> itself has a size of 10 bits, it can represent a number up to 1023 (2<sup>10</sup> -1). Thus the size of <code>data</code> can be at most 1023*5 bits or 639.375 bytes. This puts the upper limit of 639 bytes on the description field.</p>
