Update curation.md

This commit is contained in:
Jimmy Debe 2024-02-05 04:22:37 -05:00 committed by GitHub
parent eb2237cc4f
commit 60fcdd5737
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 12 deletions

View File

@ -2,44 +2,44 @@
slug: 24 slug: 24
title: 24/STATUS-CURATION title: 24/STATUS-CURATION
name: Status Community Directory Curation Voting using Waku v2 name: Status Community Directory Curation Voting using Waku v2
status: raw status: draft
tags: waku-application tags: waku-application
description: A voting protocol for SNT holders to submit votes to a smart contract. Voting is immutable, which helps avoid sabotage from malicious peers. description: A voting protocol for SNT holders to submit votes to a smart contract. Voting is immutable, which helps avoid sabotage from malicious peers.
editor: Szymon Szlachtowicz <szymon.s@ethworks.io> editor: Szymon Szlachtowicz <szymon.s@ethworks.io>
--- ---
# Abstract ## Abstract
This specification is a voting protocol for peers to submit votes to a smart contract. Voting is immutable, This specification is a voting protocol for peers to submit votes to a smart contract. Voting is immutable,
this will help avoid sabotage from malicious peers. this will help avoid sabotage from malicious peers.
# Motivation ## Motivation
In open p2p protocol there is an issue with voting off-chain as there is much room for malicious peers to only include votes that support their case when submitting votes to chain. In open p2p protocol there is an issue with voting off-chain as there is much room for malicious peers to only include votes that support their case when submitting votes to chain.
Proposed solution is to aggregate votes over waku and allow users to submit votes to smart contract that aren't already submitted. Proposed solution is to aggregate votes over waku and allow users to submit votes to smart contract that aren't already submitted.
# Smart contract ### Smart contract
Voting should be finalized on chain so that the finished vote is immutable. Voting should be finalized on chain so that the finished vote is immutable.
Because of that, smart contract needs to be deployed. Because of that, smart contract needs to be deployed.
When votes are submitted smart contract has to verify what votes are properly signed and that sender has correct amount of SNT. When votes are submitted smart contract has to verify what votes are properly signed and that sender has correct amount of SNT.
When Vote is verified the amount of SNT voted on specific topic by specific sender is saved on chain. When Vote is verified the amount of SNT voted on specific topic by specific sender is saved on chain.
## Double voting ### Double voting
Smart contract should also keep a list of all signatures so that no one can send the same vote twice. Smart contract should also keep a list of all signatures so that no one can send the same vote twice.
Another possibility is to allow each sender to only vote once. Another possibility is to allow each sender to only vote once.
## Initializing Vote ### Initializing Vote
When someone wants to initialize vote he has to send a transaction to smart contract that will create a new voting session. When someone wants to initialize vote he has to send a transaction to smart contract that will create a new voting session.
When initializing a user has to specify type of vote (Addition, Deletion), amount of his initial SNT to submit and public key of community under vote. When initializing a user has to specify type of vote (Addition, Deletion), amount of his initial SNT to submit and public key of community under vote.
Smart contract will return a ID which is identifier of voting session. Smart contract will return a ID which is identifier of voting session.
Also there will be function on Smart Contract that when given community public key it will return voting session ID or undefined if community isn't under vote. Also there will be function on Smart Contract that when given community public key it will return voting session ID or undefined if community isn't under vote.
# Voting ## Voting
## Sending votes ### Sending votes
Sending votes is simple every peer is able to send a message to Waku topic specific to given application: Sending votes is simple every peer is able to send a message to Waku topic specific to given application:
``` ```
@ -59,11 +59,11 @@ type Vote = {
} }
``` ```
## Aggregating votes ### Aggregating votes
Every peer that is opening specific voting session will listen to votes sent over p2p network, and aggregate them for a single transaction to chain. Every peer that is opening specific voting session will listen to votes sent over p2p network, and aggregate them for a single transaction to chain.
## Submitting to chain ### Submitting to chain
Every peer that has aggregated at least one vote will be able to send them to smart contract. Every peer that has aggregated at least one vote will be able to send them to smart contract.
When someone votes he will aggregate his own vote and will be able to immediately send it. When someone votes he will aggregate his own vote and will be able to immediately send it.
@ -72,12 +72,12 @@ Peer doesn't need to vote to be able to submit the votes to the chain.
Smart contract needs to verify that all votes are valid (eg. all senders had enough SNT, all votes are correctly signed) and that votes aren't duplicated on smart contract. Smart contract needs to verify that all votes are valid (eg. all senders had enough SNT, all votes are correctly signed) and that votes aren't duplicated on smart contract.
## Finalizing ### Finalizing
Once the vote deadline has expired, the smart contract will not accept votes anymore. Once the vote deadline has expired, the smart contract will not accept votes anymore.
Also directory will be updated according to vote results (community added to directory, removed etc.) Also directory will be updated according to vote results (community added to directory, removed etc.)
# Copyright ## Copyright
Copyright and related rights waived via Copyright and related rights waived via
[CC0](https://creativecommons.org/publicdomain/zero/1.0/). [CC0](https://creativecommons.org/publicdomain/zero/1.0/).