What is Nostr?
npub10p3…n2l2
2025-01-14 20:12:16

npub10p…mn2l2 on Nostr: What's the deal with #bitcoin fees? How are they calculated? Where do they go? Let's ...

What's the deal with #bitcoin fees? How are they calculated? Where do they go? Let's have a look with a #DecodingBitcoin post:

A transaction's fee is equal to the total amount of bitcoin in the inputs, minus the total amount of bitcoin in the outputs.



Here's how to calculate the fee for this transaction: https://mempool.space/tx/c27c4d2236fce2a7542e024408d7f89b95e50e42a2c3d10be499c3102ccb45ef

Fee = Input - (Output1 + Output2)
Fee = 299.99430000 - (0.00140000 + 299.99240000)
Fee = 299.99430000 - 299.99380000
Fee = 0.00050000
Fee = 50,000 sats

Remember: Sum(Inputs) should always be greater than Sum(Outputs)



Fees incentivise miners to include transactions in blocks. Without fees, miners would have little reason to put transactions into blocks!

In addition to fees, miners also receive a block reward.

Total miner revenue = fees + block reward



How do miners decide what transactions go into a block?

The short answer is miners will usually maximize revenue by prioritizing transactions with the highest fee rate (we've got a whole lesson fee rates coming!)



While miners can choose which transactions to include based on fees, there's a minimum threshold, a "minimum relay fee" that must be met just for a transaction to be relayed through the network.

Transactions below this threshold are rejected by nodes. It helps prevent spam and DoS attacks on the network



This brings us to an important question: What happens if you submit a transaction with a fee rate above the minimum but still too low for current network conditions?

That transaction could sit in the mempool for hours because the fee rate is too low for the high level of network activity. Even if you met the minimum, there can still be plenty of transactions with higher fee rates than yours, ones that miners will choose first.



At this point, you have two main ways to "unstick" it:

1. RBF (Replace-by-Fee)
2. CPFP (Child Pays for Parent)

--------------------------------

That's all for now! We'll dive deeper into fee rates, RBF, and CPFP in a future post.

This material is from Decoding Bitcoin, your go-to resource for understanding #bitcoin, privacy, and decentralization.

If you enjoyed it, visit https://bitcoindevs.xyz/decoding for the full lesson, and more free, interactive content!

And don't forget to follow us for more posts about bitcoin tech and tools to help you in your developer journey 🚀
Author Public Key
npub10p33xu03t8q7d9nxtks63dq4gmt4v4d3ppd5lcdp4rg9hxsd0f8q7mn2l2