The maximum acceptable max_accepted_htlcs
(maximum number of HTLCs forwarded concurrently) is specified by the BOLTS as being 483
.
How was this value chosen ?
The maximum acceptable max_accepted_htlcs
(maximum number of HTLCs forwarded concurrently) is specified by the BOLTS as being 483
.
How was this value chosen ?
The rationale is given in BOLT #2:
max_accepted_htlcs
is limited to 483 to ensure that, even if both sides send the maximum number of HTLCs, thecommitment_signed
message will still be under the maximum message size. It also ensures that a single penalty transaction can spend the entire commitment transaction, as calculated in BOLT #5.
The maximum message size is set in BOLT #8 to about 65kB. Therefore it is necessary to limit the size of a commitment transaction, which is otherwise bounded by the block size (4M Weight Units) according to consensus and the maximum standard transaction size (400k Weight Units) according to relay policy.
The second part of the rationale is maybe less clear. An outgoing HTLC in your channel adds an output to each of the two commitment transactions. Same for an incoming HTLC. The limit therefore makes it so there is at most 966 HTLC outputs in a single transaction.
The calculation in BOLT #5 to justify this choice is the following:
max_num_htlcs = (400000 - 324 - 272 - (4 * 53) - 2) / 413 = 966
Here is what each of the number corresponds to:
The maximum standard weight is a restriction on bitcoin transaction size. It's the maximum weight that a transaction can have to be 'standard', which means it is still relayed by unmodified bitcoin core nodes. You could have a bigger tx in a block, but you would probably have to find a miner yourself that is willing to include it.
The concept of weight is important here, it's the new way of measuring transaction size since segwit and is thoroughly described here
Aside from that, what exactly don't you understand in the calculation?
max_num_htlcs
turns into 966. What does (400000 - 324 - 272 - (4 * 53) - 2) / 413
mean?