-
Notifications
You must be signed in to change notification settings - Fork 5
Description
I'd like to open a discussion on this crucial component of the slashing protocol, and indeed our overall economic design. Our current logic and parameters originate from back-of-the-envelope reasoning in the nucryptoeconomics compilation doc:
penalty = basePenalty.add(penaltyHistoryCoefficient.mul(penaltyHistory[_miner]));
penalty = Math.min(penalty, _minerValue.div(percentagePenaltyCoefficient));
&
BASE_PENALTY = 100
PENALTY_HISTORY_COEFFICIENT = 10
PERCENTAGE_PENALTY_COEFFICIENT = 8
(see PR nucypher/nucypher#507 for more context )
Background
In general, it's not straightforward to design penalty calculation algorithms (i.e. determining the amount X to decrease a stake Y by, given offence Z), that yields fair punishments uniformly across all Y and Z, and maximises the likelihood of behaviour aligned with the protocol's goals. It's hence unsurprising that there's some variance in the approaches taken by prominent staking+slashing networks. For example:
Livepeer:
if (del.bondedAmount > 0) {
uint256 penalty = MathUtils.percOf(delegators[_transcoder].bondedAmount, _slashAmount);
del.bondedAmount = del.bondedAmount.sub(penalty);
... }
where the _slashamount coefficient depends on the offence (failed verification, missed verification, double claiming a segment).
Casper:
fraction_to_slash: decimal = convert(convert(recently_slashed * self.SLASH_FRACTION_MULTIPLIER, "int128"), "decimal") / \ convert(convert(self.validators[validator_index].total_deposits_at_logout, "int128"), "decimal")
where self.SLASH_FRACTION_MULTIPLIER = 3.
Polkadot's most recent testnet version:
Slashing starts with a 0.001 DOTs penalty and doubles. If your node successfully passes a session, the current penalty is reduced by 50% with a minimum of 0.001 DOTs.
And if this post is accurate, then a Tezos baker who screws up will immediately lose their entire deposit, including what they would have earned from the 'offending operation'.
Discussion
Penalties calculated with absolute figures (e.g. a fixed number of tokens) run into issues:
- Volatile token conversion rate to fiat means punishment in real terms has an unpredictable multiplier
- Fixed penalties can be overly punitive to small stake holders and potentially irrelevant to large stake holders. Making them large enough to be disincentivizing to large stake holders might wipe out smaller stake holders for a single error.
However, calculations involving the percentage of the offenders' stakes are also problematic:
- They can be overly punitive to large stake holders. For example, a set 10% decrease in stake for 2 nodes who commit the same offence/error, but node A holds $100k worth of tokens and node B $1k – larger node could reasonably consider it unfair that there's a $9,900 difference in absolute terms between their respective penalties. This could lead to a disproportionate favouring of smaller stakes, depending on each individual's perceived risk that they might commit a slashable offence. This is especially important if the network ever ventures into attributing offences imperfectly, or punishes offences that could be caused by network issues or censorship (i.e. nodes failing to come online)
- Traditional crime and punishment does not generally take into account the perpetrator's wealth, as percentage based penalties do (in the sense that theoretically the letter of the law treats, or should treat, everyone the same. Of course in practice wealthier citizens have many advantages with respect to criminal justice requirements such as bail / counsel costs).
Combination ideas
A natural solution to balance the tension between absolute and percentage based penalties is to combine them.
Broad ideas:
- Fixed amount OR Percentage of stake, whichever is lower
more or less what we have now - Fixed amount OR Percentage of stake, whichever is greater
- Fixed amount AND Percentage of stake
More complex ideas: - Percentage of stake input to penalty calculation modified by the size of stake relative to others.
i.e. a tiered system wherein the greater the percentage of the total staked tokens you control, the smaller the percentage of your stake slashed given offence Z.
Although this sounds slightly unpalatable, it would avoid large nodes abandoning the network when they are punished too severely (in absolute terms). - Fixed amount figure calculated using current fiat value of tokens
i.e. using a price oracle to calculate a base punishment – e.g. minimum of $500 fine for offence Z
this would avoid uneven real-world severity of punishment due to token volatility
Choosing the exact parameters
e.g. 5% of stake if stake < 0.01% of network + fixed penalty of $100 in nu tokens
This is a to-do following a discussion of the approach. Also I think this will require scenario modelling.