Post
Topic
Board Bitcoin Discussion
Re: [self-moderated] Is LN Bitcoin? franky1: About scaling, on-chain and off-chain
by
Rath_
on 16/01/2022, 22:08:26 UTC
https://github.com/lightning/bolts/blob/master/04-onion-routing.md#legacy-hop_data-payload-format

the amount is in Msat, and does not contain keys, or HTLC for a commitment.
it is not sending a signature or HTLC to change a channels commitment HTLC

There are no keys or signatures in here because "hop_data" consists only of routing instructions for the current hop.

We have already agreed that "hop_data" is a part of "onion_routing_packet" which can be sent only through "update_add_htlc". Knowing all of that...


Here's what a proper message should look like:

Code:
Type: 128 (update_add_htlc)
Payload:
○ 32: channel_id
○ 8: id
○ 8: amount_msat
○ 32: payment_hash
○ 4: cltv_expiry
○ 1366: onion_routing_packet

Your message would look like this:

Code:
Type: ???
Payload:
○ 1300: hop_data

This is wrong because:
a) "hop_data" is encrypted. "onion_routing_packet" contains a compressed public key which was used to generate a shared secret for all hops. Thus, sending just "hop_data" doesn't make sense.
b) as your message would be non-standard (no type), the receiving node would ignore your message.

Code: (https://github.com/lightning/bolts/blob/master/01-messaging.md)
A receiving node:
upon receiving a message of odd, unknown type:
    MUST ignore the received message.
upon receiving a message of even, unknown type:
    MUST close the connection.
    MAY fail the channels.