vacp2p / research

Thinking in code
MIT License
62 stars 4 forks source link

Incentivizing Waku Services using Service Credentials (store protocol) #99

Open staheri14 opened 2 years ago

staheri14 commented 2 years ago

Context

Borrowed from https://forum.vac.dev/t/vac-sustainability-and-business-workshop/116

Waku nodes provide services that have a specific cost and this should be incentivized in a service network. The first step is RLN Relay, which is used for private spam protection. It is based on detecting and punishing the sending of multiple messages in a given epoch over the gossip network. After RLN, the next focus is store protocol, then filter/lightpush protocols. These are all request-reply protocols. We believe credentials and subscription-based abstractions play an important role in incentivization.

Service credentials at a high level: Service consumers need to purchase Service credentials or Tokens in order to obtain service from waku nodes. The service consumer pays the cost of its service by handing its token/credentials to the provider. The service provider can then claim funds associated with that credential.

The service credential incentivization model has multiple benefits:

Problem

This issue is specifically focused on enabling privacy-preserving service credentials for the Waku store protocol by adopting the privacy-preserving payment model.

Solution overview

Privacy-preserving payment model

At a high level,

A typical Privacy-preserving payment model uses smart contracts that accept tokens deposits from one address and enable their withdrawal from a different address. Those smart contracts work as pools that mix all deposited assets. While tokens are in a Cash pool, the custody remains in users’ hands. Users, therefore, have complete control over their tokens

Users prove the ownership of their deposits anonymously using zk-Snark proofs by having the witness to the zk-Snark circuit (see the relevant articles in the resources section).

Integration idea

This Privacy-preserving payment model can be used to incentivize the waku store protocol:

To be investigated

Resources

Acceptance criteria

cc: @oskarth

oskarth commented 2 years ago

Great stuff, I think this covers what we've talked about before. Some quick notes:

staheri14 commented 1 year ago

@s1fr0 following our conversation in the PM call regarding the next steps of the waku store protocol incentivization, here is the initial issue which captures the problem and the high-level solution idea. The development roadmap with more fine-grained milestones are captured in i.e., https://github.com/vacp2p/research/issues/135

As the first step, we need to decide on the payment model i.e., whether 1) users can spend (deposit & withdraw) a fraction of their service credentials 2) users can not spend a fraction of their service credentials and what are the pros and cons? If you could please look into that and see from the technical pov what are the trade-offs, that would be great. Once you share your thoughts in here, then we can make the next move and begin with the first milestone sketched in this issue https://github.com/vacp2p/research/issues/135

Please have a look at this issue and the nwaku one and let me know if you have any comments or concerns.