This documents aims to enlist the engineering work that needs to be done to enable payments to L2s. Note that L1 ↔ L2 retrievals will not be on the critical path to serving service worker requests. L1s really will only send rate limited synthetic traffic to L2s and we can pay L2s for this synthetic traffic so as to incentivise people to run Station nodes.
High level flow
- Station instantiates L2 with a FIL address.
- The L1 production network asynchronously sends synthetic retrieval requests to L2s. These are not on the critical path to serving requests to the browser.
- L2s periodically submit logs of retrievals served to L1s with their FIL address to the log service.
- L1s periodically submit logs of retrievals served by L2s to the log service. For both this and the above, both L1s and L2s use a shared unique uuid to identify the same retrieval request.
- The log service should have strong DDOS protections because it’s very cheap to create L2s and spam/DOS the log service.
- L1s should rate limit how many retrieval requests they send to L2s so as to not waste L1 bandwidth as retrieving content from L2s is not on the critical path to serving retrievals to service workers.
- Note that there’s no point in using service worker logs for fraud detection as L2 retrievals are not used by L1s to serve service workers. L1s only asynchronously retrieve content from L2s.
- The log/payments service process the L1 logs and L2 logs and determines how much to pay L2s.