<p>I assume that you are actually asking about the order in which miners include transactions into their block template. Miners will group each transaction with its ancestry. The effective fee rate of such a transaction group is <code>Σ(fees)/Σ(size)</code> over all transactions in the group.</p>
<p>Let's assume there are two transactions waiting, <code>A</code> and <code>B</code>, where <code>B</code> is a child of <code>A</code> via spending an output of <code>A</code>.</p>
<pre><code>A: { size: 200 vB, fee: 4000 satoshi } ⇒ fee rate: 20 sats/vB
B: { size: 100 vB, fee: 500 satoshi } ⇒ fee rate: 5 sats/vB
</code></pre>
<p>The mining software now creates two transaction groups: <code>{ { A }, { A, B } }</code>, (<code>B</code> cannot be included in a block without <code>A</code>, so it cannot be a group by itself).
The effective fee rate of the first (single-element) group <code>{ A }</code> is <code>20 sats/vB</code>. The effective fee rate of the second transaction group <code>{ A, B }</code> is <code>4500/300 = 15 sats/vB</code>. From these groups, the miner picks the group that pays the highest fee rate <code>{ A }</code> as long as it has enough room to be added to the block template. After that, it removes all transactions of that group from the transaction candidate set and recalculates the transaction groups. There is now only one group of transactions left: <code>{ { B } }</code>. At this point <code>{ B }</code> is picked into the block template.</p>
<p>So, in this example, the transaction <code>A</code> queues at an effective fee rate of 20 sats/vB, while <code>B</code> queues at an effective fee rate of <code>5 sats/vB</code>. As the parent has a higher fee rate than the child, the causal order and fee rate order match, and <code>B</code> has no influence on <code>A</code>'s priority or vice versa.</p>
<hr />
<p>If instead <code>B</code> was paying a higher fee rate than <code>A</code>, e.g. in a child-pays-for-parent scenario, the following would happen:</p>
<pre><code>A: { size: 200 vB, fee: 200 satoshi } ⇒ fee rate: 1 sats/vB
B: { size: 100 vB, fee: 2800 satoshi } ⇒ fee rate: 28 sats/vB
</code></pre>
<p>The mining software creates two sets again: <code>{ { A }, { A, B } }</code>.
The effective fee rate of the first set <code>{ A }</code> is <code>1 sat/vB</code>. The effective fee rate of the second transaction set <code>{ A, B }</code> is <code>3000/300 = 10 sats/vB</code>.</p>
<p>Since the transaction group of <code>{ A, B }</code> now has a higher priority than <code>{ A }</code> by itself, the transaction group is picked into the block template first. In this case, the child transaction's size is relevant for calculating the effective fee rate of <code>{ A, B }</code>, so the size of the child transaction does have an effect on the parent transaction's block inclusion priority.</p>
<hr />
<p>If I misunderstood and you meant whether a descendant transaction can influence the fee rate of a parent transaction on creation of the latter, the answer is &quot;No!&quot;:<br />
transactions are immutable upon creation (ignoring edge cases like third-party malleability). Since the transaction fee is defined as the difference between the sum of input values and the sum of output values, the transaction fee is set in stone the moment the transaction is created. A transaction's outputs cannot be spent before the transaction is created. Therefore, a transaction cannot have any descendants before it is created. A descendant transaction influencing the creation of its ancestor is therefore a temporal paradox.</p>

CC BY-SA 4.0
2020-06-14T02:38:06.903Z
2022-09-16T17:21:47.220Z
2022-09-16T17:21:47.220Z
Murch
<blockquote>
  <p>While calculating the Transaction fee miners usually take Ancestor size into the account. But does the descendant/Output also effect the transaction fee calculation?</p>
</blockquote>

<p>The descendant transaction(s) do not restrict the inclusion of the examined transaction in a block, while the ancestor transaction(s) do. Hence, it would seem rational for the miner to only do extra computation for ancestors (in addition scanning both ancestors and descendants for each transaction means walking through each transaction twice).</p>

<blockquote>
  <p>Are Descendants Count correlated to Transaction fee in any way?</p>
</blockquote>

<p>"Any way" is pretty broad :</p>

<ul>
<li>Regarding miner incentive no</li>
<li>Regarding mempool logic and relay policy yes</li>
</ul>

CC BY-SA 4.0
2020-06-12T10:33:04.940Z
2020-06-12T12:13:53.827Z
2020-06-12T12:13:53.827Z
Antoine Poinsot
<p>No it doesn't. Only the ancestor size is taken into account.</p>

CC BY-SA 4.0
2020-06-13T14:28:51.350Z
2020-06-14T23:58:00.183Z
2020-06-14T23:58:00.183Z
user61135
<p>While calculating the transaction fee miners usually take ancestor size into the account. But does the descendant/output also affect the transaction fee calculation? Is descendant count correlated to transaction fee in any way?</p>

<transactions><blockchain><transaction-fees><unconfirmed-transactions>
Does descendant size affect transaction fees?
Haseeb Saeed
# Does descendant size affect transaction fees?

(Asked by: username_0 on 2020-06-12)

While calculating the transaction fee miners usually take ancestor size into the account. But does the descendant/output also affect the transaction fee calculation? Is descendant count correlated to transaction fee in any way?

**Tags:** transactions, blockchain, transaction-fees, unconfirmed-transactions


---

## 3 answers

### Answer by username_1 on 2020-06-14. Score: 3 | Accepted answer

I assume that you are actually asking about the order in which miners include transactions into their block template. Miners will group each transaction with its ancestry. The effective fee rate of such a transaction group is `Σ(fees)/Σ(size)` over all transactions in the group.

Let's assume there are two transactions waiting, `A` and `B`, where `B` is a child of `A` via spending an output of `A`.

```
A: { size: 200 vB, fee: 4000 satoshi } ⇒ fee rate: 20 sats/vB
B: { size: 100 vB, fee: 500 satoshi } ⇒ fee rate: 5 sats/vB

```

The mining software now creates two transaction groups: `{ { A }, { A, B } }`, (`B` cannot be included in a block without `A`, so it cannot be a group by itself).
The effective fee rate of the first (single-element) group `{ A }` is `20 sats/vB`. The effective fee rate of the second transaction group `{ A, B }` is `4500/300 = 15 sats/vB`. From these groups, the miner picks the group that pays the highest fee rate `{ A }` as long as it has enough room to be added to the block template. After that, it removes all transactions of that group from the transaction candidate set and recalculates the transaction groups. There is now only one group of transactions left: `{ { B } }`. At this point `{ B }` is picked into the block template.

So, in this example, the transaction `A` queues at an effective fee rate of 20 sats/vB, while `B` queues at an effective fee rate of `5 sats/vB`. As the parent has a higher fee rate than the child, the causal order and fee rate order match, and `B` has no influence on `A`'s priority or vice versa.

---

If instead `B` was paying a higher fee rate than `A`, e.g. in a child-pays-for-parent scenario, the following would happen:

```
A: { size: 200 vB, fee: 200 satoshi } ⇒ fee rate: 1 sats/vB
B: { size: 100 vB, fee: 2800 satoshi } ⇒ fee rate: 28 sats/vB

```

The mining software creates two sets again: `{ { A }, { A, B } }`.
The effective fee rate of the first set `{ A }` is `1 sat/vB`. The effective fee rate of the second transaction set `{ A, B }` is `3000/300 = 10 sats/vB`.

Since the transaction group of `{ A, B }` now has a higher priority than `{ A }` by itself, the transaction group is picked into the block template first. In this case, the child transaction's size is relevant for calculating the effective fee rate of `{ A, B }`, so the size of the child transaction does have an effect on the parent transaction's block inclusion priority.

---

If I misunderstood and you meant whether a descendant transaction can influence the fee rate of a parent transaction on creation of the latter, the answer is "No!":  
transactions are immutable upon creation (ignoring edge cases like third-party malleability). Since the transaction fee is defined as the difference between the sum of input values and the sum of output values, the transaction fee is set in stone the moment the transaction is created. A transaction's outputs cannot be spent before the transaction is created. Therefore, a transaction cannot have any descendants before it is created. A descendant transaction influencing the creation of its ancestor is therefore a temporal paradox.


---

### Answer by username_2 on 2020-06-12. Score: 3

> While calculating the Transaction fee miners usually take Ancestor size into the account. But does the descendant/Output also effect the transaction fee calculation?

The descendant transaction(s) do not restrict the inclusion of the examined transaction in a block, while the ancestor transaction(s) do. Hence, it would seem rational for the miner to only do extra computation for ancestors (in addition scanning both ancestors and descendants for each transaction means walking through each transaction twice).

> Are Descendants Count correlated to Transaction fee in any way?

"Any way" is pretty broad :

* Regarding miner incentive no
* Regarding mempool logic and relay policy yes


---

### Answer by username_3 on 2020-06-13. Score: 2

No it doesn't. Only the ancestor size is taken into account.


---

