<oembed><type>rich</type><version>1.0</version><author_name>npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2</author_name><author_url>https://nostr.ae/npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-01-24&#xA;📝 Original message:On Tue, Jan 23, 2018 at 09:31:00PM +0000, Gregory Maxwell wrote:&#xA;&gt; On Mon, Jan 22, 2018 at 8:00 PM, Peter Todd via bitcoin-dev&#xA;&gt; &lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt; &gt; Most transactions don&#39;t have change?! Under what circumstance? For most&#xA;&gt; &gt; use-cases the reverse is true: almost all all transactions have change, because&#xA;&gt; &gt; it&#39;s rare for the inputs to exactly math the requested payment.&#xA;&gt; &#xA;&gt; It&#39;s quite easy to get no change with a not-dumb algorithm selecting&#xA;&gt; coins if you have a decent number of outputs well under the value&#xA;&gt; you&#39;re paying.&#xA;&gt; &#xA;&gt; The number of ways n choose m combines grows exponentially, and you&#xA;&gt; only need to get close enough over the right value so that you&#39;re&#xA;&gt; paying excess fees equal or less than the cost of the change (which&#xA;&gt; should include the current cost output itself as well as estimated&#xA;&gt; cost of the future signature to spend it).&#xA;&gt; &#xA;&gt; Achow101 and Murch have code to implement an efficient algorithm for&#xA;&gt; finding these solutions for Bitcoin core which will hopefully get in&#xA;&gt; soon.&#xA;&#xA;Oh, Bitcoin Core doesn&#39;t already do that? I though that was what the (rather&#xA;complex) knapsack code was supposed to be doing.&#xA;&#xA;In any case, you&#39;re assuming that there actually are a large number of outputs.&#xA;That&#39;s not likely to be the case in most &#34;consumer-like&#34; use-cases where the&#xA;number of deposits into the wallet is relatively low compared to the number of&#xA;withdrawls as coins are spent in smaller amounts; that&#39;s the pattern most of my&#xA;Bitcoin usage follows, particularly as I keep the amount of funds in my hot&#xA;wallets low.&#xA;&#xA;Having said that, Rhavar&#39;s usage patterns could easily be different; I&#39;d be&#xA;completely wrong in the case of a payment service for instance where a large&#xA;number of deposits are aggregated into a smaller number of payments; that&#xA;use-case happens to be a particularly interesting one for using tx replacement&#xA;to add outputs, so my criticism was definitely premature.&#xA;&#xA;-- &#xA;https://petertodd.org &#39;peter&#39;[:-1]@petertodd.org&#xA;-------------- next part --------------&#xA;A non-text attachment was scrubbed...&#xA;Name: signature.asc&#xA;Type: application/pgp-signature&#xA;Size: 455 bytes&#xA;Desc: Digital signature&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180124/e656471f/attachment.sig&gt;</html></oembed>