5. Decentralizing Central Services¶
Important: This concept is still in early development, meaning it has not been implemented yet.
Many dApps still require some off-chain services, such as search services running on a server, which, of course, can be seen as a single point of failure. To decentralize these dApp-specific services, they must fulfill the following criteria:
- Stateless: Since requests may be sent to different servers, they cannot hold a user’s state, which would only be available on one node.
- Deterministic: All servers need to produce the exact same result.
If these requirements are met, the service can be registered, defining the server behavior in a docker image.
Each server can define (1) a list of services to offer or (2) a list of services to reward.
The main idea is simply the following:
If you run my service, I will run yours.
Each server can specifiy which services we would like to see used. If another server offers them, we will also run at least as many rewarded services as the other node.
Each service specifies a verifier, which is a Wasm module (specified through an IPFS hash). This Wasm offers two functions:
function minRequests():number function verify(request:RPCRequest, responses:RPCResponse)
A minimal version could simply ensure that two requests were running and then compare them. If different, the Wasm could check with the home server and “convict” the nodes.
Convicting on chain cannot be done, but each server is able to verify the result and, if false, downgrade the score.