Kotlin end-to-end
This guide uses the Verity Kotlin SDK, which wraps the JNI bridge, shared dispatcher, and ProveKit backend for Android.
Gradle declaration
Section titled “Gradle declaration”dependencies { implementation("xyz.atheon:verity:0.3.2")}Minimal flow
Section titled “Minimal flow”import xyz.atheon.verity.*
val verity = Verity(Backend.PROVEKIT)val prover = verity.loadProver("scheme.pkp")val verifier = verity.loadVerifier("scheme.pkv")
prover.use { p -> verifier.use { v -> val witness = Witness.of(mapOf("age" to "25", "threshold" to "18")) val proof = p.prove(witness) check(v.verify(proof)) { "proof did not verify" } }}Use loadProver(ByteArray) and loadVerifier(ByteArray) when artifacts live in Android assets, are downloaded, or are managed through encrypted storage. Witness.of(...) accepts a flat Map<String, String> of field-element strings, a TOML file, or a JSON string.
Integration notes
Section titled “Integration notes”- Call
Verity.configureMemory(...)before constructingVeritywhen large ProveKit circuits need Android RAM limits or file-backed memory. - The
use { ... }blocks above are not optional;ProverandVerifierhold native JNI handles. Letting them go out of scope withoutclose()leaks until GC runs (if ever). - The snippet assumes
scheme.pkpandscheme.pkvare readable from the app’s filesystem. If they’re packaged as assets, copy them to a readable path or load them as aByteArrayinstead.