lightning / bolts

BOLT: Basis of Lightning Technology (Lightning Network Specifications)
2.05k stars 490 forks source link

BOLT-4: Decrypt onion using b_i or k_i #1159

Open dple opened 2 months ago

dple commented 2 months ago

Lines 519-523 said that using b_i or k_i to DECRYPT the onion, but there is no guide showing how to ENCRYPT the onion using B_i or N_i

t-bast commented 2 months ago

This is done exactly like non-blinded onions, as described here: https://github.com/lightning/bolts/blob/master/04-onion-routing.md#packet-construction

The only trick is that you use the blinded keys and node IDs instead of the plaintext one, but everything else works the same.

dple commented 2 months ago

@t-bast : not sure if I fully understand that section, but it seems you are using the XOR technique to obfuscate the hop_payloads for non-blinded onions, and as my understanding you want to use B_i or N_i to encrypt the blinded onion, is it correct?