-
Notifications
You must be signed in to change notification settings - Fork 36
Voting documentation #986
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
Merged
Merged
Voting documentation #986
Changes from 23 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
488b69b
Voting documentation
dg-concordium 6a12d15
Fix lint issues
dg-concordium 30c83f4
Add cryptoX to variables
dg-concordium 82bda21
Add glossary terms, diagram images
dg-concordium 784d03b
Replace diagrams and adjust wording of steps
dg-concordium c09e7c9
Fix lint error
dg-concordium 9b62e44
Start adding screenshots
dg-concordium 0235598
Updating terminology, editing
dg-concordium 3e7205e
Adding screenshots for guardian and adjusting text
dg-concordium 428ba1c
Merge branch 'main' into voting-doc
dg-concordium 25b7a41
Fix lint errors
dg-concordium aec5077
Merge branch 'voting-doc' of https://github.com/Concordium/concordium…
dg-concordium 147e666
More guardian screenshots
dg-concordium f80b973
Fix image file name
dg-concordium ed9dcad
Fix reference
dg-concordium 9b26bf4
Merge branch 'main' into voting-doc
dg-concordium 1a0f268
Update source/mainnet/net/voting/gc-voting.rst
dg-concordium 2e40067
Update source/mainnet/net/voting/gc-voting.rst
dg-concordium a34c16c
Update source/mainnet/net/voting/guardians.rst
dg-concordium 5cfebea
Address review comments
dg-concordium d698900
Update source/mainnet/net/voting/gc-voting.rst
dg-concordium c16ada0
Linking glossary terms
dg-concordium f247fbb
Merge branch 'voting-doc' of https://github.com/Concordium/concordium…
dg-concordium aa8df8d
Update source/mainnet/net/voting/coordinator.rst
dg-concordium edd281b
Update source/mainnet/net/voting/guardians.rst
dg-concordium 7ef12f6
Merge branch 'main' into voting-doc
dg-concordium 662a79b
Merge branch 'main' into voting-doc
dg-concordium 1414a23
Address review comments, add screenshots
dg-concordium a64aa64
Update source/mainnet/net/voting/voting.rst
dg-concordium 7b80f57
Update source/mainnet/net/voting/voting.rst
dg-concordium ed37b9a
Update source/mainnet/net/voting/voting.rst
dg-concordium 0ecf788
Update source/mainnet/net/voting/coordinator.rst
dg-concordium File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+59.1 KB
source/mainnet/net/images/voting/guardian-generate-decryption-proof.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+80.3 KB
source/mainnet/net/images/voting/guardian-generate-decryption-share.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+79.8 KB
source/mainnet/net/images/voting/guardian-generate-encrypted-shares.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.8 KB
source/mainnet/net/images/voting/guardian-generate-secret-key-share.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+96.5 KB
source/mainnet/net/images/voting/guardian-register-decryption-proof.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+94.2 KB
source/mainnet/net/images/voting/guardian-register-decryption-share.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,123 @@ | ||
.. _coordinator: | ||
.. include:: ../../variables.rst | ||
|
||
========================= | ||
Election coordinator tool | ||
========================= | ||
|
||
The coordinator tool is an administrative tool to coordinate the parts of the election that are not done by voters or guardians. | ||
|
||
The coordinator of the election is not trusted per se. All the actions it can do can be verified by any other party. The coordinator tool can be mostly run without access to any secrets to verify results of the election. However some commands take "admin keys" where the result of operations can be posted in the contract for everybody to see. If such a result is present in the contract and another user runs the coordinator tool, the tool will check that the result it computed and the one posted in the contract agree. | ||
|
||
Build and run | ||
============= | ||
|
||
To build the tool make sure you have the repository submodules initialized: | ||
|
||
.. code-block:: console | ||
|
||
git submodule update --init --recursive | ||
|
||
Build the tool by running: | ||
|
||
.. code-block:: console | ||
|
||
cargo build --release | ||
|
||
This will produce a single binary election-coordinator in target/release directory. | ||
|
||
Commands | ||
======== | ||
|
||
The tool has the following subcommands. All commands have a ``--help`` option which explains the input and output parameters. | ||
|
||
Get the list of initial weights | ||
------------------------------- | ||
|
||
Use the ``initial-weights`` command to gather the average amount of CCD on an account in the given period. The intention is that this command is used to produce the initial weights of each account prior to the election starting. The output of this command is a CSV file used in the ``final-weights`` command after the election. | ||
|
||
Example | ||
|
||
.. code-block:: console | ||
|
||
election-coordinator --node http://localhost:20001 initial-weights --start 2024-01-01T00:00:00Z --end 2024-01-03T00:00:00Z --out initial-weights.csv | ||
|
||
The weights are stored in the initial-weights.csv file. | ||
|
||
Create a new election instance | ||
------------------------------ | ||
|
||
Use the ``new-election`` command to create the necessary files and the contract for a new election. In particular it will: | ||
|
||
- create an election manifest based on the inputs | ||
|
||
- create election parameters based on the inputs | ||
|
||
- create a new smart contract instance. | ||
|
||
.. code-block:: console | ||
|
||
election-coordinator new-election --module ../contracts/concordium-governance-committee-election/concordium-out/module.wasm.v1 --threshold 1 --admin ../test-scripts/keys/2yJxX711aDXtit7zMu7PHqUMbtwQ8zm7emaikg24uyZtvLTysj.export --election-start '2024-02-01T00:00:00Z' --election-end '2024-02-07T00:00:00Z' --delegation-string 'This is how you delegate' --manifest-out election-manifest.json --parameters-out election-parameters.json --voters-file initial-weights.csv --guardian 31bTNa42u1zZWag2bknEy7VraeJUozXsJMN1DFjQp7E5YR6a3G --guardian 4PF6BH8bKvM48b8KNYdvGW6Sv3B2nqVRiMnWTj9cvaNHJQeX3D --candidate 'http://localhost:7000/candidate1.json' --candidate 'http://localhost:7000/candidate2.json' --node 'https://grpc.testnet.concordium.com:20000' --base-url https://gcvoting.testnet.concordium.com` | ||
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The options are: | ||
|
||
``--admin`` is the path to the keys that will be used to create the contract, and serve as the admin | ||
|
||
``--module`` is the path to the compiled election smart contract in wasm.v1 format | ||
|
||
``--threshold`` is the threshold for the number of guardians needed for decryption of the result of the election | ||
|
||
``--election-start`` and ``--election-end`` date and time for election start and end | ||
|
||
``--delegation-string`` is the string that will be used to determine vote delegations. This is the string users delegating a vote in a wallet must enter in a transaction memo. | ||
|
||
``--voters-file`` is the initial-weights.csv file for the election | ||
|
||
``--guardian`` (repeated) is guardian account addresses. At least one is needed. | ||
|
||
``--candidate`` (repeated) is a URL to a candidate. The order here matters, since that will be the order of selections in the election. The link is to the candidate metadata. The hash of the metadata will be embedded in the contract. | ||
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``--base-url`` the URL where the election server is accessible, e.g., https://gcvoting.testnet.concordium.com | ||
|
||
The tool generates three things: | ||
|
||
- An election manifest which is output to the location specified by ``--manifest-out`` | ||
|
||
- Election parameters which are output to the location specified by ``--parameters-out`` | ||
dg-concordium marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- A new smart contract instance which is printed to stderr, for example, ``Deployed new contract instance with address <7838,0> using transaction hash 3b3e61a01fd3ecefddecbe6760c6ba3d951f4d0a8947d63990ffe9219249de27``. | ||
|
||
Get the final weights | ||
--------------------- | ||
|
||
Use the ``final-weights`` command to compute the final weights taking into account the delegation. It takes initial weights in the initial-weights.csv into account and any delegations during the election period, outputting the result to final-weights.csv. The output of this command is used in the tally command. | ||
|
||
Example | ||
|
||
.. code-block:: console | ||
|
||
election-coordinator --node http://localhost:20001 final-weights --contract '<7795,0>' --initial-weights initial-weights.csv --final-weights final-weights.csv | ||
|
||
Tally the votes and register the encrypted tally in the contract | ||
---------------------------------------------------------------- | ||
|
||
The ``tally`` command uses the final-weights.csv generated above to compute the encrypted tally of the election and optionally post it in the smart contract. This sums up all the votes during the election period and scales them according to the specified weights. | ||
|
||
.. code-block:: console | ||
|
||
election-coordinator --node http://localhost:20001 tally --contract '<7795,0>' --final-weights final-weights.csv --admin-keys ../test-scripts/keys/2yJxX711aDXtit7zMu7PHqUMbtwQ8zm7emaikg24uyZtvLTysj.export | ||
|
||
The same command without the ``--admin-keys`` option will tally the votes and check that the tally matches what is registered in the contract. | ||
|
||
Decrypt the final result | ||
------------------------ | ||
|
||
Use the ``final-result`` command after the guardians have each decrypted their share of the encrypted tally. This command can be used to combine the shares and post the result in the contract, or if the result is already posted, to check that it matches what you compute. | ||
|
||
.. code-block:: console | ||
|
||
election-coordinator --node http://localhost:20001 final-result --contract '<7795,0>' --admin-keys ../test-scripts/keys/2yJxX711aDXtit7zMu7PHqUMbtwQ8zm7emaikg24uyZtvLTysj.export``` | ||
|
||
This will look up all the decryption shares provided by the guardians, check that they are valid, and if there are enough of the valid ones, it will decrypt the final result and publish it in the smart contract. | ||
|
||
If the ``admin-keys`` are not provided the command will do everything else as with the keys, except it will check if the result in the contract matches or not, and report the result. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.