Increasing the OP_RETURN is all well and good, but it seems like this is part of a larger issue that we aren't going to be ale to escape this way (the utxo set is not prunable...). Nevertheless, it's an interesting perspective to hear:
Retweeting this, and also explaining the direct impact on @BtcPayServer. (But first, read Antoineโs post with a cool head, even if you dislike him.)๐๐;๐๐: Most deployed BTCPay Servers will, sooner or later, be bricked. The change to the OP_RETURN size limit may prevent this. Hereโs why.When I created BTCPay Server, a hard requirement was keeping costs as low as possible and do not require our users to use command line. Thatโs why we love Bitcoin: everyone can verify.The most popular option was (and still is) to buy a server on LunaNode. You could host BTCPay for $7 per month (M2 instance).
It comes with a 20GB SSD.๐๐จ๐ฐ ๐ฐ๐ ๐ค๐๐ฉ๐ญ ๐ฌ๐๐ซ๐ฏ๐๐ซ ๐๐จ๐ฌ๐ญ๐ฌ ๐ฅ๐จ๐ฐ
To keep costs down, blocks are stored on a separate volume of ~80GB. Our default deployment runs in pruned mode. This means blocks are downloaded, verified, stored temporarily, and discarded over time. As a result, the volume size is always sufficient.Bitcoin doesnโt only store blocks; it also stores the current state (the UTXO set), which requires high throughput. Because of this, unlike the blocks, it isnโt stored on the separate volume but on the main drive (20GB).
The UTXO set size had always been relatively stable at the time, so 20GB was considered enough to keep costs low.Up to 2022, the UTXO set was about 4GB. Now, itโs around 12GB, almost entirely due to spam. Uh oh.
This means very old BTCPay Servers on M2 instances will soon be bricked (since the 20GB must also hold the OS).If you create a new server on LunaNode today, the default is now M4 (twice as expensive, $14 per month).
If your server is still running on M2, I strongly advise upgrading ASAP. Once the storage runs out, your server wonโt be able to restart. Upgrading after that point may or may not go smoothly. Regardless of all of above, M4 is recommended as it also improves stability.๐๐ก๐ ๐ฉ๐ซ๐จ๐๐ฅ๐๐ฆ ๐จ๐ ๐ฎ๐ง๐๐จ๐ฎ๐ง๐๐๐ ๐ฌ๐ญ๐จ๐ซ๐๐ ๐ ๐ ๐ซ๐จ๐ฐ๐ญ๐ก
If the UTXO set keeps growing forever, itโs a big problem. You couldnโt just set up BTCPay Server and forget about it; youโd need to monitor storage and upgrade your machine periodically. Thatโs a high technical barrier for most merchants.As Antoine points out, the specific spam has two approaches: one using unspendable outputs, and the other using OP_RETURN.The nice thing about OP_RETURN is that itโs only stored in blocks, which means your node can safely discard it. Thanks to this, the UTXO set growth can stay stable, or even shrink.๐๐ก๐ ๐ฉ๐ซ๐จ๐๐ฅ๐๐ฆ ๐จ๐ ๐๐๐ฌ๐ญ ๐ฌ๐ฒ๐ง๐
Another issue with a larger UTXO set is fast sync. Setting up a new BTCPay Server could once be accelerated by downloading 4GB of data instead of the entire blockchain.Now itโs 12GB. As a result, weโve reduced the frequency of fast sync snapshot updates for BTCPay Server.
This makes bootstrapping a server way slower.I know all of this doesn't cover all your grievances on Core (why don't they just keep the knobs?).I know that there exists way to make the problem of the UTXO Set size go away. (why don't they just implement Utreexo, X/Y/Z?)But suffice to say that those solutions are far from ready, and wouldn't depend solely on Core to work in practice.