Edited 10_onion_routing.asciidoc with Atlas code editor

pull/899/head
kristen@oreilly.com 3 years ago
parent b9aaf07435
commit b02a7d9216

@ -91,7 +91,7 @@ This is the essence of onion routing. The sender wraps a message in layers, spec
Now, let's look at the details of the onion routing implementation in the Lightning Network.
=== Introduction to Onion Routing of Htlcs
=== Introduction to Onion Routing of HTLCs
Onion routing in the Lightning Network appears complex at first glance, but once you understand the basic concept is really quite simple.
@ -587,7 +587,7 @@ image::images/mtln_1015.png[]
In this section we will look at how the onion packet is forwarded and how HTLCs are deployed along the path.
==== The Update_Add_Htlc Message
==== The update_add_htlc Message
Onion packets are sent as part of the +update_add_htlc+ message. If you recall from <<update_add_htlc>>, in <<channel_operation>>, we saw the contents of the +update_add_htlc+ message were as follows:
@ -663,7 +663,7 @@ At the same time, applying the +rho+ byte stream to the 1300 zeroes that were ad
.Bob de-obfuscates the onion, obfuscates the filler
image::images/mtln_1024.png["Bob de-obfuscates the onion, obfuscates the filler"]
==== Bob Extracts the Outer Hmac for the Next Hop
==== Bob Extracts the Outer HMAC for the Next Hop
Remember that an inner HMAC is included for each hop, then will then become the outer HMAC for the _next_ hop.
In this case, Bob extracts the inner HMAC (he's already verified the integrity of the encrypted packet w/ the outer HMAC), and puts it aside as he'll append it to the deobfuscated packet to allow Chan to verify the HMAC of her encrypted packet.
@ -698,7 +698,7 @@ session_key_chan = session_key_bob * b_bob
The `session_key_chan` public key will then be appended to the front of the onion packet for processing by Chan.
==== Bob Verifies the Htlc Details
==== Bob Verifies the HTLC Details
Bob's hop payload contains the instructions needed to create an HTLC for Chan.
@ -710,7 +710,7 @@ Next, Bob confirms that the outgoing amount (50,100 satoshis) is less than the i
Similarly, Bob checks that the outgoing cltv_expiry is less than the incoming cltv_expiry giving Bob enough time to claim the incoming HTLC if there is a breach.
==== Bob Sends the Update_Add_Htlc to Chan
==== Bob Sends the update_add_htlc to Chan
Bob now constructs and HTLC to send to Chan, as follows:
@ -742,7 +742,7 @@ Chan repeats the exact same process as Bob:
6. Chan uses the generated byte stream to XOR and de-obfuscate the onion payload. Simultaneously the XOR operation obfuscates the extra 1300 zeroes, turning them into filler
7. Chan extracts the inner HMAC in the payload, which will become the outer HAMC for Dina.
7. Chan extracts the inner HMAC in the payload, which will become the outer HMAC for Dina.
8. Chan removes his hop payload and left-shifts the onion payload by the same amount. Some of the filler generated in the 1300 extended bytes move into the first-half 1300 bytes becoming part of the onion payload.
@ -844,7 +844,7 @@ first? The `keysend` protocol is an end-to-end extension (only the sender and
receiver are aware) to the Lightning protocol that enables spontaneous push
payments.
==== Custom Onion Tlv Records
==== Custom Onion TLV Records
The modern Lightning protocol uses the TLV (Type-Length-Value) encoding in
the onion to encode information that tells each node _where_ and _how_ to

Loading…
Cancel
Save