add images

This commit is contained in:
Bitcoin Txoko
2024-12-03 15:40:02 +01:00
committed by GitHub
parent 54ee759fb0
commit 41f4f9b0d7
+18 -18
View File
@@ -39,11 +39,11 @@ A channel is opened once both parties have the ability to fully sign their respe
At the moment, we still don't know anything about the parameters of the channel so all fields have a white background: At the moment, we still don't know anything about the parameters of the channel so all fields have a white background:
![fntx_1]() ![fntx_1](https://cdn.satellite.earth/11e23fa62ffd3aef7c74c9e974e761d3fd2281f520dc416ac57aabe792d9df12.png)
![1a_1]() ![1a_1](https://cdn.satellite.earth/80de863cbbbcbbf7299fa4482514f9bbb0d49975da85081dbef139fde0a005cb.png)
![1b_1]() ![1b_1](https://cdn.satellite.earth/e3ade9211cb044d62d274576f4ea8ba0d4b1c4a742d7c7d9a3c6efe372c1841a.png)
#### The open_channel message #### The open_channel message
@@ -66,13 +66,13 @@ The first step of the process is Alice deciding she wants to open a channel to B
Let's now fill in Alice's values for these fields: Let's now fill in Alice's values for these fields:
![open_chan]() ![open_chan](https://cdn.satellite.earth/d3fb90bf1d617fbc87256f3aab78f5cc5ad9c0b13d40f38ffd7870b984cc2ca0.png)
Alice sends this message to Bob. Alice sends this message to Bob.
Since Alice has decided on the the type of channel she wants to open (legacy as opposed to anchors, taproot etc) as well as the channel capacity, she can already piece together quite a large part of the funding transaction: Since Alice has decided on the the type of channel she wants to open (legacy as opposed to anchors, taproot etc) as well as the channel capacity, she can already piece together quite a large part of the funding transaction:
![fntx_2]() ![fntx_2](https://cdn.satellite.earth/410c57e93a84194f789f06457fc9903c58631ba76c665d7ed818743c8a7bc708.png)
Alice can already choose some of her UTXOs to be inputs to the funding transaction since she knows the capacity of the channel she wants to open. However she does not yet know which pubkey Bob would want to use for the channel, so she cannot finalise the channel funding output just yet, and therefore cannot yet produce signatures for the inputs. Alice can already choose some of her UTXOs to be inputs to the funding transaction since she knows the capacity of the channel she wants to open. However she does not yet know which pubkey Bob would want to use for the channel, so she cannot finalise the channel funding output just yet, and therefore cannot yet produce signatures for the inputs.
@@ -80,13 +80,13 @@ As Alice has decided on the channel type (and thus the commitment transaction st
Let's see what pieces they are already able to fill in: Let's see what pieces they are already able to fill in:
![1a_2]() ![1a_2](https://cdn.satellite.earth/206248c74d657e415936292b1b45521bc2d40dcae0e9665d939a5043777935b7.png)
Alice's commitment transaction has the structure of a default, non-anchor channel transaction. All her public keys have been filled in (`alice_local_delayed_pk_1` is derived using her `delayed_payment_basepoint` and her `first_commitment_point`). Since she hasn't received any messages from Bob yet, she cannot fill in any of his pubkeys. And since the funding transaction is still incomplete, she also can't know the TXID to point the input of this commitment transaction to. Alice's commitment transaction has the structure of a default, non-anchor channel transaction. All her public keys have been filled in (`alice_local_delayed_pk_1` is derived using her `delayed_payment_basepoint` and her `first_commitment_point`). Since she hasn't received any messages from Bob yet, she cannot fill in any of his pubkeys. And since the funding transaction is still incomplete, she also can't know the TXID to point the input of this commitment transaction to.
Bob's commitment transaction is looking slightly more complete: Bob's commitment transaction is looking slightly more complete:
![1b_2]() ![1b_2](https://cdn.satellite.earth/4b26b4fd01108e56ad86f4441b2b705490de7b05f521ee18da3e8cb8b6b56c35.png)
Like Alice, he also cannot yet fill in the funding transaction's TXID, but he can fill in a few other things: Like Alice, he also cannot yet fill in the funding transaction's TXID, but he can fill in a few other things:
- The `alice_pubkey_1`, `alice_to_self_delay`, `push_amt` and `local_amt` values are taken as is from the `open_channel` message. - The `alice_pubkey_1`, `alice_to_self_delay`, `push_amt` and `local_amt` values are taken as is from the `open_channel` message.
@@ -99,11 +99,11 @@ Cool! Time for Bob to indicate to Alice his acceptance of the proposal by sendin
The message shares many of the fields from `open_channel`. Here's the message that Bob will put together. The message shares many of the fields from `open_channel`. Here's the message that Bob will put together.
![accept_channel]() ![accept_channel](https://cdn.satellite.earth/b57b6253f8b62ea8419c9ee957573de09fb7a98b124b97c57b0da49bad0ecea8.png)
When Alice gets this message from Bob, she can now complete the funding transaction's output and can create the signatures for the inputs. Since everything is now filled in, the TXID of the funding transaction is also known. When Alice gets this message from Bob, she can now complete the funding transaction's output and can create the signatures for the inputs. Since everything is now filled in, the TXID of the funding transaction is also known.
![fntx_3]() ![fntx_3](https://cdn.satellite.earth/3433eea789ced15ddbdaf4689fb880052525054943779033a32e834b657260e2.png)
Alice can now fill in some more of her own commitment transaction: Alice can now fill in some more of her own commitment transaction:
- she can now use the values sent by Bob to fill in `bob_pubkey_1`, `bob_payment_key_1`, `bob_to_self_delay` and `revoke_pubkey_1a` - she can now use the values sent by Bob to fill in `bob_pubkey_1`, `bob_payment_key_1`, `bob_to_self_delay` and `revoke_pubkey_1a`
@@ -111,7 +111,7 @@ Alice can now fill in some more of her own commitment transaction:
She now knows everything she needs to know in order to sign this transaction herself _but_ remember she is still missing Bob's signature for this transaction. She now knows everything she needs to know in order to sign this transaction herself _but_ remember she is still missing Bob's signature for this transaction.
![1a_3]() ![1a_3](https://cdn.satellite.earth/662e5378a43cd50dd82808485c5466e44cb8f16ed3d3ca8d121300718903afe3.png)
Bob's commitment transaction is still the same as before since he learned no new information after sending the `accept_channel` message. Bob's commitment transaction is still the same as before since he learned no new information after sending the `accept_channel` message.
@@ -121,29 +121,29 @@ Now that Alice knows the TXID of the funding transacation, she is also able to c
Alice will now use the `funding_created` message to tell Bob the TXID and the index of the funding transaction along with her signature for Bob's commitment transaction. Note that Bob still won't be able to broadcast his commitment transaction because the funding transaction hasn't been broadcasted yet. Alice will now use the `funding_created` message to tell Bob the TXID and the index of the funding transaction along with her signature for Bob's commitment transaction. Note that Bob still won't be able to broadcast his commitment transaction because the funding transaction hasn't been broadcasted yet.
![funding_created]() ![funding_created](https://cdn.satellite.earth/d7a5c1e3a4295383b0bf0c9e867c1042d6ad1fc62cec5c12380063ee7ef18d17.png)
Once Bob receives the `funding_created` message, he can fill in the rest of his commitment transaction: Once Bob receives the `funding_created` message, he can fill in the rest of his commitment transaction:
![1b_3]() ![1b_3](https://cdn.satellite.earth/0d142d4582c77146867b010cd8006020cdcd25e4ab25233e3fd949a558e5973b.png)
#### The funding_signed message #### The funding_signed message
Alice won't broadcast the funding transaction until she has a valid signature from Bob for her commitment transaction, enter `funding_signed`: Alice won't broadcast the funding transaction until she has a valid signature from Bob for her commitment transaction, enter `funding_signed`:
![funding_signed]() ![funding_signed](https://cdn.satellite.earth/10d90224de4aeeb8a071c2165656bad8a54baff7b8fd243eddf1d4e3d3f5516b.png)
Notice that this is the first message to use the real channel ID instead of the temporary one. Notice that this is the first message to use the real channel ID instead of the temporary one.
This was the last piece of the puzzle for Alice. She now has all the info she needs to be able to sign her commitment transaction if ever needed. This was the last piece of the puzzle for Alice. She now has all the info she needs to be able to sign her commitment transaction if ever needed.
![1a_4]() ![1a_4](https://cdn.satellite.earth/2ac1da27295d120cca593bc0e0159efb00b357cb9434ffd39d9b2a08c223133f.png)
#### The channel_ready message #### The channel_ready message
Alice can now safely broadcast the funding transaction. Both Alice and Bob will watch the chain for the confirmation of the funding transaction. Once it has reached `minimum_depth` specified by Bob in his `accept_channel` message, both sides will exchange the `channel_ready` message. This message serves two purposes. First, it serves as a signal to the peer to indicate that the channel is ready to use (and they can start the channel announcement process if they opened a public, announced channel). Second, it also tells the peer to send across their `second_per_commitment_point` that they should use in their second commitment transaction. Alice can now safely broadcast the funding transaction. Both Alice and Bob will watch the chain for the confirmation of the funding transaction. Once it has reached `minimum_depth` specified by Bob in his `accept_channel` message, both sides will exchange the `channel_ready` message. This message serves two purposes. First, it serves as a signal to the peer to indicate that the channel is ready to use (and they can start the channel announcement process if they opened a public, announced channel). Second, it also tells the peer to send across their `second_per_commitment_point` that they should use in their second commitment transaction.
![channel_ready]() ![channel_ready](https://cdn.satellite.earth/ac0228466fb41f5cada898186fcdcbb4677cc397a38174380b88309dad2502d4.png)
### Announcing the channel ### Announcing the channel
@@ -155,15 +155,15 @@ This part is fairly easy. Alice and Bob just need to construct one message, `cha
A partial version of the `channel_announcement` message looks like this: A partial version of the `channel_announcement` message looks like this:
![channel_announcement]() ![channel_announcement](https://cdn.satellite.earth/29805c4ee082006f068ee0d5991a46eeb04c1b2fd3f80d00f465c30891f49477.png)
`h` is the hash of all the data that will be covered by the signatures. In order to complete this message, both Alice and Bob need to compute a signature over `h` using the private keys associated with their node IDs and the pubkeys they used in the funding transaction. They then both exchange the `announcement_signatures` message in order to communicate these signatures to each other. `h` is the hash of all the data that will be covered by the signatures. In order to complete this message, both Alice and Bob need to compute a signature over `h` using the private keys associated with their node IDs and the pubkeys they used in the funding transaction. They then both exchange the `announcement_signatures` message in order to communicate these signatures to each other.
![announcement_sig]() ![announcement_sig](https://cdn.satellite.earth/454b67831824991a423e1c8cf5cab3be25753ec800d3dba8970d24a14dde425b.png)
Now both nodes can put together the complete `channel_announcement` message: Now both nodes can put together the complete `channel_announcement` message:
![channel_announcement_2]() ![channel_announcement_2](https://cdn.satellite.earth/b68e0f7cd8ee084d01592f88735d0385aaec5e114e4da3ebee2992952ab456cf.png)
Let's say Charlie is a node that received this message. Let's go over the steps that he will go through in order to verify the new channel that Alice and Bob have announced: Let's say Charlie is a node that received this message. Let's go over the steps that he will go through in order to verify the new channel that Alice and Bob have announced: