Charge fees by transaction gas limit, not by note size
leafcutterant opened this issue · 4 comments
For withdrawals through a relayer, the current implementation charges fees by the following scheme (notation mine, feel free to correct):
relayerFeeCurrent
= noteSize
* relayerFeeLevel
+ gasLimitPromised
* gasPricePromised
To take a concrete example:
relayerFeeCurrent
= 100 ETH * 1% + 500 000 gas * 20 gwei = 1.01 ETH
There are multiple problems with this scheme. The main one is that in practice the relayer's costs don't depend on the note size. Submitting a withdrawal for a 0.1 ETH and a 1000 ETH note is the same cost and effort for a relayer. The scheme thus results in rent-seeking behavior, which is economically non-optimal.
An economically optimal scheme would look like this:
relayerFeeOptimal
= gasLimitPromised
* gasPricePromised
* ( 1 + relayerFeeLevel
)
An example, with a different fee level:
relayerFeeOptimal
= 500 000 gas * 20 gwei * ( 1 + 40% ) = 0.014 ETH
The actual fee level is not the important part, as it could be set to generate the same revenue for the relayer. The point is transparency. To get the same revenue (1.01 ETH) with this model, they would have to admit they are operating with a 10 000% (!) feeLevel
when processing 100 ETH notes.
This new scheme reflects better the proportion of the actual fee, i.e. how expensive it is compared to the user withdrawing without a relayer, using their own ETH. That helps users make a rational decision between relayers (that is, if they know they have options, which is not really the case right now). Competition will drive fee levels down, making Tornado cheaper, attracting more users, and ultimately increasing the anonymity sets.
The above scheme doesn't deal with another problem, which I will address in another issue.
Edit: corrected equations and wording.
@rstormsf why did you close my issue, especially without any discussion?
Sorry, reopened.
Feel free to contribute this feature to the repo, it's been sitting here for months.
@leafcutterant please let us know if you are planning to build this feature