Skip to content

Commit

Permalink
brainstorming
Browse files Browse the repository at this point in the history
  • Loading branch information
SkymanOne committed Jul 29, 2022
1 parent 4cf729d commit 6931854
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 108 deletions.
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ members = [
]
[profile.release]
panic = "unwind"

[profile.fast]
inherits = "release"
opt-level = 0
lto = "off"
incremental = true
codegen-units = 256
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,25 @@ Polkadot Blockchain Academy 2022 Cohort Final Exam Project.
- [ ] Anonymous quadratic system (commit-reveal)
- [ ] Staking
- [ ] Slashing

## Resources

[Commit - reveal](https://karl.tech/learning-solidity-part-2-voting/)

Potential idea for anonymous voting

1. Author creates a proposal and generates a keypair for this proposal
2. The public key of the proposer is distributed to voters
3. Voters encrypt their vote using the public key and sign transaction with their private key
4. Once timeout and enough votes are collected, the proposer is ready to reveal the results
5. The proposer uses their private key to decrypt votes and calculate the outcome of vote

If the proposer reveals results before the timeout -> slashing
If the proposer tries to inside-trade the intermediate vote results -> no solution, might be worth using nominating random voters
to generate keypairs and use multi-sigs to collectively reveal the results

Potential idea for anonymous voting 2
1. Author publishes a proposal
2. The voters commit their decision
3. Once timeout is out, the voters have some time to reveal their choices
4. If the voters does not reveal their results -> slashing
20 changes: 0 additions & 20 deletions pallets/template/src/benchmarking.rs

This file was deleted.

9 changes: 0 additions & 9 deletions pallets/template/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
/// <https://docs.substrate.io/v3/runtime/frame>
pub use pallet::*;

#[cfg(test)]
mod mock;

#[cfg(test)]
mod tests;

#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;

#[frame_support::pallet]
pub mod pallet {
use frame_support::pallet_prelude::*;
Expand Down
59 changes: 0 additions & 59 deletions pallets/template/src/mock.rs

This file was deleted.

20 changes: 0 additions & 20 deletions pallets/template/src/tests.rs

This file was deleted.

0 comments on commit 6931854

Please sign in to comment.