Skip to content

nvotes/juvenal-lib

Repository files navigation

juvenal-lib: The universal election verifier library

License Dependencies badge Build Coverage status Community chat

juvenal-lib is a library that implements an universal election verifier. It enables the verification of election ballots, tallies, and proofs generated by multiple voting solutions. It has been developed independently by the nVotes Online Voting team and is written in TypeScript. It also includes a command line verifier.

It currently only supports verifying ElectionGuard. Work for supporting Helios Voting is in the works. This library is used by Juvenal, which is an open-source and web-based universal verifier.

WARNING: This software is in development and is incomplete and most probably contains bugs. Please do not use in production.

Building

This is a TypeScript project and uses the standard TypeScript toolchain. Install dependencies with:

yarn

Then you can build the project into javascript to the build/ directory with:

yarn build

You can execute the unit tests with:

yarn test

You can generate package documentation with:

yarn doc

Running

You can run the verifier through the command line using node:

node build/src/bin/verifier.js $PATH_TO_ELECTION_RECORD.json

There are multiple election record examples in the directory test/data that you can use with the verifier. For example, the following command should verify correctly the valid_encrypted.json election record, which contains a valid election record:

node build/src/bin/verifier.js tests/data/valid_encrypted.json

Contribute

There are multiple ways to contribute:

Security dependencies update

You can run yarn audit to find security dependencies that need to be updated. You can also run yarn run yarn-audit-fix to try to update the dependencies to a secure version. Afterwards, you should try to do a yarn build and yarn test to ensure everything is still working.

Development

Note that we autogenerate both:

  • The file json_schemas.ts (in directory vendor/electionguard-schema-0.85) that contains the schemas as an object, so that they can be directly loaded as a javascript dependency and not opening json files.
  • The schema definitions in directory vendor/electionguard-schema-0.85/@types, so that the election record to be verified can be loaded from json in a typed manner.

When required, you can update the two generated json schemas derivatives mentioned above by running:

yarn generate_election_record_types

Dependencies

The verifier uses minimal runtime dependencies to be very self-contained:

There is a bunch of other development-only additional dependencies. These are not really relevant other than for development purposes: