<div dir="ltr">This is a good explanation but it does not address reachability.  TX_a, the first tx sent out on the network, presumably has insufficient fee to get mined - which also means it did not necessarily even reach all miners.<div><br></div><div>Simply sending out TX_b with added fee does not guarantee that nodes suddenly have TX_a, which they may have ignored/dropped before.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 10, 2015 at 12:28 PM, Tier Nolan <span dir="ltr">&lt;<a href="mailto:tier.nolan@gmail.com" target="_blank">tier.nolan@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Jul 10, 2015 at 5:09 PM, Richard Moore <span dir="ltr">&lt;<a href="mailto:me@ricmoo.com" target="_blank">me@ricmoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>I was also wondering, with CPFP, should the transaction fee be based on total transactions size, or the sum of each transaction’s required fee? For example, a third transaction C whose unconfirmed utxo from transaction B has an unconfirmed utxo in transaction A (all of A’s inputs are confirmed), with each A, B and C being ~300bytes, should C’s transaction fee be 0.0001 btc for the ~1kb it is about to commit to the blockchain, or 0.0003 btc for the 3 transactions it is going to commit.</div></div></blockquote><div><br></div></span><div>It should be whatever gives the highest fee.  In effect, child pays for parent creates compound transactions.<br><br></div><div>A: 250 bytes, 0 fee<br></div><div>B: 300 bytes: 0.0005 fee<br></div><div>C: 400 bytes: 0.0001 fee<br><br></div><div>There are 3 combinations to consider<br><br></div><div>A: 0 fee for 250 bytes = 0 per byte<br></div><div>A&amp;B: 0.0005 fee for 550 bytes = 0.91 uBTC per byte<br></div><div>A&amp;B&amp;C: 0.0006 fee for 950 bytes = 0.63uBTC per byte<br></div><div><br></div><div>This means that the A&amp;B combination has the best fee per byte value.  A&amp;B should be added to the memory pool (if 0.91 uBTC per byte is above the threshold).<br><br></div><div>Once A&amp;B are added, then C can be reconsidered on its own.  <br><br></div><div>C: 0.0001 for 400 bytes = 0.25 BTC per byte<br><br></div><div>If that is above the threshold, then C should be added.<br><br></div><div>In practice, it isn&#39;t possible to check every combination.  If there are N transactions, then checking all triple combinations costs around N cubed.<br><br></div><div>A 2 pass system could get a reasonably efficient result.<br><br></div><div>B is 0.0005 fee for 300 bytes = 1.67 uBTC per byte and is assumed to be a high value transaction.<br><br></div><div>The algorithm would be<br><br></div><div></div><div>Pass 1:<br></div><div>Process all transactions in order of BTC per byte, until block is full<br>    If the transaction&#39;s parents are either already in the pool or a previous block, add the transaction.<br></div><div><br><div>Pass 1:<br></div><div>Process all non-included transactions in order of BTC per byte, until block is full<br>    If the transaction&#39;s parents are either already in the pool or a previous block, add the transaction.<br><br></div><div>    Otherwise, consider the transaction plus all non-included ancestors as a single transaction<br></div><div>        If this combined transaction has a higher BTC per byte than the lowest transaction(s), <br>            add the combined transaction<br></div><div>            drop the other transaction(s)<br></div><div><br><br></div></div></div></div></div>
<br>_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
<br></blockquote></div><br></div>