ACCOUNT_TPS* 2(LEVEL_CPS * ACCOUNT_TPS) / log(ACCOUNT_AGE)
Let's define a spammer as an entity increasing the CPS and users as entities whose actions/transactions do not increase the cps. We can differentiate a user's transaction from a spammer's transactions by looking at the transaction's tendency to increase the cps. At the same time, it could be Binance, so thus defining threat as a function of all factors contributing to the increase in cps and known differences between a spammer and a user.
The network updates certain variables at NETWORK_TIME T in an interval X (time).
If a transaction is made in the same interval X:
ACCOUNT_TPS = block_height since the last interval
ACCOUNT_TPS = (block_height - previous block_height) divided by ACCOUNT_AGE
NETWORK_CPS = CPS of the network at NETWORK_TIME
There are n = 38 levels created at 10% of Nano raw.
if LEVEL_CPS[n] at T > LEVEL_TPS[n] at T-1:
LEVEL_CPS [n] = total number of confirmed transactions from a
level in an interval divided by total number of transactions confirmed by the network in that interval.
LEVEL_CPS [n] =
(LEVEL_CPS[n] at T-1) / 2
ACCOUNT_AGE : Age of the account. Starts with 2. And increases by 1 for every interval since the creation of the account.
Normally, the account age is supposed to be the total number of intervals since the creation of the account.
Testing the perseverance of an attacker:
Let's introduce another variable: NUM_CONTINUOUS_TRANSACTIONS
NUM_CONTINUOUS_TRANSACTIONS: Total number of continuous transactions.
if ACCOUNT_TPS > 1 //if it's a transaction within the interval
NUM_CONTINUOUS_TRANSACTIONS += 1
if NUM_CONTINUOUS_TRANSACTIONS != 0
NUM_CONTINUOUS_TRANSACTIONS -= 1
if NUM_CONTINUOUS_TRANSACTIONS == 0 and ACCOUNT_AGE > 16
ACCOUNT_AGE = 2 //The account has been sleeping for a while
This way, someone really using the network can take advantage of the account_age, at the same it also creates a barrier of entry for spammers.
If the transactions are queued based on the threat they pose to increase the cps, we can even have the bottom X% of the queue to do the higher pow to begin with.
This draft is an update from the previous draft. It attempts to improve on the function. Since I haven't explained many reasonings, feel free to ask questions, make suggestions, or point where I am wrong.