Nod ID iOS SDK: integrate in an iOS app (about an hour)
Your app shows one sheet. The member's iPhone reads the passport chip and makes the proof. Your backend gets yes/no and a person code. You never receive an ID.
Want to see it work first? Test mode needs no backend, no iPhone and no passport: add the package, then try await NodID.verify(key: "nod_pk_test_...") in the Simulator (Apple silicon Mac). Results are marked mode: "test", assurance: "test" and never count as live. See the quickstart. Test mode is Debug-only: a Release build has no test engine and returns technicalError for a test key. The rest of this page is the live setup.
Needs: Xcode 16+, iOS 17+, a real iPhone for live verification (NFC does not work in the Simulator), and an app with a secret key from dashboard.nodid.app. A working test-mode example is at https://github.com/Nod-ID/nodid-ios-sample.
1. Add the package. Xcode, File > Add Package Dependencies, enter https://github.com/Nod-ID/nodid-ios, version rule "Exact" or "Up to next minor" from the release you were given, product NodIDKit, then import NodIDKit. The Rust proving core comes as a prebuilt binary (checked against a checksum in Package.swift).
2. Turn on the phone features.
- Signing & Capabilities: add Near Field Communication Tag Reading. Entitlement
com.apple.developer.nfc.readersession.formats=TAG. - Info.plist:
NFCReaderUsageDescription,NSCameraUsageDescription(your own words, say it stays on the phone), andcom.apple.developer.nfc.readersession.iso7816.select-identifiers=A0000002471001,A0000002472001,00000000000000.
3. Proving resources (circuits, keys, SRS, CSCA files). Release builds of the package download the proving files once, into the app's Application Support folder (not backed up). Every file is checked against a manifest whose SHA-256 is built into the SDK release, so the download host cannot change what runs. Files come from nodid.app/sdk/<version>/ and, if that is unreachable, from the GitHub release. Up to four files download at once, and a stopped download continues where it stopped. The whole set is about 138 MB (the SRS, keys and CSCA data are about 34 MB; the circuits the rest), fetched once for every member whatever their passport, because a download that depended on the passport would reveal where it came from. Nothing about the member is uploaded.
Call NodID.prefetch() at app launch so the files are ready before a member ever opens the flow:
// in application(_:didFinishLaunchingWithOptions:) or your App's init
NodID.prefetch() // waits for Wi-Fi (default)
// NodID.prefetch(allowCellular: true) // also over mobile data
It returns at once and downloads in the background: the whole set of circuits, keys and shared files, about 138 MB, the same for every member. (Earlier releases fetched only the circuits a scanned passport needed; that request pattern could hint at the passport's country, so the SDK now never requests anything that depends on the passport.) It does nothing when the files are already on the phone. If the app is closed first, the next launch continues. If a member opens the flow before it finishes, the flow completes the download over any network and shows "Getting ready for the first time" with a percentage that follows the bytes. Without prefetch(), the flow starts the download when it opens (Wi-Fi only until the proof needs it).
To ship the files inside your app instead (no download), add the resources folder from the release to your app target as a group, not a folder reference, so the files sit flat; or pass RealServices(resources: url).
3b. Turn on App Attest (SDK 0.2.0 and later). Every proof is signed with an Apple App Attest assertion that shows it came from your genuine app. In Xcode, Signing & Capabilities, add App Attest (entitlement com.apple.developer.devicecheck.appattest-environment; Xcode sets development for debug builds and production for App Store and TestFlight builds). Then, in the dashboard, open your app's Checks page and add your App ID under App Attest, written TEAMID.bundle.id (Team ID from your Apple Developer account, for example ABCDE12345.com.example.haven). Apps start in test mode, where App Attest may be skipped and development builds are accepted. When your released app has the capability, turn test mode off: from then on a verification without a valid App Attest check comes back as not_verified, and development-signed builds no longer verify. The SDK attests once per install (about 1.5 s, done beside the proving) and signs each proof in about 30 ms. It works only on a real iPhone. A reinstall or a restored device makes a new key by itself. SDK 0.1.x does not send App Attest; the verifier accepts it for a limited time that we announce, and records it in the evidence log as legacy.
4. Stop the OS saving screens. Two lines in your UIApplicationDelegate (SwiftUI: @UIApplicationDelegateAdaptor):
func application(_ a: UIApplication, shouldSaveSecureApplicationState c: NSCoder) -> Bool { NodID.disableStateRestoration() }
func application(_ a: UIApplication, shouldRestoreSecureApplicationState c: NSCoder) -> Bool { NodID.disableStateRestoration() }
The SDK covers the app-switcher snapshot and turns off keyboard learning on its own fields.
5. Your backend creates the session. The secret key never goes in the app.
POST https://api.nodid.app/v1/sessions Authorization: Bearer <your secret key>
-> {"sessionId":"...","nonce":"...","expiresAt":...} (single use, expires in minutes)
Send only sessionId to the app.
6. Show the sheet.
.sheet(isPresented: $show) {
NodIDVerifyView(sessionId: id) { outcome in // .verified / .notVerified / .cancelled / .technicalError
show = false
}.presentationDetents([.large])
}
The app learns only the outcome. Reasons (under age, country, expired, already used) are shown to the member and never to you.
7. Confirm on your backend before you trust it.
GET https://api.nodid.app/v1/sessions/<sessionId>/result Authorization: Bearer <your secret key>
-> {"outcome":"verified","assurance":"substantial","unique":true,"personCode":"...","method":"passport_nfc",
"versions":{"circuit":"...","vk":"...","dscTree":"...","sdk":"0.4.0"}} (202 while pending)
outcome:verified,not_verified,cancelledortechnical_error.assurance: how sure the method makes us.substantialfor a passport proof today;high(passport and face match) andbasic(an OS age signal or estimation) come with those methods. Only present when verified.unique:trueonly for passport methods.personCodeis present only whenuniqueistrue.method:passport_nfctoday.versions: the circuit, key, certificate-tree and SDK versions that made the result. Keep them with the result. Circuit names start withm2-(SDK 0.1.x and 0.2.x) orm3-(SDK 0.3.x and later, which add a hidden face-photo commitment the verifier does not return). Both are accepted; nothing in your integration changes.- In the dashboard you can set a minimum assurance and whether a unique person is required, per app. A result below your minimum comes back as
not_verified, with no reason.
personCode is stable for the same person in your app and cannot be matched across other apps. Use it for one-account-per-person.
Evidence log. The dashboard's Evidence tab shows one entry per verification (time, method, versions, assurance, outcome, App Attest result, a hash of the proofs), each chained to the one before. Export it as JSON or CSV and verify the chain there or yourself (the hash definition is in the tab). Entries hold no country, identity data, address or person code. Kept 13 months.
What you configure per app (name, accent colour, minimum age, expiry and country checks, country list, help link, digital ID on/off, other ways to prove): in the dashboard at dashboard.nodid.app. Sign in with your email (no password), create an app, set the checks, create a secret key (shown once), and use Run a test verification to get a test session id; paste it into the Sample app (or pass it to NodIDVerifyView) and the dashboard shows the outcome. Usage shows counts of the four outcomes only.
Limits today. Live verification needs a real iPhone (NFC does not work in the Simulator); test mode runs in the Simulator. Passports whose signing certificates are larger than 2,048 bytes, or from countries not yet in the coverage table (country coverage), show the member a clear "can't accept this passport yet" screen. "Verify with Wallet" is shown only when your app has it switched on, and does nothing until Apple approves us for it.
8. Treat the person code as a "likely same person" signal. The person code is stable for the same name (as printed in the passport's machine-readable zone), date of birth and nationality, and is different for every app of yours. It is not proof of identity, and two different people can, rarely, share one (same name, birth date and nationality). So:
- When a code you already hold comes back for a new account, do not ban and do not merge automatically. Show a soft message ("This person may already have an account") and offer contact support or link accounts. A person wrongly locked out is a worse outcome than a rare duplicate.
- The code changes when the name on the passport changes (marriage, legal change, different spelling or transliteration, a middle name added or dropped) or the nationality changes. A renewed passport with the same details gives the same code. Someone holding passports from two countries gets two codes.
- Re-verify and link (for a name change, or a second passport): let a signed-in member verify again from inside their account, and when the new code differs from the one you stored for them, store it as a second code for the same member instead of treating it as a new person. Do this only from an authenticated session, and still route a code that matches a different member to support.
- Store person codes like any other personal data (they identify a person within your app). They are never linkable to another customer's.
Handoff to the Nod ID app (optional, off until you register a return link)
When your app has a return link registered and allows the Nod ID app, and the Nod ID app is installed on the member's phone, the sheet hands the verification to it (an App Attest assertion over the session, then https://nodid.app/r#...). The Nod ID app proves and returns to your app with a single-use token. If it is not installed, or you have no return link, the usual flow runs. Nothing about the passport crosses to your app either way.
Your app only needs one line to receive the return, and only once you register a link (the dashboard setting is not live yet, so today this does nothing):
.onOpenURL { url in NodID.handle(url) } // true when it was the return for the verification on screen
A proof the Nod ID app makes from stored chip data is marked method: "passport_stored"; set freshRead on the session to require a chip read now.
Licence
Apache-2.0 (see LICENSE and NOTICE). Third-party components are listed in legal/THIRD_PARTY_LICENSES.md in the SDK repository. Pilot software: external audit pending; country coverage is partial.