9.1 KiB
9.1 KiB
| 1 | #include <bitcoin/chainparams.h> | ||||
|---|---|---|---|---|---|
| 2 | #include <bitcoin/psbt.h> | ||||
| 3 | #include <common/cryptomsg.h> | ||||
| 4 | #include <common/channel_config.h> | ||||
| 5 | #include <common/channel_id.h> | ||||
| 6 | #include <common/derive_basepoints.h> | ||||
| 7 | #include <common/features.h> | ||||
| 8 | #include <common/fee_states.h> | ||||
| 9 | #include <common/htlc_wire.h> | ||||
| 10 | #include <common/penalty_base.h> | ||||
| 11 | #include <common/per_peer_state.h> | ||||
| 12 | msgtype | dualopend_init | 7000 | ||
| 13 | # Which network are we configured for? | ||||
| 14 | msgdata | dualopend_init | chainparams | chainparams | |
| 15 | msgdata | dualopend_init | our_feature_set | feature_set | |
| 16 | msgdata | dualopend_init | their_init_features_len | u16 | |
| 17 | msgdata | dualopend_init | their_init_features | u8 | their_init_features_len |
| 18 | # Base configuration we'll offer | ||||
| 19 | msgdata | dualopend_init | our_config | channel_config | |
| 20 | # Minimum/maximum configuration values we'll accept | ||||
| 21 | msgdata | dualopend_init | max_to_self_delay | u32 | |
| 22 | msgdata | dualopend_init | min_effective_htlc_capacity_msat | amount_msat | |
| 23 | msgdata | dualopend_init | pps | per_peer_state | |
| 24 | msgdata | dualopend_init | our_basepoints | basepoints | |
| 25 | msgdata | dualopend_init | our_funding_pubkey | pubkey | |
| 26 | # Constraints in case the other end tries to open a channel. | ||||
| 27 | msgdata | dualopend_init | minimum_depth | u32 | |
| 28 | # master-dualopend: peer has reconnected | ||||
| 29 | msgtype | dualopend_reinit | 7001 | ||
| 30 | msgdata | dualopend_reinit | chainparams | chainparams | |
| 31 | msgdata | dualopend_reinit | our_feature_set | feature_set | |
| 32 | msgdata | dualopend_reinit | their_init_features_len | u16 | |
| 33 | msgdata | dualopend_reinit | their_init_features | u8 | their_init_features_len |
| 34 | msgdata | dualopend_reinit | our_config | channel_config | |
| 35 | msgdata | dualopend_reinit | their_config | channel_config | |
| 36 | msgdata | dualopend_reinit | channel_id | channel_id | |
| 37 | msgdata | dualopend_reinit | max_to_self_delay | u32 | |
| 38 | msgdata | dualopend_reinit | min_effective_htlc_capacity_msat | amount_msat | |
| 39 | msgdata | dualopend_reinit | pps | per_peer_state | |
| 40 | msgdata | dualopend_reinit | our_basepoints | basepoints | |
| 41 | msgdata | dualopend_reinit | our_funding_pubkey | pubkey | |
| 42 | msgdata | dualopend_reinit | their_funding_pubkey | pubkey | |
| 43 | msgdata | dualopend_reinit | minimum_depth | u32 | |
| 44 | msgdata | dualopend_reinit | funding_txid | bitcoin_txid | |
| 45 | msgdata | dualopend_reinit | funding_txout | u16 | |
| 46 | msgdata | dualopend_reinit | orignal_feerate_per_kw_funding | u32 | |
| 47 | msgdata | dualopend_reinit | most_recent_feerate_per_kw_funding | u32 | |
| 48 | msgdata | dualopend_reinit | funding_satoshi | amount_sat | |
| 49 | msgdata | dualopend_reinit | our_funding | amount_msat | |
| 50 | msgdata | dualopend_reinit | their_basepoints | basepoints | |
| 51 | msgdata | dualopend_reinit | remote_per_commit | pubkey | |
| 52 | msgdata | dualopend_reinit | funding_psbt | wally_psbt | |
| 53 | msgdata | dualopend_reinit | opener | enum side | |
| 54 | msgdata | dualopend_reinit | local_funding_locked | bool | |
| 55 | msgdata | dualopend_reinit | remote_funding_locked | bool | |
| 56 | msgdata | dualopend_reinit | send_shutdown | bool | |
| 57 | msgdata | dualopend_reinit | remote_shutdown_received | bool | |
| 58 | msgdata | dualopend_reinit | local_shutdown_len | u16 | |
| 59 | msgdata | dualopend_reinit | local_shutdown_scriptpubkey | u8 | local_shutdown_len |
| 60 | msgdata | dualopend_reinit | remote_shutdown_len | u16 | |
| 61 | msgdata | dualopend_reinit | remote_shutdown_scriptpubkey | u8 | remote_shutdown_len |
| 62 | msgdata | dualopend_reinit | remote_funding_sigs_received | bool | |
| 63 | msgdata | dualopend_reinit | fee_states | fee_states | |
| 64 | msgdata | dualopend_reinit | channel_flags | u8 | |
| 65 | # dualopend->master: they offered channel | should we continue? | |||
| 66 | msgtype | dualopend_got_offer | 7005 | ||
| 67 | msgdata | dualopend_got_offer | channel_id | channel_id | |
| 68 | msgdata | dualopend_got_offer | opener_funding | amount_sat | |
| 69 | msgdata | dualopend_got_offer | dust_limit_satoshis | amount_sat | |
| 70 | msgdata | dualopend_got_offer | max_htlc_value_in_flight_msat | amount_msat | |
| 71 | msgdata | dualopend_got_offer | htlc_minimum_msat | amount_msat | |
| 72 | msgdata | dualopend_got_offer | feerate_per_kw_funding | u32 | |
| 73 | msgdata | dualopend_got_offer | feerate_per_kw_commitment | u32 | |
| 74 | msgdata | dualopend_got_offer | to_self_delay | u16 | |
| 75 | msgdata | dualopend_got_offer | max_accepted_htlcs | u16 | |
| 76 | msgdata | dualopend_got_offer | channel_flags | u8 | |
| 77 | msgdata | dualopend_got_offer | locktime | u32 | |
| 78 | msgdata | dualopend_got_offer | shutdown_len | u16 | |
| 79 | msgdata | dualopend_got_offer | shutdown_scriptpubkey | u8 | shutdown_len |
| 80 | # master->dualopend: reply back with our first funding info/contribs | ||||
| 81 | msgtype | dualopend_got_offer_reply | 7105 | ||
| 82 | msgdata | dualopend_got_offer_reply | accepter_funding | amount_sat | |
| 83 | msgdata | dualopend_got_offer_reply | psbt | wally_psbt | |
| 84 | msgdata | dualopend_got_offer_reply | shutdown_len | u16 | |
| 85 | msgdata | dualopend_got_offer_reply | our_shutdown_scriptpubkey | ?u8 | shutdown_len |
| 86 | # dualopend->master: they offered a RBF | should we continue? | |||
| 87 | msgtype | dualopend_got_rbf_offer | 7500 | ||
| 88 | msgdata | dualopend_got_rbf_offer | channel_id | channel_id | |
| 89 | msgdata | dualopend_got_rbf_offer | their_funding | amount_sat | |
| 90 | msgdata | dualopend_got_rbf_offer | funding_feerate_per_kw | u32 | |
| 91 | msgdata | dualopend_got_rbf_offer | locktime | u32 | |
| 92 | # master->dualopend: reply back with our funding info/contribs | ||||
| 93 | msgtype | dualopend_got_rbf_offer_reply | 7505 | ||
| 94 | msgdata | dualopend_got_rbf_offer_reply | our_funding | amount_sat | |
| 95 | msgdata | dualopend_got_rbf_offer_reply | psbt | wally_psbt | |
| 96 | # dualopend->master: is this a valid RBF candidate transaction? | ||||
| 97 | msgtype | dualopend_rbf_validate | 7506 | ||
| 98 | msgdata | dualopend_rbf_validate | proposed_funding_psbt | wally_psbt | |
| 99 | # master->dualopend: this is a valid RBF candidate transaction | ||||
| 100 | msgtype | dualopend_rbf_valid | 7507 | ||
| 101 | # master->dualopend: attempt an RBF | ||||
| 102 | msgtype | dualopend_rbf_init | 7509 | ||
| 103 | msgdata | dualopend_rbf_init | our_funding | amount_sat | |
| 104 | msgdata | dualopend_rbf_init | psbt | wally_psbt | |
| 105 | # dualopend->master: ready to commit channel open to database and | ||||
| 106 | # get some signatures for the funding_tx. | ||||
| 107 | msgtype | dualopend_commit_rcvd | 7007 | ||
| 108 | msgdata | dualopend_commit_rcvd | their_config | channel_config | |
| 109 | msgdata | dualopend_commit_rcvd | remote_first_commit | bitcoin_tx | |
| 110 | msgdata | dualopend_commit_rcvd | pbase | ?penalty_base | |
| 111 | msgdata | dualopend_commit_rcvd | first_commit_sig | bitcoin_signature | |
| 112 | msgdata | dualopend_commit_rcvd | psbt | wally_psbt | |
| 113 | msgdata | dualopend_commit_rcvd | revocation_basepoint | pubkey | |
| 114 | msgdata | dualopend_commit_rcvd | payment_basepoint | pubkey | |
| 115 | msgdata | dualopend_commit_rcvd | htlc_basepoint | pubkey | |
| 116 | msgdata | dualopend_commit_rcvd | delayed_payment_basepoint | pubkey | |
| 117 | msgdata | dualopend_commit_rcvd | their_per_commit_point | pubkey | |
| 118 | msgdata | dualopend_commit_rcvd | remote_fundingkey | pubkey | |
| 119 | msgdata | dualopend_commit_rcvd | funding_txid | bitcoin_txid | |
| 120 | msgdata | dualopend_commit_rcvd | funding_txout | u16 | |
| 121 | msgdata | dualopend_commit_rcvd | funding_satoshis | amount_sat | |
| 122 | msgdata | dualopend_commit_rcvd | our_funding_sats | amount_sat | |
| 123 | msgdata | dualopend_commit_rcvd | channel_flags | u8 | |
| 124 | msgdata | dualopend_commit_rcvd | feerate_per_kw_funding | u32 | |
| 125 | msgdata | dualopend_commit_rcvd | feerate_per_kw_commitment | u32 | |
| 126 | msgdata | dualopend_commit_rcvd | local_shutdown_len | u16 | |
| 127 | msgdata | dualopend_commit_rcvd | local_shutdown_scriptpubkey | u8 | local_shutdown_len |
| 128 | msgdata | dualopend_commit_rcvd | remote_shutdown_len | u16 | |
| 129 | msgdata | dualopend_commit_rcvd | remote_shutdown_scriptpubkey | u8 | remote_shutdown_len |
| 130 | # dualopend->master: peer updated the psbt | ||||
| 131 | msgtype | dualopend_psbt_changed | 7107 | ||
| 132 | msgdata | dualopend_psbt_changed | channel_id | channel_id | |
| 133 | msgdata | dualopend_psbt_changed | funding_serial | u64 | |
| 134 | msgdata | dualopend_psbt_changed | psbt | wally_psbt | |
| 135 | # master->dualopend: we updated the psbt | ||||
| 136 | msgtype | dualopend_psbt_updated | 7108 | ||
| 137 | msgdata | dualopend_psbt_updated | psbt | wally_psbt | |
| 138 | # master->dualopend: fail this channel open | ||||
| 139 | msgtype | dualopend_fail | 7003 | ||
| 140 | msgdata | dualopend_fail | reason | wirestring | |
| 141 | # master->dualopend: hello | I'd like to start a channel open | |||
| 142 | msgtype | dualopend_opener_init | 7200 | ||
| 143 | msgdata | dualopend_opener_init | psbt | wally_psbt | |
| 144 | msgdata | dualopend_opener_init | funding_amount | amount_sat | |
| 145 | msgdata | dualopend_opener_init | local_shutdown_len | u16 | |
| 146 | msgdata | dualopend_opener_init | local_shutdown_scriptpubkey | u8 | local_shutdown_len |
| 147 | msgdata | dualopend_opener_init | feerate_per_kw | u32 | |
| 148 | msgdata | dualopend_opener_init | feerate_per_kw_funding | u32 | |
| 149 | msgdata | dualopend_opener_init | channel_flags | u8 | |
| 150 | # dualopend->master received tx_sigs from peer | ||||
| 151 | msgtype | dualopend_funding_sigs | 7010 | ||
| 152 | msgdata | dualopend_funding_sigs | signed_psbt | wally_psbt | |
| 153 | # master->dualopend send our tx_sigs to peer | ||||
| 154 | msgtype | dualopend_send_tx_sigs | 7011 | ||
| 155 | msgdata | dualopend_send_tx_sigs | signed_psbt | wally_psbt | |
| 156 | # dualopend->master tx sigs transmitted to peer | ||||
| 157 | msgtype | dualopend_tx_sigs_sent | 7012 | ||
| 158 | # dualopend->peer peer locked channel | ||||
| 159 | msgtype | dualopend_peer_locked | 7018 | ||
| 160 | msgdata | dualopend_peer_locked | remote_per_commit | pubkey | |
| 161 | # dualopend->master this channel has been locked | ||||
| 162 | msgtype | dualopend_channel_locked | 7019 | ||
| 163 | msgdata | dualopend_channel_locked | pps | per_peer_state | |
| 164 | # master->dualopend funding reached depth; tell peer | ||||
| 165 | msgtype | dualopend_depth_reached | 7020 | ||
| 166 | msgdata | dualopend_depth_reached | depth | u32 | |
| 167 | # Tell peer to shut down channel. | ||||
| 168 | msgtype | dualopend_send_shutdown | 7023 | ||
| 169 | msgdata | dualopend_send_shutdown | shutdown_scriptpubkey_len | u16 | |
| 170 | msgdata | dualopend_send_shutdown | shutdown_scriptpubkey | u8 | shutdown_scriptpubkey_len |
| 171 | # Peer told us that channel is shutting down | ||||
| 172 | msgtype | dualopend_got_shutdown | 7024 | ||
| 173 | msgdata | dualopend_got_shutdown | scriptpubkey_len | u16 | |
| 174 | msgdata | dualopend_got_shutdown | scriptpubkey | u8 | scriptpubkey_len |
| 175 | # Peer presented proof it was from the future. | ||||
| 176 | msgtype | dualopend_fail_fallen_behind | 1028 | ||
| 177 | # Shutdown is complete | ready for closing negotiation. + peer_fd & gossip_fd. | |||
| 178 | msgtype | dualopend_shutdown_complete | 7025 | ||
| 179 | msgdata | dualopend_shutdown_complete | per_peer_state | per_peer_state | |
| 180 | # master -> dualopend: do you have a memleak? | ||||
| 181 | msgtype | dualopend_dev_memleak | 7033 | ||
| 182 | msgtype | dualopend_dev_memleak_reply | 7133 | ||
| 183 | msgdata | dualopend_dev_memleak_reply | leak | bool |