<oembed><type>rich</type><version>1.0</version><author_name>npub1g6vxlp4e0nyhs2dqxxcryztyf5f5hyuaq93nw4r87zcnv0sdsa0qqsl5wd</author_name><author_url>https://nostr.ae/npub1g6vxlp4e0nyhs2dqxxcryztyf5f5hyuaq93nw4r87zcnv0sdsa0qqsl5wd</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2015-07-10&#xA;📝 Original message:On Fri, Jul 10, 2015 at 5:09 PM, Richard Moore &lt;me at ricmoo.com&gt; wrote:&#xA;&#xA;&gt; I was also wondering, with CPFP, should the transaction fee be based on&#xA;&gt; total transactions size, or the sum of each transaction’s required fee? For&#xA;&gt; example, a third transaction C whose unconfirmed utxo from transaction B&#xA;&gt; has an unconfirmed utxo in transaction A (all of A’s inputs are confirmed),&#xA;&gt; with each A, B and C being ~300bytes, should C’s transaction fee be 0.0001&#xA;&gt; btc for the ~1kb it is about to commit to the blockchain, or 0.0003 btc for&#xA;&gt; the 3 transactions it is going to commit.&#xA;&gt;&#xA;&#xA;It should be whatever gives the highest fee.  In effect, child pays for&#xA;parent creates compound transactions.&#xA;&#xA;A: 250 bytes, 0 fee&#xA;B: 300 bytes: 0.0005 fee&#xA;C: 400 bytes: 0.0001 fee&#xA;&#xA;There are 3 combinations to consider&#xA;&#xA;A: 0 fee for 250 bytes = 0 per byte&#xA;A&amp;B: 0.0005 fee for 550 bytes = 0.91 uBTC per byte&#xA;A&amp;B&amp;C: 0.0006 fee for 950 bytes = 0.63uBTC per byte&#xA;&#xA;This means that the A&amp;B combination has the best fee per byte value.  A&amp;B&#xA;should be added to the memory pool (if 0.91 uBTC per byte is above the&#xA;threshold).&#xA;&#xA;Once A&amp;B are added, then C can be reconsidered on its own.&#xA;&#xA;C: 0.0001 for 400 bytes = 0.25 BTC per byte&#xA;&#xA;If that is above the threshold, then C should be added.&#xA;&#xA;In practice, it isn&#39;t possible to check every combination.  If there are N&#xA;transactions, then checking all triple combinations costs around N cubed.&#xA;&#xA;A 2 pass system could get a reasonably efficient result.&#xA;&#xA;B is 0.0005 fee for 300 bytes = 1.67 uBTC per byte and is assumed to be a&#xA;high value transaction.&#xA;&#xA;The algorithm would be&#xA;&#xA;Pass 1:&#xA;Process all transactions in order of BTC per byte, until block is full&#xA;    If the transaction&#39;s parents are either already in the pool or a&#xA;previous block, add the transaction.&#xA;&#xA;Pass 1:&#xA;Process all non-included transactions in order of BTC per byte, until block&#xA;is full&#xA;    If the transaction&#39;s parents are either already in the pool or a&#xA;previous block, add the transaction.&#xA;&#xA;    Otherwise, consider the transaction plus all non-included ancestors as&#xA;a single transaction&#xA;        If this combined transaction has a higher BTC per byte than the&#xA;lowest transaction(s),&#xA;            add the combined transaction&#xA;            drop the other transaction(s)&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150710/68d6acca/attachment.html&gt;</html></oembed>