-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into waku-peer-exchange
- Loading branch information
Showing
89 changed files
with
12,890 additions
and
3,894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"MD013": { | ||
"tables": false, | ||
"code_blocks" : false, | ||
"line_length" : false | ||
} | ||
|
||
"MD024": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: markdown-linting | ||
|
||
on: | ||
|
||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Markdown Linter | ||
uses: DavidAnson/markdownlint-cli2-action@v15 | ||
with: | ||
config: .github/workflows/.markdownlint.json | ||
globs: '**/*.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Codex RFCs | ||
|
||
Specifications related the Codex decentralised data storage platform. | ||
Visit [Codex specs](https://github.com/codex-storage/codex-spec) | ||
to view the new Codex specifications currently under discussion. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
# Nomos RFCs | ||
|
||
Nomos is building a secure, flexible, and | ||
scalable infrastructure for developers creating applications for the network state. | ||
To learn more about Nomos current protocols under discussion, | ||
head over to [Nomos Specs](https://github.com/logos-co/nomos-specs). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,73 +9,98 @@ editor: Szymon Szlachtowicz <[email protected]> | |
--- | ||
|
||
## 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. | ||
|
||
## 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 | ||
|
||
Voting should be finalized on chain so that the finished vote is immutable. | ||
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 Vote is verified the amount of SNT voted on specific topic by specific sender is saved on chain. | ||
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. | ||
|
||
### 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. | ||
|
||
### 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 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 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. | ||
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 | ||
|
||
### 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: | ||
|
||
```json | ||
|
||
/status-community-directory-curation-vote/1/{voting-session-id}/json | ||
|
||
``` | ||
|
||
vote object that is sent over waku should contain information about: | ||
vote object that is sent over waku should contain information about: | ||
|
||
```ts | ||
type Vote = { | ||
sender: string // address of the sender | ||
vote: string // vote sent eg. 'yes' 'no' | ||
sntAmount: BigNumber //number of snt cast on vote | ||
sign: string // cryptographic signature of a transaction (signed fields: sender,vote,sntAmount,nonce,sessionID) | ||
nonce: number // number of votes cast from this address on current vote (only if we allow multiple votes from the same sender) | ||
nonce: number // number of votes cast from this address on current vote | ||
// (only if we allow multiple votes from the same sender) | ||
sessionID: number // ID of voting session | ||
} | ||
``` | ||
### 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 | ||
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. | ||
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. | ||
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. | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,26 +9,32 @@ editor: Szymon Szlachtowicz <[email protected]> | |
--- | ||
|
||
## Abstract | ||
|
||
This specification describes a voting method to feature different active Status Communities. | ||
|
||
## Overview | ||
|
||
When there is a active community that is seeking new members, current users of community should be able to feature their community so that it will be accessible to larger audience. | ||
When there is a active community that is seeking new members, | ||
current users of community should be able to feature their community so | ||
that it will be accessible to larger audience. | ||
Status community curation DApp should provide such a tool. | ||
|
||
Rules of featuring: | ||
- Given community can't be featured twice in a row. | ||
- Only one vote per user per community (single user can vote on multiple communities) | ||
- Voting will be done off-chain | ||
- If community hasn't been featured votes for given community are still valid for the next 4 weeks | ||
- If community hasn't been featured | ||
votes for given community are still valid for the next 4 weeks | ||
|
||
Since voting for featuring is similar to polling solutions proposed in this spec could be also used for different applications. | ||
Since voting for featuring is similar to polling solutions proposed | ||
in this spec could be also used for different applications. | ||
|
||
### Voting | ||
|
||
Voting for featuring will be done through waku v2. | ||
Voting for featuring will be done through waku v2. | ||
|
||
Payload of waku message will be : | ||
|
||
```ts | ||
type FeatureVote = { | ||
voter: string // address of a voter | ||
|
@@ -44,12 +50,16 @@ timestamp is necessary so that votes can't be reused after 4 week period | |
### Counting Votes | ||
Votes will be counted by the DApp itself. | ||
DApp will aggregate all the votes in the last 4 weeks and calculate which communities should be displayed in the Featured tab of DApp. | ||
DApp will aggregate all the votes in the last 4 weeks and | ||
calculate which communities should be displayed in the Featured tab of DApp. | ||
Rules of counting: | ||
- When multiple votes from the same address on the same community are encountered only the vote with highest timestamp is considered valid. | ||
- If a community has been featured in a previous week it can't be featured in current week. | ||
- In a current week top 5 (or 10) communities with highest amount of SNT votes up to previous Sunday 23:59:59 UTC are considered featured. | ||
- When multiple votes from the same address on the same community are encountered | ||
only the vote with highest timestamp is considered valid. | ||
- If a community has been featured in a previous week | ||
it can't be featured in current week. | ||
- In a current week top 5 (or 10) communities with highest amount of SNT votes | ||
up to previous Sunday 23:59:59 UTC are considered featured. | ||
## Copyright | ||
|
Oops, something went wrong.