Skip to content

Instantly share code, notes, and snippets.

@meyer9
Last active August 5, 2018 23:25
Show Gist options
  • Save meyer9/eb9aa2ef0867a61d8af9e3e6e4393482 to your computer and use it in GitHub Desktop.
Save meyer9/eb9aa2ef0867a61d8af9e3e6e4393482 to your computer and use it in GitHub Desktop.
Security Analysis of TPoS

Note to XSN devs: Not to dwell on TPoS, but I'm on vacation and have nothing better to do than analyze protocols of other coins.

Introduction

I'm arguing against XSN's claim that TPoS increases network security. It either decreases or does not change security.

We'll analyze how much it costs for an attacker to attack the network through a 51% attack by either buying up 51% of coins or bribing 51% of staking power. Note that the second scenario is much more applicable to Proof-of-Stake because market liquidity generally prevents buying 51% of the coins in any economically-efficient attack, so we'll focus on that.

The second scenario is easier because users do not have to give away/sell their coins to participate in the attack. Users simply have to act like the attacker asks. (Download a different client)

TPoS enables stakers to allow others to stake their coins for a (generally) small commission.

Formalizing the Cost for an Attacker to Bribe Stakers

We'll conservatively assume that once the network is 51% attacked, the value of coins will go to 0. This means that any stakers that agree to the bribe will lose the value of their entire stake.

The cost to the attacker is equal to the benefit to the staker. (Because the attacker pays the staker)

For the staker to agree to the bribe, benefit > cost. As defined above, cost = staker's sellable stake. This means that if a staker owns 10 coins, for the staker to agree to the bribe, the attacker must pay the staker greater than 10 coins.

Thus, the cost for an attacker to bribe a certain staker is equal to their sellable stake in the network. Note that for a TPoS merchant selling a staking server, the sellable stake does not equal the amount of staking power they have.

Does TPoS increase security?

For the simple buy-up-51% attack, yes. The number of coins being staked is larger because the barrier-to-entry of staking is lower. This means more coins are being staked and more coins that must be used to 51% attack the network. However, as stated above, this attack is unrealistic.

For the bribing attacker model, the cost to the attacker is significantly lower to attack the network. A TPoS merchant can own close to 0 coins (have no sellable stake), and yet control a large amount of staking power on the network (possibly up to 2-3%).

For normal staking, sellable stake = staking power meaning that the cost to attacker of 51% attack (non-TPoS) > 51% of entire market cap.

For TPoS staking, sellable stake <= staking power meaning that the cost to attacker of 51% attack (TPoS) < 51% of entire market cap.

Therefore, cost to attacker of 51% attack (TPoS) < cost to attacker of 51% attack (non-TPoS). The attacker's advantage (cost to attacker (non-TPoS) - cost to attacker (TPoS)) is then equal to the number of coins being staked using TPoS.

Coin Age

Doesn't affect any argument above. I proved that TPoS decreases network security, not that it is easy to 51% attack the network.

Requiring Collateral

Network security is still reduced. This makes the attacker's advantage lower, but does not change the fundamental fact that TPoS decreases security. Requiring a (non-stakable) collateral would cause the attacker's advantage to reduce to max(0, number of coins merchant is staking - collateral). In the case that the collateral is > the number of coins the merchant is staking, TPoS makes no sense because the merchant may as well just stake those coins.

TPoS gives security to people staking by doing it in cold storage

Great. Network security is more important than user security. Network security affects all network participants whereas user security affects only a single person.

Bribing Attacker Model can be applied to any coin

TPoS makes the cheapest attack cheaper meaning that it decreases network security.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment