[NKP-0014] Use PoW to prevent generate ID txn spam

Proposer: @Mutsi

Currently there are many spam generate ID txn in the network and normal nodes need to wait really a long time to join or have to pay. One way to prevent such attack is by adding a (non-trivial) minimal registration fee when generating ID, but it then becomes inconvenient to people who want to start mining, and any one-click solution will be no longer one-click anymore.

What is being proposed here is another solution (that has been proposed in S/Kademlia as crypto puzzle): adding a PoW task when generating an ID. For example, we can require that the txn hash of the generating ID txn be smaller than a threshold such that it takes X minutes on average for a normal CPU to find a solution. The advantage of this solution is that it can effectively reduce attacks (given appropriate parameter) while still making it free for normal users to join, at the cost of X minutes of waiting time on average.

  • Yes
  • No

0 voters

4 Likes

So elegant :notes: :notes: :notes:

This combined with [NKP-0015] Removing inactive ID to reduce database size should put a quick end to the troubles being caused by the ongoing spam attack :muscle:

Well done, @Mutsi and team :bowing_man:

Just added a poll to vote :slight_smile:

Implemented in https://github.com/nknorg/nkn/pull/634

1 Like