> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pesapay.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# zkTLS SDK

> Prove a fact from a user's own account, such as a completed payment, without the account data leaving their phone.

<Note>
  The zkTLS SDK is in preview. Partner access, credentials and the test configuration are by request through [pesapay.xyz](https://pesapay.xyz).
</Note>

The SDK is one Rust core, shipped as a Swift package for iOS and a Kotlin library for Android. It runs the login, the capture, the proof and the claim check on the phone.

## Six verbs

The facade is `ZktlsClient`, with the same six verbs on both platforms:

| Verb | What it does |
| - | - |
| `login` | Shows a disclosure, then the provider's login page in a WebView. Keeps only the cookies of the profile's declared domains. |
| `capture` | Runs the split-TLS capture with the two enclaves. Returns an opaque handle. |
| `prove` | Proves the policy to the assigned verifier. Returns a report with `accepted` and a verdict. |
| `claim` | Returns the signed claim, already verified against the trust bundle. |
| `progress` | Reports the phase and percentage. |
| `cancel` | Ends the verb in flight. |

## Support

| | iOS | Android |
| - | - | - |
| Minimum OS | iOS 14.0 | Android 7.0 (API 24) |
| Install | Swift Package Manager or CocoaPods | Gradle, from Maven Central |
| Architectures | arm64 devices; arm64 and x86\_64 simulators | arm64-v8a, armeabi-v7a, x86, x86\_64 |

There is no Expo module, React Native bridge or Flutter plugin. On a cross-platform framework, bind the SDK through your framework's native-module mechanism: six functions and three opaque objects.

## What you need from us

* Your app credential.
* The profile and policy IDs for what you want to prove.
* The front door URL (`baseUrl`).
* The trust bundle URL and the operator key to pin.
* The policy bundle URL and the digest to pin.

## Two rules

1. **The witness never leaves the SDK.** `capture` returns an opaque handle and `prove` consumes it. No API gives you the bytes, and a handle proves once.
2. **The SDK never retries a failed capture.** If a capture fails before the reply is frozen, that session is over. Call `capture` again in a new session. Resuming would reuse a secret.

## Integration checklist

<Steps>
  <Step title="Decide">
    Your minimum OS, how you hash your user ID into `userIdHash` (never the raw ID), and how you make a new `idempotencyKey` for every session.
  </Step>

  <Step title="Integrate">
    One `ZktlsClient` per session, one session at a time, and a lifecycle object begun after `login` returns. Map every [error](/zktls-sdk/errors) to a message, with no automatic retry.
  </Step>

  <Step title="Verify on your backend">
    Send `claim.encoded` to your backend and verify it there. See [Backend verification](/zktls-sdk/backend-verification).
  </Step>

  <Step title="Test">
    A real iPhone at your minimum iOS, and a mid-range and a low-end Android phone. Decline the disclosure, close the login page, background the app, switch Wi-Fi to cellular, and cancel mid-proof. Each must end cleanly.
  </Step>

  <Step title="Submit to the stores">
    Add the SDK's privacy answers, your export-compliance answer, App Review notes with a demo account, and the SDK's open-source notices. Confirm you may access the account on the user's behalf under the provider's terms (Apple guideline 5.2.2).
  </Step>
</Steps>

<CardGroup cols={2}>
  <Card title="iOS" icon="apple" href="/zktls-sdk/ios">Swift Package Manager, CocoaPods, a full session.</Card>
  <Card title="Android" icon="android" href="/zktls-sdk/android">Maven Central, a full session, the foreground service.</Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.