vacp2p / rln-contract

RLN contract
Apache License 2.0
13 stars 6 forks source link

Use a variable membership deposit #14

Open rymnc opened 1 year ago

rymnc commented 1 year ago

Currently, if msg.value != MEMBERSHIP_DEPOSIT, then we do not allow this as a valid registration. However, to

  1. increase the messaging rate for a given idCommitment, there may be some merit in accepting valid multiples of MEMBERSHIP_DEPOSIT, for example, 2x, 3x and 5x.
  2. accept fee-less registrations (Interep), we should track the amount deposited since we should not refund the Interep registrations.
  3. allow for variable registration fees based on market value (as mentioned by @s1fr0)

We need to track and refund their deposit appropriately.

s1fr0 commented 1 year ago

Given your proposal, it seems you want to pay multiple fees for the same commitment, i.e. increase the user's message rate. Given this, how do you compute then ZK proofs so that e.g. 2 proofs do not reveal the private key?

rymnc commented 1 year ago

Updated the issue to include 2.

rymnc commented 1 year ago

Given your proposal, it seems you want to pay multiple fees for the same commitment, i.e. increase the user's message rate. Given this, how do you compute then ZK proofs so that e.g. 2 proofs do not reveal the private key?

Hmm, not sure about this yet. However, I do think we should still track deposits so that we can make appropriate refunds. WDYT?

s1fr0 commented 1 year ago

Hmm, not sure about this yet.

that's why is important to reach consensus on new protocol changes first :)

I do think we should still track deposits so that we can make appropriate refunds.

probably, but I'm not sure about consequences (in terms of anonymity but also in case the coin price goes very low, users may slash themselves to take back their funds, resell them, and pay a new fee with a lower economic value).

rymnc commented 1 year ago

How would it affect anonymity? The latter scenario seems perfectly fine, in case they wish to slash themselves.

s1fr0 commented 1 year ago

If many people leave at the same time for an economic reason, the anonymity set reduces and the tree would be populated quickly (adding complexity on nodes) if peers keep joining/leaving: the market will incentivize this behavior, since the gas cost that disincentive multiple registrations/refund is now balanced by the floating market value of the underlying coin. Probably we should burn e.g. 20% of the fee when refunding.

In any case the ZK circuit remains the main problem: maybe instead of using id_commitments as leaves, we can use (id_commitment || remaining_deposit) and compute roots accordingly.

rymnc commented 1 year ago

There is an open PR to introduce protocol fees - https://github.com/vacp2p/rln-contract/pull/5 We can have the fee applied on both deposits and withdrawals to disincentivize that behaviour.