This document provides a straightforward way to calculate the cost-of-attack on Saito Consensus given known mining costs. It shows how cost-of-attack is guaranteed to be positive. Feedback and peer review is welcome.
This model assumes the staking table is not controlled by the attacker of the network. If the staking table is fully-controlled by an attacker, the cost-of-attack on the network is maintained by the way the network smoothes outbound payments. This detail is left out-of-model in order to simplify the cost-of-attack calculations.
x = expected return of the attack
f = all transactions fees in the block
p = proportion of attacker fees in blocks
d = depth in number of blocks attacker waits to mine
c = cost of mining a golden ticket
Ps = paysplit (division of block reward between router and miner)
Pw = powsplit (division of pay between minter and stakers)
In Saito the Block Reward is the made up of transaction fees.
In Saito the block reward does not go to the block creator. Rather, the reward is split between the routing network and a miner. The miner creates the randomness to select the node from the routing network that wins the routing reward.
The proportion of the block reward awarded to the routing network and miner is known as the 'paysplit'. Here we will concentrate on Saito's standard implimentation of a paysplit of 0.5.
The randomness is created by the miner solving a cryptographic puzzle on the hash of the proceeding block. The solution to the puzzle is called a 'golden ticket'. If no golden ticket is found, no block reward is paid to the network and no prize if paid to the miner.
In early versions of Saito unallocated block rewards that resulted from blocks going unsolved were burned or moved into the network treasury. In the production version token holders can stake their tokens. When a golden ticket is found and the previous block is paid, the same solution is hashed and recursively applied to any preceding blocks that have not be paid out. The unpaid routing and mining rewards are then paid to routers and stakers.
This represents an improvement to the Saito protocal. It provides an elegant way to accomodating variance in the mining of golden tickets, and it increases security above 100 percent of fee throughput in most cases.
The portion of reventue that goes to stakers can be determined using mining difficulty. Specifically mining difficulty can adjust to ensure an average of one golden ticket per n blocks.
It is also assumed that the attacker has sufficient tokens and network connectivity to fill blocks with attack transactions routed only to themselves.
Given the attacker's ability to control difficulty we are assuming they will be completely successful in mining golden ticket solutions when they choose, though exponential increases in mining difficulty will ensure a set ratio of golden tickets per block.
Given these conditions the expected reward for an attack over time on the network will be:
mining reward + routing reward - mining costs
We are presuming the miner uses one of the golden ticket solutions found so their expected reward includes the miner reward or golden ticket prize.
A miner cannot get paid for multiple golden ticket solutions, so for the expected reward is simply:
If the attacker finds a golden ticket that pays one their own node they are paid the entire block reward. The expected reward for a block into which the attacker has stuffed p of their own fees is:
But, the attacker is only getting the honest fees back, so for a single golden ticket solution the payout is the portion of fees that go to the routing reward minus the fees the attacker put into the block :
Hashing to find n solutions yields an expected outcome of:
Given also that the attacker is waiting d blocks to hash, to optimise the number of blocks paying out in their favor, expected routing reward becomes:
Given the attacker's access to hashpower calculating mining cost is a simple function. The expected cost of mining n golden tickets is: . But the attacker will stop mining if they have found a solution that has solved all outstanding blocks.
Of course, the miner will stop mining once they have found a golden ticket solution that pays them the full routing reward for all outstanding blocks.
The chance that a solution solves all blocks in the attacker's favour is . So the expected savings per golden ticket, after the first is . The cost of mining when is then:
Combining the above we have:
|No GTs||GT Payout||Routing Reward||Mining Cost||Result|
For all sets of parameters set we can see that while there is an optimal number of golden tickets per block to mine, this optimum still fails to return to the attacker more than they are spending.