Bitcoin Q&A: Spam transactions and Child Pays for Parent (CPFP)

“Miner spam to raise transaction fees. Is this real?” “Hi Andreas. Can miners spam the
network with transactions to raise fees, mitigating the cost of such an attack
by mining their own transactions?” “If so, could you elaborate on how
such a spam attack would work, and how Bitcoin can evolve to address this issue?” This is not an easy subject. It is quite controversial.
There are a lot of conspiracy theories flying around… It is very difficult to draw any firm conclusions.
You can’t really tell if a transaction is made… by a user [for “legitimate” purposes], if it was created
by a miner or some other party to inflate fees. However, from a theoretical perspective, it is possible
to game the system and create lots of transactions… with high fees, that overpay on fees, which
pushes up the fee estimation algorithms. Such an attack is much more expensive
when you have more capacity on the network. It takes more [transactions] to fill [blocks].
SegWit made that harder. It becomes even more expensive when companies
operating “legitimate” exchanges, merchant [services], wallets, etc. use good fee estimation [algorithms]
and transaction capabilities like replace-by-fee (RBF). The more sophisticated the fee management
of wallets is, the more expensive it becomes… to cram the blockchain with “fake” transactions. Also, as you indicated in your question,
in order for this [attack] to be affordable for miners, they must be able to recover some of
those fees by mining their own transactions. That makes it a lot easier to attack the network. One of the challenges here is the
level of centralization among miners. When mining is very centralized, then it is
a lot easier to perform this kind of attack. When mining is more decentralized, then
it is more difficult to perform this attack, because you may be spending money on
raising the mining fees by making transactions, but then [losing the chance] to mine those because
somebody else mined the next block [first]. You would be losing money and they are gaining it.
Other miners can benefit from spam transactions… without needing to expend [resources]
on spamming the Bitcoin network. It will still raise fees for them, making it an economic
tragedy of the commons, and probably a good one. The final question is, how can Bitcoin
evolve to address this issue [of spam]? The problem is two-fold. You will always have limited
capacity. There is no infinite capacity on any system, especially a system attempting
to be decentralized and secure. There will always be opportunities to raise the cost
of transactions by filling up the available capacity. The problem is in the background, [based on]
how centralized or decentralized mining is. Fortunately, we are beginning to see the first effects
of mining chips reaching the limits of Moore’s Law; other chip manufacturers are entering the game, and
[some] countries trying to attract Bitcoin miners… in their jurisdictions by offering
tax breaks and cheap electricity. There is a lot of interest in mining from
Canada and other places around the world. I have long thought that mining is on the cusp of… becoming more decentralized due to various
economic [incentives and] pressures. We will see how that happens. Overall, I think
the best defense is to use sophisticated wallets.. for estimating fees correctly, and also give you the
opportunity to bid for lower fees with replace-by-fee.. and Child-Pays-For-Parent (CPFP), which lowers
the pressure on fees for the whole network. Another solution is, if the fees are too expensive
and your transaction is not urgent, you can wait. If you are willing to wait, then
you aren’t playing their game. “What is Child-Pays-For-Parent? How does
it work? Which wallets have this feature?” First of all, Child-Pays-For-Parent isn’t really a feature. It is a recognition of the economic incentives
that exist for miners when selecting transactions. If you have a transaction that is unconfirmed, and
that transaction has a child / dependent transaction.. that is also unconfirmed, when you are choosing
which transactions to include in the block as a miner, you may not want to look at the amount of
fee per byte paid by individual transactions, but the fees per byte paid jointly by both transactions. If the child [transaction] has a very generous fee,
but the parent [transaction] has a very low fee, the child will never get confirmed
because it has an unconfirmed parent. But if you consider the fee jointly between the two,
you might be able to collect the very generous fee… of the child [transaction] by allowing it to
effectively subsidize the lower fee of the parent. Let’s say the parent [transaction] is paying one satoshi
per byte, and the child a hundred satoshis per byte. If you consider them independently, that would result
in ‘don’t confirm the parent, but confirm the child.’ but you can’t do that because the child doesn’t
exist without the parent being confirmed. If you [confirm] them together, they are
jointly [averaging] fifty satoshis per byte. That is a great fee, so you will want to confirm both.
In fact, this strategy is already used by miners. [When you ask], “Is it a feature in a wallet,”
that means the wallet is aware of that strategy, and use it to your own advantage in two ways:
if you receive a transaction and it is not confirming, you can take one of the outputs in that unconfirmed
transaction and construct a child transaction… which uses that [payment] as an
input, and then pay a larger fee. As such, you will [incentivise] the miner to select both of
those transactions and include them in the next block. The transaction that you were expecting to receive that
was unconfirmed [due to low fee], becomes confirmed. You “spent” it while it was unconfirmed, with a higher
fee. So, you create a child that pays for the parent… [transaction] sent to you when it hasn’t confirmed yet. By doing that, you have essentially bumped the fee
for the parent and made it possible for it to confirm. [This is a way to] push through a transaction
that is stuck. I have done this many times. If I have an incoming payment with a low fee, I create
a child transaction on purpose and bump the fee. I use Electrum to do this, but some other wallets
also have this feature. I can’t give a list right now, so you can [do some] research [to find which wallets
support replace-by-fee and child-pays-for-parent]. There is another way to use [child-pays-for-parent].
It is not just the recipient who can [bump the fee]. The sender can too. Almost always, when you send
a transaction, there is a change payment back to you. You can string a child [transaction] onto the change
output of your own parent and use it to bump the fee. If you haven’t used replace-by-fee to affect the fee of
the parent, you can use child-pays-for-prent instead.. to accelerate one of your own outgoing transactions
by attaching a greater fee to the change output. Even if the receiver isn’t doing child-pays-for-parent
because maybe they don’t know how to [use it], you can accelerate the parent by constructing
a child [transaction] with a change transaction. It is an interesting feature based on economic
incentive mechanisms that apply to miners. You can use it in certain wallets
in order to accelerate transactions.

39 thoughts on “Bitcoin Q&A: Spam transactions and Child Pays for Parent (CPFP)”

  1. How can we get the US government to allow spending bitcoin without it being a taxable event? Middle class Americans aren't going to buy groceries with bitcoin when they are taxed 26%.

  2. Bitcoin and blockchain a nice democratic idea but the regulations lead all the users to a financial "slavery" because of its transparency in opposite to the fiat cash

  3. Hey Andreas, I admire you and I greatly appreciate and respect your work… But man!! Calling RBF "a technology" really sounds like a bad joke…

  4. Let's not also for getting the coming Schnorr Signatures…. Maybe we should also consider creating a charitable coin agnostic DAO to accelerate payments for those in poverty… Thus allowing for them to do very low fees. Any thoughts? Another thought vis creating a lightning bridge that batches to on chain… And miner agreements…. Also I think we should support miners that give SegWit priority

  5. Hey Andreas,
    How do you see the roll of the cryptoATMs in the mid and long term as a getaway for less a computer-native type of person? Thanks for the great job.

  6. i do think the only way to avoid a slavery is to create a global market place for goods or services which run on the blockchain and have no connection to the fiat system.. However i'd like to hear what Andreas aantonop has to tell about it and how to achieve it

  7. Hello, why do you always Q&A with a drab background looking like you're in a CIA bunker? Do it outside in the sun!

    Thanks for the knowledge nonetheless sir.

    What are your thoughts on altcoin illegal wash trading and pumps ruining the credibility of the crypto market, and Bitcoin indirectly?

  8. Great explaination, I used PFC once and I wasn't really sure if it would do what I expected but I was right as it seemed right, so yeah… kinda intuitive

  9. What a great tool that so few utilize. There's really no extensive list of wallets yet if anyone is looking. But, if you run a full node then it's not something you'll have to worry about.

  10. Can a miner be held liable for handling (collecting fees) or aiding (mining the transaction) any stolen Bitcoin. Say for example I steal 200k Btc, in order for me to do that I would have to send that BTC to an address that only I control. Lets say I set the transaction to 6000 sat/byte and end up paying something like 0.1 btc in fees. Will anyone care about that 0.1 btc the the miner has, is it still considered stolen property? Can it still be tracked on the blockchain? Is the miner responsible for aiding the theft or being in possession of stolen Btc? Can anyone even prevent a miner from mining a transaction since the thief could just mine the transaction themselves.

    Because right now it seems like a person could steal a large amount of btc, get in touch with large miners since mining is slightly centralised and keep splitting the btc to different addresses whilst also setting the sat/byte high. Eventually the btc will dissapear into the hands of the miners.

    It's not like there's a rule saying stolen btc can't be sent within the blockchain.

  11. One flaw: He's assuming the miners are posting with HIGH fees.
    If miners post with fees so low they'd never get mined by anyone else, but then added to the bad actors by manually including their own transactions… it suddenly becomes free attack that can be sustained indefinitely…
    This guy is the #1 guy to listen to on the planet!
    And I've seen lots and lots of proof of spam attacks.
    Funds that get instantly transferred out of a wallet as soon as it goes in… over and over and over, until the entire starting balance went to fees.

  12. In short…the answer is btc will scale and adapt at a compounded rate. By compounded, I mean ever so quickly as technology progresses. 2x, 4x, 8x,16x,32 and so on

  13. i recon one day every smart phone pc laptop anything with artificial intelligence that is aware and online will act as smart hubs for cryptos increasing the speed of the crypto network who nodes ?

  14. hey Andreas, this Q&A format is perfect. I think these vids are hands down the best infromational vids around for deep understanding of bitcoin. Thanks for your time.
    btw, you deserve to have many more views but I think most crypto viewers on youtube are simply not at the level to understand many of these nuanced topics.

    if you started your vid with some kind of banal chart analysis and price predictions, you would 100x your views, but your reputation would be destroyed.
    Thanks for sticking to your convictions.

  15. Is it possible for a crooked miner to insert spam transactions into the mem pool after solving the nonce and withholding the solution for a short amount of time? If so they would run a very small risk of losing the block to another miner but gain the ability to spam only the blocks they are likely to mine themselves.
    It wouldn't pay to do that only once but if you're mining say 10% of blocks you could conceivably affect fees and run little risk of paying your spam fees to others. On the flip side it would raise some flags if every time a particular party mines a block it just happens to be filled with a bunch of spam other blocks don't have.

  16. Question; what happens with mining when the unix epoch timestamp runs out? or maybe I'm not understanding that right..

  17. Final objective of spam transactions is not economic but political, is an attack to the bitcoin blocksize policy by groups with different interests. A very sad waste of effort and money.

  18. Dear Andreas would you categorize Hedera as a better intermediary compared to bitcoin in the regulatory space?

  19. Sir I buy your mastering bitcoin book cAn you tell me which help more to develop my bitcoin wallet web and Android application and help me sir making bitcoin wallet and some related thing please reply it is helpful for me.
    Thanks you for mastering bitcoin book,sir.

  20. Hello Andreas, how do you think of EOS or Dpos consensus? Do you think they will be able to deliver the high performance blockchain os as they promised? Thank you for your time.

Leave a Reply

Your email address will not be published. Required fields are marked *