Zktls.configure once at launch, and Zktls.verify with the platforms you want and a reference of your choice. The SDK shows its own screens, opens each platform’s sign-in page, and has each result read and signed by a Cr3dentials attester. Your server gets the results by signed webhook. They never pass through your app.
The SDK is licensed under Apache-2.0. Installing it needs no account or token. Releases, the changelog and the full reference docs are at github.com/Cr3dentials/zktls-sdk-releases.
SDK 2.0.0 replaces version 1’s
runTree, and the Partner API’s "channel": "sdk" runs, with verify(). Your server no longer creates runs: POST /partner/browser-session now answers 400 with the code use_verify for "channel": "sdk".How verify() works
1
Your app calls verify()
It passes the platform ids, in the order the user should see them, and your
reference.2
The SDK checks the device and starts the verification
With a live key, the SDK proves to Cr3dentials that the call comes from your registered app on a genuine device: Apple App Attest on iOS, Google Play Integrity on Android. Cr3dentials then checks the platforms you asked for and starts one run per platform.
3
The user goes through the SDK's screens
An intro lists the platforms. Each platform then opens its own sign-in page, inside a page the SDK controls. Between platforms, a step shows which platform is done and which comes next, and a finish screen ends the flow. The user can stop at any step. You set the colours, the logo and every string. You build no UI.
4
An attester reads each platform
Once the user has signed in, the SDK hands the run to an attester: a Cr3dentials enclave that reads the platform’s figures itself, over TLS, and signs them. The attester posts the result to Cr3dentials, never to the phone, and Cr3dentials checks its signature before storing it. Once the last platform is handed off, the user may close your app: the attesters finish without the phone.
5
Your server gets the results
A signed
platform.finished webhook arrives for each platform the user started, as its result arrives, usually within seconds. One verification.finished webhook follows when every platform has ended. You can also fetch a verification with your Partner API key.6
verify() tells your app how each platform ended
verify() returns a VerifyOutcome once the user leaves the flow: for each platform, done, failed or not started. It carries no data from the platform.The outcome
In Swift,
status is .done, .failed or .notStarted. In Kotlin, it is PlatformStatus.DONE, PlatformStatus.FAILED or PlatformStatus.NOT_STARTED.
done means the result is on its way, not that it has arrived. Act on the webhook, not on the outcome: in rare cases a run that was handed off still fails, and its platform.finished webhook says so.
Each platform counts on its own. A user who stops after two of three platforms leaves two results and one platform not started. To finish later, call verify() again with only the platforms that were not started. It is a new verification with a new verificationId, and you can pass the same reference. No resume state is kept: the two are separate verifications, linked only by your reference.
The reference
Thereference is any string you choose, and it comes back unchanged in every webhook for the verification. Cr3dentials never reads meaning into it. Use it to match each result with your own user or order.
- Use a value your server already knows, such as an order id or one your server gave the app. Then a result still matches if your app is killed in the middle of the flow.
- Never put personal data in it: no name, email address or phone number.
- It is 1 to 128 characters of
A-Z,a-z,0-9,.,_and-. Anything else is refused withreference_invalid.
Test keys and live keys
Each registered app has two app keys. Both are publishable: they ship inside your app, and they are not secrets.
A live key works only from the app you registered with us, on a device that passes App Attest or Play Integrity, so a key copied out of your app is useless anywhere else. A test key runs only the demo platform, so it is useless for real data. Test verifications use the same attesters and the same webhooks as live ones.
zktls-demo is a demo bank that Cr3dentials hosts. It accepts any user name with the password demo, which its sign-in page shows. It delivers a realistic result through the same attester path, so a test webhook looks like a live one, and you need no real account anywhere to finish your integration.
A verification has 1 to 10 platforms, each listed once. Past an hourly limit, verify() is refused with limit_reached.
Platforms
verify() runs attested platforms only: platforms whose figures an attester reads and signs. It refuses any other platform with platform_unavailable, before any run starts.
We enable live platforms for each app, and more come as their attested packs are published. Ask us which platforms your app can use.
Starting from your server
Zktls.verify(token:) starts a verification your server prepared. Your server calls POST /partner/verification-tokens with its Partner API key, the platforms and the reference, and passes the token it gets to your app. The token is single use and lasts 15 minutes. Use it when your server, not the app, should decide what is verified. The flow and the outcome are the same.
Register your app
Until the Partner Portal does it for you, we register your app:1
Set up your team
Create your partner account and team in the Partner Portal, as in the Quickstart. Accept the terms of service there from the account you will email us from. Until it has, a team on its trial can’t start any verification, even with the test key:
verify() is refused with account_inactive.2
Add your webhook
Add your webhook URL under Webhooks in the Partner Portal. See Webhooks.
3
Email us
Write to info@cr3dentials.xyz from your team’s owner or admin account, with your app’s name, its iOS bundle ID and Team ID, its Android package name, and the platforms you want.
4
Get your keys
We send you your test key, your live key, and the signing secret of each of your team’s webhooks.
Next steps
iOS
From install to your first test webhook.
Android
From install to your first test webhook.
Webhooks
The two events, and how to check their signature.
Errors
Why a verification is refused, and what to do.
Example apps
The smallest iOS and Android apps that verify a user’s Upwork account, with a live key.
