Overview

A provider DAO is a group of Kinodes, cooperating on- and off-chain to provide some service to some other group (perhaps a group of Kinodes, perhaps public). There are three main roles DAO members can take. The simplest model involves all members taking on all roles, but you can also imagine a case where different members provide different roles. To make the discussion concrete, say that the provider DAO vggbois provides a particular ML model, vgg16. The three roles are:

  1. Serving (i.e. taking in an input, plugging that input into vgg16, and then sending an output),
  2. Routing (i.e. making sure a Request gets to a DAO member that can serve it),
  3. Policing (i.e. making sure other DAO members are providing good service, by some standard).

Additional parts of the system are payment for services provided; possibly provider staking, to reduce the likelihood of bad behavior.

DAO members coordinate on-chain via rollup-based smart contract as well as off-chain on the Kinode network. Communication is off-chain unless it must be on-chain.

The contract consists of:

  1. A list of DAO members,
  2. DAO parameters (e.g. uptime requirements, latency requirements, etc),
  3. Means for voting on:
    1. Kicking out & (temporarily?) blacklisting non-performing members. This should probably be designed for both automated and manual use,
    2. Updating DAO parameters.

What does policing look like?

Policing takes three forms:

  1. Uptime (i.e. DAO members must be online and responsive a certain fraction of the time),
  2. Latency (i.e. DAO members must Respond to Requests within some certain amount of time),
  3. Actually doing the computation (i.e. DAO members are doing the real computation and not just making up a result).

For the purposes of this document, 3 is out-of-scope. The real way to confirm computation is by ZK proof; in practice, this is going to be too slow for almost any application today. It might be possible to come up with a game theoretic means to assert the computation is correct, but it is non-trivial. For now, enforcement will be assumed to be social, i.e. clients will not use DAOs that scam, and DAOs will self-police to kick out scammers in their midst to save their own reputations.

Uptime policing looks like:

  1. DAO defines some required uptime,
  2. DAO defines other rules (?),
  3. If a DAO member does not satisfy requirement, an automated(?) vote occurs, with majority leading to some corrective action, most probably removal of the member from the DAO and temporary(?) blacklisting.

What does routing look like?

Requests can be sent to any DAO member. In general, clients should randomly select from amongst the DAO members, pinging some set of them at a time and sending the Request to the first responder.

The simplest routing policy is to always serve a Request yourself unless you are overloaded, in which case, pass to a random other member. However, there are benefits to requiring a Request Always be routed.

  1. Load can be more evenly balanced across DAO members if the DAO tracks queues off-chain,
  2. Statistics can be gathered by DAO members on other DAO members, e.g., how long a job took. Otherwise, stats are self-reported and, therefore, easy to fake,
  3. The router is another party in determination of when service is rendered & escrowed payment is unlocked.

If the input is large, any benefit is probably outweighed by the cost of sending the data an extra hop.

Step-by-step implementation plan

MVP

  1. Routers are listed on-chain,
  2. Users query chain & ping batches of N random routers,
  3. Send Request to first responder,
  4. Router serves or routes as appropriate.

Additional features

Raft consensus amongst DAO members for off-chain data

Some things to store in Raft:

  1. Uptime measurements (per member),
  2. Queue status (per member),
  3. Job completion time history (per member),
  4. RNG seed/next member to get job (?),
  5. DAO parameters,
  6. Client blacklist (?).

Raft is used for/unlocks:

  1. Uptime policing (can we use Raft's pinging to measure uptime or do we need our own pinging protocol?),
  2. Routing based on queues & avg. completion time/latency

Payment

Payment stored in escrow until service rendered. How to determine when to unlock?

  1. Client says "Response received". Issue here is: evil clients.
  2. If routed through a fellow DAO member, DAO member says "Response sent" after receiving from server. Issue here is: multiple evil DAO members.

Given our assumptions above (that DAO members computing actual result is policed socially), the second option makes more sense. Again, this only works for inputs that are not so large as to be very costly to send on an additional network hop.

Original gist on GitHub