<oembed><type>rich</type><version>1.0</version><title>Rusty Russell [ARCHIVE] wrote</title><author_name>Rusty Russell [ARCHIVE] (npub1zw…hkhpx)</author_name><author_url>https://yabu.me/npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2022-02-13&#xA;📝 Original message:&#xA;Hi all,&#xA;&#xA;        I&#39;ve floated this idea before, but this is a more concrete&#xA;proposal for a &#34;v2&#34; gossip protocol.&#xA;&#xA;It assumes x-only pubkeys (aka point32) and BIP-340 signatures, and uses&#xA;modern TLVs for all optional or extensible fields.  Timestamps are&#xA;replaced with block heights.&#xA;&#xA;1. Nodes send out weekly node_announcement_v2, proving they own some&#xA;   UTXOs.&#xA;2. This entitles them to broadcast channels, using channel_update_v2; a&#xA;   channel_update_v2 from both peers means the channel exists.&#xA;3. This uses UTXOs for anti-spam, but doesn&#39;t tie them to channels&#xA;   directly.&#xA;4. Future ZKP proofs are could be added.&#xA;&#xA;1. type: 271 (`node_announcement_v2`)&#xA;2. data:&#xA;    * [`bip340sig`:`signature`]&#xA;    * [`point32`:`node_id`]&#xA;    * [`u32`:`blockheight`]&#xA;    * [`node_announcement_v2_tlvs`:`tlvs`]&#xA;&#xA;1. `tlv_stream`: `node_announcement_v2_tlvs`&#xA;2. types:&#xA;    1. type: 2 (`features`)&#xA;    2. data:&#xA;        * [`...*byte`:`featurebits`]&#xA;    1. type: 3 (`chain_hash`)&#xA;    2. data:&#xA;        * [`chain_hash`:`chain`]&#xA;    1. type: 4 (`taproot_utxo_proofs`)&#xA;    2. data:&#xA;        * [`...*taproot_utxo_proof`:`proofs`]&#xA;    1. type: 6 (`legacy_utxo_proofs`)&#xA;    2. data:&#xA;        * [`...*legacy_utxo_proof`:`proofs`]&#xA;    1. type: 127 (`ipv4_addresses`)&#xA;    2. data:&#xA;        * [`...*ipv4`:`addresses`]&#xA;    1. type: 129 (`ipv6_addresses`)&#xA;    2. data:&#xA;        * [`...*ipv6`:`addresses`]&#xA;    1. type: 131 (`torv3_addresses`)&#xA;    2. data:&#xA;        * [`...*torv3`:`addr`]&#xA;# Maybe alias, color, etc?&#xA;&#xA;Taproot proofs are a signature of the v1 output over the `node_id`,&#xA;`utxo` and `blockheight` with prefix &#34;lightingtaproot_utxo_proofsig&#34;&#xA;(using the tagged signatures as per BOLT12). (FIXME: what about&#xA;tapscripts?).&#xA;&#xA;Legacy proofs are two signatures, similar to the existing&#xA;channel_announcement.&#xA;&#xA;1. subtype: `taproot_utxo_proof`&#xA;2. data:&#xA;    * [`short_channel_id`:`utxo`]&#xA;    * [`signature`:`sig`]&#xA;&#xA;1. subtype: `legacy_utxo_proof`&#xA;2. data:&#xA;    * [`short_channel_id`:`utxo`]&#xA;    * [`point`:`bitcoin_key_1`]&#xA;    * [`point`:`bitcoin_key_2`]&#xA;    * [`signature`:`sig_1`]&#xA;    * [`signature`:`sig_2`]&#xA;&#xA;- node_announcement_v2 are discarded after a week (1000 blocks).&#xA;- If two node_announcement_v2 claim the same UTXO, use the first seen,&#xA;  discard any others.&#xA;- Nodes do not need to monitor existence of UTXOs after initial check (since&#xA;  they will automatically prune them after a week).&#xA;- The total proved utxo value (not counting any utxos which are spent)&#xA;  is multiplied by 10 to give the &#34;announcable_channel_capacity&#34; for that node.&#xA;&#xA;1. type: 273 (`channel_update_v2`)&#xA;2. data:&#xA;    * [`bip340sig`:`signature`]&#xA;    * [`point32`:`local_node_id`]&#xA;    * [`point32`:`remote_node_id`]&#xA;    * [`u32`:`blockheight`]&#xA;    * [`u32`:`channel_id_and_claimant`]&#xA;    * [`channel_update_v2_tlvs`:`tlvs`]&#xA;&#xA;1. `tlv_stream`: `channel_update_v2_tlvs`&#xA;2. types:&#xA;    1. type: 2 (`features`)&#xA;    2. data:&#xA;        * [`...*byte`:`featurebits`]&#xA;    1. type: 3 (`chain_hash`)&#xA;    2. data:&#xA;        * [`chain_hash`:`chain`]&#xA;    1. type: 4 (`capacity`)&#xA;    2. data:&#xA;        * [`tu64`:`satoshis`]&#xA;    1. type: 5 (`cost`)&#xA;    2. data:&#xA;       * [`u16`:`cltv_expiry_delta`]&#xA;       * [`u32`:`fee_proportional_millionths`]&#xA;       * [`tu32`:`fee_base_msat`]&#xA;    1. type: 6 (`min_msat`)&#xA;    2. data:&#xA;        * [`tu64`:`min_htlc_sats`]&#xA;&#xA;- `channel_id_and_claimant` is a 31-bit per-node channel_id which can be&#xA;  used in onion_messages, and a one bit stolen for the `claim` flag.&#xA;- A channel is not considered to exist until both peers have sent a&#xA;  channel_update_v2, at least one of which must set the `claim` flag.&#xA;- If a node sets `claim`, the capacity of the channel is subtracted from&#xA;  the remaining announcable_channel_capacity for that node (minimum&#xA;  10,000 sats).&#xA;- If there is insufficient total `announcable_channel_capacity` for a&#xA;  node, it is used by the lower `channel_id`s first.&#xA;&#xA;Implications&#xA;------------&#xA;&#xA;This simplifies gossip, requiring only two messages instead of three,&#xA;and reducing the UTXO validation requirements to per-node instead of&#xA;per-channel.  We can use a convention that a channel_update_v2 with no&#xA;`capacity` is a permanent close.&#xA;&#xA;We might want to add a taproot_utxo_delegated_proof where UTXOs can&#xA;sign over to another key, so cold storage only needs to sign once, and&#xA;the other key can sign weekly.&#xA;&#xA;It also allows &#34;leasing&#34; of UTXOs: you could pay someone to sign their&#xA;UTXO for your node_announcement, with some level of trust.  They could&#xA;spend the UTXO, which gives you a slow degredation as new nodes don&#39;t&#xA;accept your channels but existing nodes don&#39;t check until it&#39;s due for a&#xA;refresh).  Or they could sign one UTXO for multiple node_announcements,&#xA;which is why preference is given to the first-seen.  But it&#39;s a weekly&#xA;business so there&#39;s incentive for them not to.&#xA;&#xA;Between nodes there&#39;s the question of &#34;who claims this new channel?&#34;,&#xA;which I didn&#39;t address here.  Opener claims is logical, but leaks&#xA;information (though you could definitely pay for the peer to claim it).&#xA;With dual-funding, it&#39;s more complex (some kind of proportional coinflip&#xA;protocol is possible), but basically you can always wait for your peer,&#xA;and if they don&#39;t set the claim bit you can.&#xA;&#xA;Cheers!&#xA;Rusty.</html></oembed>