You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fees in Bitcoin are calculated as the difference between inputs and outputs amounts.
31
+
32
+
<divclassName="text-center my-4 text-orange-500">
33
+
$$\mathbf{Fee = \sum{Inputs} - \sum{Outputs}}$$
34
+
</div>
35
+
36
+
Let's calculate the fee for the following <ahref="https://mempool.space/tx/c27c4d2236fce2a7542e024408d7f89b95e50e42a2c3d10be499c3102ccb45ef"target="_blank"rel="noopener noreferrer">transaction</a>:
To maximize their revenue, miners prioritize transactions that pay higher fees. The way they determine which transactions pay more will be covered in the next topic when we discuss fee rates.
100
+
101
+
For now, understand that:
102
+
103
+
- Transactions paying **higher fees** get priority for inclusion (fast confirmation)
104
+
- Transactions paying **lower fees** may wait longer in the mempool (or even fail)
While miners can choose which transactions to include based on fees, there's actually a minimum threshold that transactions must meet just to be relayed through the network.
126
+
127
+
This is called the **minimum relay fee**.
128
+
129
+
- It's the minimum fee required for nodes to relay and accept a transaction
130
+
- Default is typically 1 sat/vbyte (we'll explain this unit sat/vbyte in the next topic)
131
+
- Transactions below this threshold will be rejected by nodes
132
+
- Helps prevent spam and DoS attacks on the network
133
+
134
+
<ExpandableAlerttitle="NOTE"type="info">
135
+
💡 Even if you pay the minimum relay fee, your transaction might still take
136
+
a long time to confirm if network activity is high. The minimum relay fee is
137
+
just the baseline for transaction acceptance.
138
+
</ExpandableAlert>
139
+
140
+
This brings us to an important question: What happens when you submit a transaction with fees that are above the minimum relay fee but still too low for current network conditions?
141
+
142
+
---
143
+
144
+
### Fee Adjustment Methods
145
+
146
+
When network activity increases, transactions with lower fees might get stuck in the mempool. This can happen even if you paid above the minimum relay fee, as miners will prioritize transactions offering higher fees.
147
+
148
+
Let's say you have a transaction that's been sitting in the mempool for hours because you set the fee too low during a period of high network activity.
For example, if you have a transaction with base data of 200 bytes and witness data of 100 bytes, the weight would be: (200 × 4) + 100 = 900 weight units
78
+
79
+
This formula means:
80
+
- Base data counts heavily (4× weight)
81
+
- Witness data counts lightly (1× weight)
82
+
83
+
<ExpandableAlerttitle="NOTE"type="info">
84
+
💡 For legacy (non-SegWit) transactions, the entire transaction is considered base data,
0 commit comments