dgf-prototype/specification/docs/system-design.md

3.2 KiB

System Design

In the Requirements section, we identified the need for the following smart contracts: Reputation, Bench, Forum, Work, Proposal, and Rollup.

We also identified the need for a mechanism for coordinating Rollup Post validation. To address this need, we introduce Matrix, a federated messaging protocol with multiple implementations. Our application uses the Client-Server protocol to communicate with a Matrix Homeserver.

Contracts

The following is a dependency graph, where the arrows represent one contract calling another.

flowchart BT
subgraph Core Contracts
Reputation
Bench
Forum
end
subgraph Business Logic
Work
Proposal
Rollup
end
Bench --> Reputation
Work --> Reputation
Work --> Bench
Proposal --> Reputation
Proposal --> Bench
Forum --> Reputation
Bench --> Forum
Rollup --> Bench

Reputation, Forum, and Bench can be considered core contracts. Together they provide the necessary primitives for a DAO to carry out its business.

Work, Proposal, and Rollup can be considered business logic. They allow the DAO to support arbitrarily complex use cases, according to its needs.

Reputation

We can achieve the requirements of the Reputation contract as follows:

  1. Reputation may be implemented as an ERC20 token contract.

  2. transfer and transferFrom methods must be disabled, so that REP may not be transferred.

  3. Reputation internal methods (mint, burn, update) may be called only by the Bench and Forum contracts.

Bench

To achieve the Bench requirements, the contract must do the following:

  1. Keep a record of Validation Pools

  2. Implement a method for initiating a Validation Pool (VP)

  3. Implement a method for evaluating the outcome of a Validation Pool

  4. Define a minimum quorum

  5. Define a minimum and maximum VP duration

Work

Proposal

Forum

Rollup

Rather than submit every Post on-chain and conduct every Validation Pool on-chain, it is more efficient to keep a collection of Posts off-chain, and add a single Rollup Post on-chain representing multiple off-chain Posts.

With this Rollup Post, we have the opportunity to attribute credit to multiple authors, with a weight assigned to each author. We can express this weight as parts per million (PPM), for a balance between numerical precision, and ease of visual recognition.

The Rollup Post can weight authorship in accordance with the off-chain Validation Pools that have taken place. The off-chain system can fully model the Forum and Bench outlined in the Requirements section. For demonstration purposes, our prototype makes some simplifying assumptions. Work Evidence Posts (WEV) are assumed to contain no references to prior Posts. In reality, we want WEV to be able to reference prior Posts, such as those representing policies of the DAO, prior work by other DAO members, prior art outside the DAO, and so on. So, a proper implementation of this system should account for these references, just as the Forum contract must.

Automated Staking

  • On-chain Direct Pool
  • Rollup

Web App

API

  • Read
  • Write

Other

  • Widget
  • Register Matrix Identity
  • Imprt from Semantic Scholar
  • Import from Matrix
  • Bot Commands