Warning
This repository is heavy WIP and may contain incomplete, insecure and unaudited protocols. Do not use this in production!
This is a monorepo containing:
ark-babyjubjub: An implementation of the BabyJubJub elliptic curve using the arkworks ecosystem. It is compatible with EIP-2494, in contrast toark-ed-on-bn254.ark-serde-compat: A compatibility layer betweenark-serializeandserde.circom: A collection of Circom circuits and test vectors for them.contracts: An implementation of the required smart contracts.docs: A typst document serving as a writeup of the overall scheme.eddsa-babyjubjub: An implementation of EdDSA on the BabyJubJub curve.noir: A collection of Noir circuits.oprf-client: A crate implementing a client for the REST API service.oprf-core: A crate implementing a verifiable OPRF based on the TwoHashDH OPRF construction + a threshold variant of it.oprf-dev-client: A crate implementing a dev client binary.oprf-service: A crate implementing a REST API service that answers OPRF requests.oprf-test: A crate implementing integration tests and required mocks.oprf-types: A crate implementing types that are shared between client and service.poseidon2: A crate implementing the Poseidon2 hash function for various parameter sets, compatible with the Circom and Noir implementations thereof.
We use LocalStack docker container to emulate AWS services locally during development and testing.
To manage AWS credentials and configurations, you can use the AWS_PROFILE environment variable (assuming you have a profile for LocalStack).
export AWS_PROFILE=localstackTo start/stop the docker containers run:
just dev-upand
just dev-downTo install the dependencies for the smart contracts run the following command:
cd contracts && forge installFor development, the best way to run/test the setup is with the integration tests.
just integration-testsTo use the dev client, you can start the setup using the following command:
just run-setupThis command does multiple things in order:
- run the key-gen binary to fill the AWS secretsmanager and generate a
pubkey-list.hexfile incontracts/script/script-data. - start
anvil - deploy the
AccountRegistryandRpRegistrysmart contracts - start the auth-tree-indexer binary.
- start 3 OPRF services/nodes
Log files for all processes can be found in the created logs directory.
You can then use the dev client to send nullifier requests using the following command:
just run-dev-clientNote
Currently, you can only run the dev client once per setup, subsequent runs will fail because the created authenticator for the account already exists in the AccountRegistry contract.