waku-org / nwaku

Waku node and protocol.
Other
199 stars 51 forks source link

feat: POC incentivisation protocol #2847

Closed jm-clius closed 2 months ago

jm-clius commented 2 months ago

Problem

This is a simplification and restatement of https://github.com/waku-org/nwaku/issues/1961

The goal of this issue is to create a proof of concept branch in nwaku, with the following new feature: incentivise light protocol requests requiring a proof of payment in the form of a raw on-chain transaction in order to be processed. After successfully validating that the transaction exists, the requested node will respond with successful response.

Note that this is intended to stay as an experimental branch, and most likely not merged into master in the short term. It will help explore some of the concepts set out in this overview document

Suggested solution

Some informal requirements. Let requester be the node that requests the generic service and responder the full node that provides the service:

Some notes:

The deliverable would be a branch with such a feature, where a requester and responder instance can be run illustrating the interaction. For POC purposes the requester and responder can be initialised only in some unit test cases, showing both successful and unsuccessful attempts.

Ivansete-status commented 2 months ago

Thanks for the detailed description @jm-clius ! Do we have an expected date for completion? I think @NagyZoltanPeter can help in that matter :) Cheers

jm-clius commented 2 months ago

Ah! This is something that @s-tikhomirov is already working on and is just aimed to improve the scope and description of his work. I think it should be done within the next 2 weeks, as he's making steady progress

s-tikhomirov commented 2 months ago

confirm existence of a transaction ID on chain

Should we care about possible re-orgs? In other words, should it matter at which depth the transaction is included?

jm-clius commented 2 months ago

I think not. For the sake of simplicity we can even write our POC test to check for any existing (old) transaction hash.

NagyZoltanPeter commented 2 months ago

@s-tikhomirov , @jm-clius: Sorry to talk in... maybe a full stupid question: Do we want that a node serving a store/lightpush/... request to check on-chain data? How fast is it? How will we merge with DOS protection?

For the first read, it seems to me a similar problem that is normally solved (in web2 world) with oauth or jwt. So the transaction is checked separately and you get a token that is valid for a certain amount of time/request/bandwidth or combination. Such token can be easily combined with current DOS protection and has no much resources needed to validate. Also, request prioritization can be solved easily.

Sorry for talking into it.... just my two cents with my limited knowledge on the topic.

jm-clius commented 2 months ago

Not in the least a stupid question. :) I think it's clear that the POC model of a service node doing on-chain checks for every request will probably not be fast enough. We do want to evolve this into a much more comprehensive model where requesters use some service credentials/micropayments to get access to a service. Combining this with authenticated session logic sounds like a promising solution. For now, note that the POC is only meant to explore some of the main concepts and libraries and will not be merged into production code.

s-tikhomirov commented 2 months ago

Merged into a feature branch as planned, closing this issue.