Expand description
This crate contains the raw base types (without implementation) for the World ID Protocol.
It implements basic primitives such as field elements, proofs, the format of requests and responses, etc.
Importantly, this crate keeps dependencies to a minimum and does not implement any logic beyond serialization and deserialization.
Re-exports§
pub use credential::Credential;pub use credential::CredentialVersion;pub use proof::ZeroKnowledgeProof;pub use request::ConstraintExpr;pub use request::ConstraintKind;pub use request::ConstraintNode;pub use request::MAX_CONSTRAINT_NODES;pub use request::ProofRequest;pub use request::ProofResponse;pub use request::RequestItem;pub use request::RequestVersion;pub use request::ResponseItem;pub use request::ValidationError;
Modules§
- api_
types - Contains API request/response types and shared API enums. Shared API request/response payloads for gateway and indexer services.
- authenticator
- Contains types related to the Authenticator.
- circuit_
inputs - Contains the raw circuit input types for the World ID Protocol.
- credential
- Base definition of a “Credential” in the World ID Protocol.
- merkle
- Contains base types for operations with Merkle trees.
- oprf
- Contains types specifically related to the OPRF services.
- proof
- Contains the quintessential zero-knowledge proof type.
- request
- Contains request/response types and validation helpers for RP proof requests. Module containing all the functionality to handle requests from Relying Parties (RPs) to Authenticators.
- rp
- Contains types specifically related to relying parties.
- serde_
utils - Serialization utilities for numeric API values across the protocol.
- sponge
- SAFE-style sponge utilities and helpers.
Structs§
- Config
- Global configuration to interact with the different components of the Protocol.
- EdDSA
Private Key - A private key for the EdDSA signature scheme.
- EdDSA
Public Key - A public key for the EdDSA signature scheme over the BabyJubJubCurve.
- EdDSA
Signature - An EdDSA signature on the Baby Jubjub curve, using Poseidon2 as the internal hash function for the Fiat-Shamir transform.
- Field
Element - Represents a field element of the base field (
Fq) in the World ID Protocol. - Nullifier
- A nullifier is a unique, one-time identifier derived from (user, rpId, action) that lets RPs detect
duplicate actions without learning who the user is. Used with the contract’s
verify()function. - Session
Id - An identifier for a session (can be re-used).
- Session
Nullifier - A session nullifier for World ID Session proofs. It is analogous to a request nonce,
it does NOT guarantee uniqueness of a World ID as a
Nullifierdoes. - Signer
- The inner signer which can sign requests for both on-chain and off-chain operations. Both issuers and authenticators use this.
Enums§
- Primitive
Error - Generic errors that may occur with basic serialization and deserialization.
Constants§
- TREE_
DEPTH - The depth of the Merkle tree used in the World ID Protocol for the
WorldIDRegistrycontract.
Traits§
- Session
Field Element - Allows field element generation for Session Proofs
Type Aliases§
- Scalar
Field - The scalar field used in the World ID Protocol.