pull down to refresh

Why are there Bitcoin rules that aren't consensus rules?

Recently, Peter Todd proposed removing Bitcoin Core's 83-byte limit on op_returns. Is this changing Bitcoin?
The limit isn't a consensus rule, so it doesn't change what can go in blocks or what is in a valid transaction--which might make you wonder Why are there Bitcoin rules that aren't consensus rules?
Turns out there is a big difference between consensus rules and mempool policies like these (also called standardness rules or transaction filters). Understanding the discussion around removing the op_return limit is a lot easier when we are clear on what this difference is.
Let's start with the role nodes play in the Bitcoin network.

๐Ÿ–ฅ๏ธ A node is just a computer

A node downloads blocks and runs the math to check that all the transactions follow the consensus rules of Bitcoin.
While it may not sound like much, this plays a crucial role in keeping Bitcoin decentralized and free from any single party's control.
Anyone can run a node (it doesn't take a special computer or very much technical experience). Running a node lets you see for yourself that the coins you receive are real and follow the rules as you understand them. It's kind of like having your own inhouse gold assayer, but for bitcoin.

๐ŸŒ Bitcoin really is a network

Nodes also play another important role: they relay newly mined blocks and new transactions that haven't made it into blocks yet.
All around the world, there are tens of thousands of computers sharing new blocks that have just been mined and new transactions that have just been broadcast.
One of the reasons having a lot of nodes is important is so that a new miner can easily learn about new transactions that haven't been mined yet and try to collect their fees by mining them.
Another reason is that having a robust network of nodes sharing transactions makes it more likely that the transactions you broadcast will make it to a lot of different miners, and thus be more likely to get mined.

๐Ÿšซ We don't talk about Bruno (well, actually just certain kinds of transactions)

Nodes can refuse to tell other nodes about transactions -- even if they are perfectly valid. It might seem like there's no good reason to do such a thing: that's censorship isn't it?
Not necessarily. There are several very important reasons why nodes might want to refuse to relay certain transactions:
โš”๏ธ DoS attacks
An attacker could design a block full of special transactions that can take a lot of time to validate. While such transactions follow Bitcoin's rules, they don't serve much purpose other than to grief node runners and sabotage miner competition.
๐Ÿช Upgrade hooks
Most nodes also refuse to relay transactions that utilize certain generally unused fields, even though there's no rule in Bitcoin that says these fields can't be used.
Developers are hoping to reserve these fields for future upgrades, but they will be a lot less useful if users put them to a smattering of different uses before a standard is set.
๐Ÿงน Dust limits
You can create a transaction in Bitcoin with such a small value that it is guaranteed that whoever receives the coins will have to spend more money in fees than the coins are worth.
Even though such transactions don't break Bitcoin's rules, most nodes won't relay them in an effort to prevent users from creating coins that aren't economically useful.
๐Ÿ™… Deterring certain user behaviors
Some people seem to enjoy putting arbitrary data into blocks. Because Bitcoin is a permissionless system, it is very difficult to prevent them from doing this.
One common way this is achieved is by using a piece of Bitcoin Script called op_return. In an effort to incentivize the least costly (for noderunners) version of putting arbitrary data in blocks, nodes will generally relay transactions with op_return data.
But most nodes won't relay a transaction that has more than one op_return output or if the op_return is larger than 83 bytes, even though the consensus rules do not have a limit (other than the transaction size) for op_return data.

๐Ÿ“ It's not censorship, it's policy!

So now we are back to the op_return limit. The current mempool policy that nodes won't relay op_returns larger than 83-bytes was introduced in 2015. Since then, it has been pretty effective at preventing larger op_returns from ending up on the chain.
What is the difference between such a policy and a policy that refuses to relay transactions that come from certain blacklisted addresses?
While the purpose of the two policies may be wildly different (one aims to protect Bitcoin for financial uses while the other aims to censor it), the form of the two policies seems pretty similar.

โš’๏ธ Proof of Work is designed to break filters

Every Bitcoin transaction carries a fee. These fees pay for blockspace which miners provide by expending electricity. Energy sources are widely distributed around the world, so if some miners refuse to mine certain transactions, we hope the increased fees censored transactions are willing to pay incentivizes other miners to put them in blocks.
Bitcoin uses Proof of Work to create censorship resistance. We all certainly hope that in the case of blacklists or other attempts at censorship, this mechanism will kick in and save the day. But the question is, why won't same dynamic won't play a similar role in the case of op_return limits?
Bitcoin only works if it is true that people can always get their transactions mined by paying more.
In the case of mempool policies, standardness rules, and transaction filters, paying more may mean something as simple as skipping the mempool and paying a higher fee via a mining pool's transaction accelerator. Miners have a strong incentive to figure out how to take the fees people want to pay them. Bitcoiners are counting on it.

๐Ÿฅค Filters are not Consensus Lite

There is a fundamental difference between how consensus rules and mempool policies function:
  • Different rules about what you accept into a block (consensus rules) will cause you to fork off.
  • Different rules about which transaction your node will relay (mempool policies) will not cause you to fork off.
Consensus rules are known beforehand. When you accept a coin in payment you are agreeing to the rules that particular coin has followed (and you're able to dictate what those are by refusing to accept coins that don't follow the rules as you understand them).
Mempool policies can be enacted by any node that wants them. You don't get any say about other node's policies and they can't tell you what yours should be.
However, you can still accept coins that come from a transaction that is disallowed by other nodes policies. And once those coins are in a block, everyone else has to accept them as valid too (unless they want to fork).
We must all agree on consensus rules if we want to use the same coin.
We do not have to agree on mempool policies.
10 sats \ 1 reply \ @anon 1 May
There is a contradiction when saying that spam filters do not work and simultaneously wanting to remove the opreturn limit. Isn't there? Why is most arbitrary data stored in the witness then? Likely, since there is a opreturn limit, i.e. effective spam filter in place Note that witness data can be ignored by node runners to keep our machines as lean as possible
reply
It's hard to tell whether people put arbitrary data in the witness because of the op_return limit or because of economics:
Using an op_return to put data in a transaction is cheaper for payloads smaller than 143 bytes (ignoring the current 83-byte limit), while over 143 bytes the witness is cheaper.1
The op_return limit certainly seems to be effective, but it is also true that for larger amounts of data (anything over 143 bytes) it's probably going to go into the witness anyway.
Either way, it does feel like a contradiction: if filters don't work then why do you need to get rid of them? However, it may be more nuanced: filter isn't stopping the behavior, it's just moving it.

Footnotes

reply