<oembed><type>rich</type><version>1.0</version><title>lisa neigut [ARCHIVE] wrote</title><author_name>lisa neigut [ARCHIVE] (npub1sp…s64t2)</author_name><author_url>https://yabu.me/npub1sprhp66c693av0c0n9had046hcdcckp2th25fnmphwstc5e4wg9qxs64t2</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2020-02-04&#xA;📝 Original message:&#xA;Rusty had some suggestions about how to improve the protocol messages for&#xA;this, namely adding a serial_id to the inputs and outputs, which can then&#xA;be reused for deletions.&#xA;&#xA;The serial id can then also be used as the ordering heuristic for&#xA;transaction inputs during construction (replacing current usage of BIP69).&#xA;Inputs can be shared amongst peers by flipping the bottom bit of the&#xA;serial_id before relaying them to another peer (as your own).&#xA;&#xA;See below for details.&#xA;&#xA;&#xA;1. type:   440 `tx_add_input`&#xA;&gt;&#xA;&gt; 2. data:&#xA;&gt;&#xA;&gt;     * [`32*byte`:`channel_identifier`]&#xA;&gt;&#xA;        * [`32*byte`:``serial_id`]&#xA;&#xA;Add a serial id.&#xA;&#xA;Each input addition must have a unique serial id.&#xA;&#xA;No addition may have a repeated id number.&#xA;&#xA;The initiator&#39;s serial id&#39;s must be odd. The non-initiator&#39;s serial id&#39;s&#xA;must be even.&#xA;Serial ids are used as sorting heuristic for input ordering in final&#xA;transaction, replaces BIP69&#xA;&#xA;&#xA;    * [`u64`:`sats`]&#xA;&gt;&#xA;&gt;     * [`sha256`:`prevtx_txid`]&#xA;&gt;&#xA;&gt;     * [`u32`:`prevtx_vout`]&#xA;&gt;&#xA;&gt;     * [`u16`:`prevtx_scriptpubkey_len`]&#xA;&gt;&#xA;&gt;     * [`prevtx_scriptpubkey_len*byte`:`prevtx_scriptpubkey`]&#xA;&gt;&#xA;&gt;     * [`u16`:`max_witness_len`]&#xA;&gt;&#xA;&gt;     * [`u16`:`scriptlen`]&#xA;&gt;&#xA;&gt;     * [`scriptlen*byte`:`script`]&#xA;&gt;&#xA;&gt; Removes the signal_rbf; everything will be flagged as RBF eligible. (This&#xA;makes verifying RBF eligibility during a RBF round simpler.)&#xA;&#xA;&#xA;&gt; 1. type: 442 `tx_add_output`&#xA;&gt;&#xA;&gt; 2. data:&#xA;&gt;&#xA;&gt;     * [`32*byte`:`channel_identifier`]&#xA;&gt;&#xA;    * [`16*byte`:`serial_id`]&#xA;&#xA;Add a serial id. Same rules as for inputs, but a distinct counter set is&#xA;used.&#xA;Used for ordering the transactions’ outputs, replacing BIP69&#xA;&#xA;&#xA;&#xA;&gt;     * [`u64`:`sats`]&#xA;&gt;&#xA;&gt;     * [`u16`:`scriptlen`]&#xA;&gt;&#xA;&gt;     * [`scriptlen*byte`:`script`]&#xA;&gt;&#xA;&gt; 1. type: 444 `tx_remove_input`&#xA;&gt;&#xA;&gt; 2. data:&#xA;&gt;&#xA;&gt;     * [`32*byte`:`channel_identifier`]&#xA;&gt;&#xA;    * [`16*byte`:`serial_id`]&#xA;&#xA;&#xA;Input to remove identified by the serial id, not txid and index.&#xA;&#xA;&#xA;&#xA;&gt;&#xA;&gt; 1. type: 446 `tx_remove_output`&#xA;&gt;&#xA;&gt; 2. data:&#xA;&gt;&#xA;&gt;     * [`32*byte`:`channel_identifier`]&#xA;&gt;&#xA;    * [`16*byte`:`serial_id]&#xA;&#xA;Output to remove identified by the serial id, not output script and amount.&#xA;&#xA;&#xA;&#xA;&gt; 1. type: 448 `tx_complete`&#xA;&gt;&#xA;&gt; 2. data:&#xA;&gt;&#xA;&gt;     * [`32*byte`:`channel_identifier`]&#xA;&gt;&#xA;&#xA;Total counts removed from tx_complete. The txid exchanged in the `tx_sigs`&#xA;will serves as a checksum for the transaction.&#xA;&#xA;&#xA;&gt; 1. type:  448 `tx_sigs`&#xA;&gt;&#xA;&gt; 2. data:&#xA;&gt;&#xA;&gt;     * [`channel_id`:`channel_identifier`]&#xA;&gt;&#xA;&gt;     * [`u16`:`num_witnesses`]&#xA;&gt;&#xA;&gt;     * [`num_witnesses*witness_stack`:`witness_stack`]&#xA;&gt;&#xA;&gt; 1. subtype: `witness_stack`&#xA;&gt;&#xA;&gt; 2. data:&#xA;&gt;&#xA;    * [`u16`:`num_input_witness`]&#xA;&gt;&#xA;&gt;     * [`num_input_witness*witness_element`:`witness_element`]&#xA;&gt;&#xA;&#xA;prev_out and prev_txid are removed; witnesses ordered implicitly by&#xA;serial_id.&#xA;&#xA;&#xA;&gt; 1. subtype: `witness_element`&#xA;&gt;&#xA;&gt; 2. data:&#xA;&gt;&#xA;&gt;     * [`u16`:`len`]&#xA;&gt;&#xA;&gt;     * [`len*byte`:`witness`]&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; ## General Notes&#xA;&gt;&#xA;&gt; - All output scripts must be standard&#xA;&gt;&#xA;&gt; - nLocktime is always set to 0x00000000&#xA;&gt;&#xA;- If a blockheight to be used as nLocktime is communicated in the&#xA;initiation step, is set to blockheight-6; otherwise set to zero-&#xA;- Serial ids should be chosen at random&#xA;- For multiparty constructions, the initiator MUST flip the bottom bit of&#xA;any received inputs before relaying them to a peer.&#xA;- Collisions of serial ids between peers is a protocol error&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200204/d6136e56/attachment-0001.html&gt;</html></oembed>