Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Participation Protocols - Deterministic Rules #62

Open
mattyg opened this issue Mar 15, 2023 · 0 comments
Open

Participation Protocols - Deterministic Rules #62

mattyg opened this issue Mar 15, 2023 · 0 comments

Comments

@mattyg
Copy link
Collaborator

mattyg commented Mar 15, 2023

It makes sense to split Participation Protocols into a few classes:

This ticket outlines the Hard Rules ruleset. The ruleset should be sufficiently flexible to support a wide range of actual use-cases of rules, without needing to fork the integrity zome.

In order to achieve this, when publishing a Mew, the author must include their chosen Rules for participation. Those rules published in an Entry which must exist on the DHT. Then, upon validation, we do a must_get_ call on the rules Entry, and apply the validation rules specified within it.

Deterministic Rules

  • Allow list of types of responses: licks, mewmews, quotes, replies
  • Allow list of AgentPubKeys who can respond
  • Deny list of AgentPubKeys who cannot respond
  • Allow list of words / phrases (lowercase comparison) that can be included in a response text
  • Deny list of words / phrases (lowercase comparison) that cannot be included in a response text
  • List of "moderator" AgentPubKeys where all signatures are required to to publish a response
  • List of "moderator" AgentPubKeys where M of N threshold of signatures is required to publish a response

Architecture

struct Mew {
...
  response_ruleset: EntryHash,
  approval_signatures: Vec<ActionHash> // signed valid actions from the approved_by_agents, where the entry is a MewApproval and the MewApproval's MewContent matches this Mew's content
}

struct ResponseRuleSet {
  name: Option<String>,
  description: Option<String>,
  rules: Vec<ResponseRule> // If *any* of theses rules fail validation, the response is invalid
}

struct ResponseRule {
  agents_allowed: Vec<AgentPubKey>, // block list takes precedent over allow list (i.e. if an agent is both allowed & blocked, they are blocked
  agents_blocked: Vec<AgentPubKey>,
  response_types_allowed: Vec<MewType>,
  response_types_blocked: Vec<MewType>,
  content_allowed: Vec<String>, // both mew content text and content rule are compared as lowercase strings
  content_blocked: Vec<String>,
  approved_by_agents: Vec<RequireApprovalRule>, // require a signature by these agents "approving" the Mew
  approved_by_agents_threshold: Option<u64>,  // None means that **all** agents must approve, Some(u64) means that at least that number of agents must approve
}


struct MewApproval {
 mew_author: AgentPubKey, // author of mew content
 mew_content: MewContent, // MewContent that is approved
 approved_by: AgentPubKey // agent authoring this MewApproval
}
@mattyg mattyg changed the title Participation Protocols - "Hard" Rules Participation Protocols - Deterministic Rules Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Clarification
Development

No branches or pull requests

1 participant