The Infimum project is intended to provide a private, receipt-free, and verifiable voting apparatus which disincentivizes collusion between participants. Note that the current scope of this project is intended to serve as a proof of concept and should not be used in production.
- Poll: A proposal to enact some outcome.
- Participant: A signer who has registered in a poll, and whose interactions with that poll are deemed valid.
- Coordinator: A trusted party who may create and manage polls. Coordinators are responsible for verifiably proving the outcome of their polls.
- Interaction: A vote, or a nullifier, which is submitted by a participant for a specific poll which they have registered in.
- If you wish to run the tests with docker, you will need to have the latest version installed on your machine.
- To run the tests on your local machine, you will need to have cargo installed.
You can run the tests locally if you have cargo
installed.
cd /path/to/infimum
cargo test --manifest-path=./pallet/Cargo.toml
Alternatively, the unit tests can also be run with docker.
cd /path/to/infimum
docker compose --profile test up
The CLI for interacting with this pallet is currently under active development. Due to the complexity and highly sensitive nature of the types of the extrinsic parameters other interfaces, such as the frontend-template, are highly difficult to use in order to interact with the pallet.
However in general the interaction flow is:
- A user registers as a coordinator using the
register_as_coordinator
extrinsic. - A coordinator creates a poll using the
create_poll
extrinsic. - Participants register for the poll during the registration period using the
register_as_participant
extrinsic. - Participants interact with the poll during the interaction period using the
interact_with_poll
extrinsic. - After the poll ends, the coordinator is then permitted to:
- Merge the state trees using the
merge_poll_state
extrinsic. This calculates various public signals on chain which are later used to verify the zero-knowledge proofs. - Generate proofs for the poll results (offchain). The basic flow for compiling and generating proofs can be found in circuits.
- These proofs are then commited to the pallet storage using the
commit_outcome
extrinsic. - After every proof has been successfully submitted a
PollOutcome
event is deposited with theoutcome_index
field set.
- Merge the state trees using the
An end-to-end example of this flow can currently be found here. In order to run this example, you will first need to locally spin up a substrate node with the Infimum pallet. For your convenience, you can do so with:
cd /path/to/infimum
# Download and extract the test data
curl --output e2e.tar.gz https://cdn.rhys.tech/infimum/e2e.tar.gz
tar xf e2e.tar.gz -C cli/__tests__
rm e2e.tar.gz
# Start the node
docker compose --profile node up
Then open a new terminal, navigate to the cli
directory, and run the tests
cd /path/to/infimum/cli
# Install the dependencies
npm i
# Run the end-to-end test
npm run test
- This work is based off of the Ethereum project MACI, which itself was originally proposed by Vitalik Buterin.
- The zero-knowledge circuits have been forked from maci-circuits
- The poseidon hasher is a fork of light-poseidon for
no_std
compatibility - W3F Proposal