<oembed><type>rich</type><version>1.0</version><author_name>npub1pmw4p7tz6s8k62zrpdpxc93ajlmpxe0s03j275dcmcejv8wazz9qhe5c0r</author_name><author_url>https://nostr.ae/npub1pmw4p7tz6s8k62zrpdpxc93ajlmpxe0s03j275dcmcejv8wazz9qhe5c0r</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-01-22&#xA;📝 Original message:&gt; Most transactions don&#39;t have change?! Under what circumstance? For most&#xA;&gt; use-cases the reverse is true: almost all all transactions have change, because&#xA;&gt; it&#39;s rare for the inputs to exactly math the requested payment.&#xA;&#xA;It&#39;s actually a common misconception. With good coin selection, I am able to avoid change about ~75% of the time in my simulations (on my real world data). In practice it&#39;s a bit lower, probably about 40-50% of the time because of the need to keep the majority of my funds offline where they can&#39;t be used for coin selection, and I have not been able to accurate simulate how I consolidate.&#xA;&#xA;Also the other misconception is that inputs don&#39;t need to match exactly the requested payment, it&#39;s totally fine to do something I call a &#34;miner sacrifice&#34; where you overpay txfees up to the amount that that would otherwise be the total cost (immediate + consolidation) of creating change.&#xA;&#xA;Also another trick I use, is something I call &#34;output selection&#34;. If I have N queued non-time sensitive payments, I don&#39;t really need to send them all at the same time. So I can pick the best combination of inputs+outputs.&#xA;&#xA;Obviously none of this applies to consumer wallets, who typically have less than a handful of options. But for a service, avoiding change can be the norm with good coin selection.&#xA;&#xA;---&#xA;&#xA;-Ryan&#xA;&#xA;-------- Original Message --------&#xA;On January 22, 2018 3:00 PM, Peter Todd &lt;pete at petertodd.org&gt; wrote:&#xA;&#xA;&gt; On Mon, Jan 22, 2018 at 12:40:31PM -0500, Rhavar via bitcoin-dev wrote:&#xA;&gt;&#xA;&gt;&gt; So my half-baked idea is very simple:&#xA;&gt;&gt; Allow users to merge multiple unconfirmed transactions, stripping extraneous inputs and change as they go.&#xA;&gt;&gt; This is currently not possible because of the bip125 rule:&#xA;&gt;&gt; &#34;The replacement transaction pays an absolute fee of at least the sum paid by the original transactions.&#34;&#xA;&gt;&gt; Because the size of the merged transaction is smaller than the original transactions, unless there is a considerable feerate bump, this rule isn&#39;t possible to observe.&#xA;&gt;&gt; I my question is: is it possible or reasonable to relax this rule? If this rule was removed in its entirety, does it introduce any DoS vectors? Or can it be changed to allow my use-case?&#xA;&gt;&#xA;&gt; It would definitely introduce DoS vectors by making it much cheaper to use&#xA;&gt; relay bandwidth. You&#39;d also be able to push others&#39; txs out of the mempool.&#xA;&gt;&#xA;&gt;&gt; ---------------------------------------------------------------&#xA;&gt;&gt;&#xA;&gt;&gt; Full backstory: I have been trying to use bip125 (Opt-in Full Replace-by-Fee) to do &#34;transaction merging&#34; on the fly. Let&#39;s say that I owe John 1 bitcoin, and have promised to pay him immediately: Instead of creating a whole new transaction if I have an in-flight (unconfirmed) transaction, I can follow the rules of bip125 to create a replacement that accomplishes this goal.&#xA;&gt;&gt; From a &#34;coin selection&#34; point of view, this was significantly easier than&#xA;&gt;&gt; I had anticipated. I was able to encode the rules in my linear model and&#xA;&gt;&gt; feed in all my unspent and in-flight transactions and it can solve it without difficulty.&#xA;&gt;&gt; However, the real problem is tracking the mess. Consider this sequence of events:&#xA;&gt;&gt;&#xA;&gt;&gt; - I have unconfirmed transaction A&#xA;&gt;&gt; - I replace it with B, which pays John 1 BTC&#xA;&gt;&gt; - Transaction A gets confirmed&#xA;&gt;&gt;&#xA;&gt;&gt; So now I still owe John 1 BTC, however it&#39;s not immediately clear if&#xA;&gt;&gt; it&#39;s safe to send to him without waiting $n transactions. However even&#xA;&gt;&gt; for a small $n, this breaks my promise to pay him immediately.&#xA;&gt;&gt; One possible solution is to only consider a transaction &#34;replaceable&#34; if it has change, so if the original transaction confirms -- payments can immediately be made that source the change, and provide safety in a reorg.&#xA;&gt;&gt; However, this will only work &lt;50% of the time for me (most transactions&#xA;&gt;&gt; don&#39;t have change) and opens a pandora&#39;s box of complexity.&#xA;&gt;&#xA;&gt; Most transactions don&#39;t have change?! Under what circumstance? For most&#xA;&gt; use-cases the reverse is true: almost all all transactions have change, because&#xA;&gt; it&#39;s rare for the inputs to exactly math the requested payment.&#xA;&gt;&#xA;&gt; https://petertodd.org &#39;peter&#39;[:-1]@petertodd.org&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180122/1abc39e2/attachment.html&gt;</html></oembed>