Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Install WalletKit

WalletKit is published for Rust, iOS, Android, and the browser. Choose the section for your platform.

Rust

WalletKit is published on crates.io as walletkit. To add it to a Rust project with the proving keys embedded, run the following command:

cargo add walletkit --features embed-zkeys

The walletkit crate has these Cargo features:

FeatureDefaultEffect
issuersYesClients for credential issuers, such as TfhNfcIssuer and RecoveryBindingManager.
embed-zkeysNoEmbeds the proving keys in the binary. EmbeddedZkArtifacts and CachingZkArtifacts need it, so enable it to generate proofs.
compress-zkeysNoCompresses the embedded keys, which roughly halves the bundle size but makes decompression expensive. CachingZkArtifacts caches the result on disk.
v3NoThe legacy World ID 3.0 API, in the v3 module.
semaphoreNoSemaphore proofs for the legacy API. v3 enables it.

The Swift and Kotlin packages are built with embed-zkeys, compress-zkeys, and v3.

iOS

WalletKit’s Swift package is published from a separate repository, worldcoin/walletkit-swift, which holds the prebuilt binaries. It supports iOS 13 and later. To add it to an Xcode project, do the following:

  1. In Xcode, click File > Add Package Dependencies.
  2. Enter https://github.com/worldcoin/walletkit-swift, choose a version, and click Add Package.
  3. Add the WalletKit product to your app’s target.

Android

WalletKit’s Kotlin bindings are published to GitHub Packages and support Android API level 23 and later. To add them to an Android app, do the following:

  1. Add the GitHub Packages repository to your Gradle repositories. GitHub Packages requires credentials with the read:packages scope, even for public packages. This example reads them from the gpr.user and gpr.key Gradle properties; set those in your user-level ~/.gradle/gradle.properties or in CI, and never commit them:

    repositories {
        maven {
            url = uri("https://maven.pkg.github.com/worldcoin/walletkit")
            credentials {
                username = providers.gradleProperty("gpr.user").get()
                password = providers.gradleProperty("gpr.key").get()
            }
        }
    }
    
  2. In the app module’s build.gradle.kts, add the dependency, replacing VERSION with a WalletKit version:

    dependencies {
        implementation("org.world:walletkit:VERSION")
    }
    
  3. Sync Gradle.

Browser

WalletKit is published on npm as @worldcoin/walletkit-web. To add it to a web app, run the following command:

npm install @worldcoin/walletkit-web

For requirements and a walkthrough, see Use WalletKit in the browser.