Skip to main content

Crate walletkit_core

Crate walletkit_core 

Source
Expand description

walletkit-core contains the basic primitives for using a World ID. It enables basic usage of a World ID to generate ZKPs using different credentials.

§Examples

use walletkit_core::{proof::ProofContext, CredentialType, Environment, world_id::WorldId};
async fn example() {
    let world_id = WorldId::new(b"not_a_real_secret", &Environment::Staging);
    let context = ProofContext::new("app_ce4cb73cb75fc3b73b71ffb4de178410", Some("my_action".to_string()), None, CredentialType::Orb);
    let proof = world_id.generate_proof(&context).await.unwrap();
    println!("{}", proof.to_json().unwrap()); // the JSON output can be passed to the Developer Portal, World ID contracts, etc. for verification
}

Modules§

defaults
Default configuration values for each Environment.
error
Contains error outputs from WalletKit
issuers
Credential issuers for World ID (NFC, etc.) Credential issuers for World ID.
logger
Contains logging functionality that can be integrated with foreign language bindings.
proof
This module handles World ID proof generation
requests
Proof requests and responses in World ID v4.
storage
Credential storage primitives for World ID v4. Credential storage primitives: key envelope and key hierarchy helpers.
world_id
Contains all components to interact and use a World ID

Structs§

Authenticator
The Authenticator is the main component with which users interact with the World ID Protocol.
Credential
A wrapper around CoreCredential to enable FFI interoperability.
FieldElement
A wrapper around FieldElement to enable FFI interoperability.
InitializingAuthenticator
Represents an Authenticator in the process of being initialized.
U256Wrapper
A wrapper around U256 to represent a field element in the protocol. Wrapper enables FFI interoperability.

Enums§

CredentialType
A CredentialType represents a specific credential which can be presented by a World ID holder.
Environment
Represents the environment in which a World ID is being presented and used.
Region
Region for node selection.
RegistrationStatus
Registration status for a World ID being created through the gateway.