Introduction
Spamming a rollup network by posting invalid blocks to its namespace is an issue in Celestia due to the fact that in the data availability layer + rollup paradigm, block production is cheap (just pay transaction fees) as opposed to costly in PoW or PoS networks (perform work or stake tokens and get slashed for misbehavior).
This leads to various spamming attacks that we’ve been discussing since the Kyiv offsite including the Woods Attack on light clients and another against full nodes pointed out by @mattdf. The TL;DR on this second attack is that someone can post a bunch of blocks that take a long time to verify and only include fraud at the very end. Hence rollup full nodes would be forced to waste a lot of time processing these blocks before they could find out that they are invalid.
Staking may be the only way to mitigate certain kinds of spam attacks
While I think we have a good solution to the Woods Attack, I think the only way to combat the spam attack on full nodes is by having a staking mechanism that limits who is “allowed” to post blocks for a given rollup and which can penalize any allowed person who spams or produces invalid blocks.
Of course anyone is allowed to post blocks to any namespace on the Celestia chain, but a rollup could use the a staking mechanism to agree on a set of keys who are “allowed” to produce blocks in their namespace. Blocks posted by anyone who is not on that list are ignored out of hand by looking at their signature. This does not prevent someone on the “allowed” list from spamming however, so there needs to be some kind of punishment like that detects misbehavior and removes them from the list.
Why a rollup-specific token may not always be the best solution
In order for a rollup’s staking mechanism to function, it needs a token with value to stake. I can see 2 scenarios for choosing a token to use as staking.
- the rollup mints its own token to stake
- the rollup agrees to use a third party token as its staking currency
While 1 works well and might even be preferred by some rollups, it also has problems. Not every rollup will want to bootstrap a new token, imbue it with value and ensure that it is liquid. Part of Celestia’s value proposition is that you don’t have to go through this consuming process if you don’t want to.
For 2, the question becomes which token to use and how to bridge that token into the rollup in order to stake it. Below I propose a way in which the Celestia token “TIA” can be used for this purpose.
My proposal: namespace staking and blacklisting
I propose that the Celestia main-chain support a transaction type that allows people to stake TIA tokens to a particular namespace. Using this on-chain stake as a reference, a rollup can build an off-chain staking mechanism that effectively prevents spam attacks.
I know what you’re thinking–“you can’t slash on-chain stake from the rollup, so how can you punish misbehavior?” Drawing inspiration from John’s post we can use blacklisting rather than slashing as punishment.
Here’s how it would work:
- the rollup sets a minimum threshold of TIA tokens that must be staked to the rollup’s namespace in order for an address to be considered an “approved” block producer
- any block posted to that namespace by an address not on the “approved” list is ignored (which prevents random people from spamming)
- if any approved block producer “misbehaves” they are blacklisted and no longer considered on the list of approved block producers so there future blocks are ignored. Here “misbehavior” is defined by the rollup and could be something like “posts an invalid block”.
- once blacklisted the misbehaving block producer would have to wait for an unbonding period (set by the celestia main-chain) until rebonding and being allowed to post blocks again.
Why this would work
This is an effective spam mitigation strategy because it makes it expensive to spam the rollup with invalid blocks. You can only “misbehave” once before being blacklisted, so the cost of executing n misbehaviors scales as n*min_stake. Rollups can calibrate their own values for min_stake and their own definitions of “misbehavior” according to their security thresholds.
Some advantages of staking TIA rather than a different coin
Here are some reasons why it makes sense to use TIA for to prevent spam in a rollup rather than other third party coins.
- TIA may solve an underlying issue in seeding a new rollup with 3rd party staking tokens. How do you bridge the 3rd party tokens into the rollup to stake them before the rollup even exists? Bonding TIA does not have this problem as it is native to Celestia itself.
- TIA tokens and TIA wallets can serve as a standard staking mechanism for aggregators. That way Celestia aggregators can stake and produce blocks on many rollups with less overhead.
- It adds a new use case for the TIA token potentially driving more value into the network.
Bonus point: this may also be useful to mitigate MEV
While the motivation of this post was to use namespace staking to prevent spam, I believe this mechanism could also be used for leader selection within a rollup which might be necessary to mitigate Miner Extractable Value (MEV).
To generalize this further, namespace staking may be a useful primitive for any rollup to create a permissionless set of block producers which potentially has many other useful applications beyond just spam and MEV mitigation. Worth looking into more deeply!