Guillem Córdoba
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Dot voting [Dot voting](https://en.wikipedia.org/wiki/Dot-voting) consists on multiple agents being able to vote on a same issue with multiple options, but where each agent only gets a certain amount of votes. An agent can vote as many times as they want for the same option, but summed their votes can't exceed the number of votes they have. This is a less consensus, more "flexible" way of signaling importance of interest. It presents some of the same challenges as traditional voting, so I'm going to use it as an example. Technically, this is a reusable zome that does not need any membranes (maybe one to make sure that no two agents belong to the same person, like social triangulation, but unlikely because we are already filtering who can vote on the side of the proposer). It can be used in different contexts and DNAs. >To transform this into normal "majority" voting, we should: >1. Make each vote its own DNA. >2. Pass in as properties of the DNA the list of nodes that will play the role of "ballot boxes". >3. Make a membrane that allows only the people that are in the census list, > >And we also still need a mechanism to anonymize the votes, which I can't think of unless we *trust* the ballot boxes to never disclose our identity (maybe ZK-snarks could be used here) ## User stories * Any agent should be able to propose a vote, specifying a list of options, list of authorized users to vote, a max number of votes for each agent and a time limit. * An agent authorized to vote should be able to vote for the options they want, but those votes should never exceed the number specified by the proposer of the vote. * The proposer of the vote should be able ## Entry structure This first anchor type is from [holochain_anchors](https://github.com/holochain/holochain_anchors) ```rust Entry "anchor" { struct Anchor { anchor_type: String, anchor_text: Option<String> } } Entry "vote_proposal" { struct VoteProposal { proposer_address: Address, // These can either be titles for the options or // addresses of entries in the DHT for more complex data structures options: Vec<String | Address>, authorized_agents: Vec<Address>, max_dots: usize, // Just for info closing_time: Timestamp, // For actual validation purposes closed: bool } Links: { agent_id->vote_proposal, link_type: "proposed_vote" agent_id->vote_proposal, link_type: "voter" // The tag in this link is where the vote info will be stored vote_proposal->agent_id, link_type: "vote" } } ``` The tag inside the vote_proposal will be a serialized struct of this form: ```rust struct VoteTag { vote: { voter_address: Address, vote_address: Address, options_voted: { [index_of_option]: [number_of_votes_for_that_option] } }, proposer_signature: Signature, } ``` With this design we optimize for query efficiency on the "get_all_votes_for_this_proposal" function, but it will be a little slower for a "get_all_votes_that_this_agent_has_made" (you have to make more hops). ## Flow of voting To know when a vote is valid or when it is not, we are going to use the proposer's time, as they are the valid authority that everyone trusts when accepting to participate in the vote. To make sure that the proposer's time was not passed when a vote was cast, the proposer will need to sign the vote. This is how it would work: 1. A proposer creates a vote proposal. 2. A voter inputs their vote for that vote proposal, and sends it to the proposer. 3. The proposer checks if the vote proposal is still not closed. If it's closed, it rejects to sign the vote. 4. The proposer hashes the info, signs it and returns the signature to the voter. 5. The voter creates the vote with `add_link`. > This method has the downside that the proposer has to be online at all times for the votes to be signed, maybe there are other patterns which do not require it. ## Entry relationship diagram ```mermaid graph TD subgraph postszome subgraph anchors all_votes end subgraph agent_ids alice_id bob_id end subgraph vote_proposals vote0 alice_id-->|proposer|vote0 bob_id-->|voter|vote0 alice_id-->|voter|vote0 vote0-->|vote|alice_id vote0-->|vote|bob_id end all_votes-->vote0 end ``` ## Validation ### Entries * `anchors`: * Create valid if the agent_address that is creating it is signing the entry * Update or Delete is not valid * `vote_proposal`: * Create or Update is valid if the agent_address that is creating it is signing the entry * Delete not valid ### Links * `vote`: * AddLink: valid if: * The agent_addres in the anchor from which we are linking is signing the entry * The signature of the tag is from the proposer address of the vote proposal that is the base entry for the link, and it's signing the hash of the "vote" portion of the tag. * The indexes of the options inside the votes do not exceed the options vector length in the vote proposal that is the base entry for the link. * The vote address is equal to the base entry address * The sum of the votes is less or equal to the maximum allowed votes in the vote proposal * There is no other link from this vote to the same voter address * RemoveLink not valid Future optimization: remove vote_address and voter_address from the tag, requires that the signature is made with those properties inside the content that's hashed and then signed.

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully