Skip to content

[WAL-1347] feat(mdoc): implement NFC proximity transport - #2165

Draft
szijpeter wants to merge 13 commits into
feature/wal-1346-proximity-wallet-demosfrom
feature/wal-1347-nfc-proximity-transport
Draft

[WAL-1347] feat(mdoc): implement NFC proximity transport#2165
szijpeter wants to merge 13 commits into
feature/wal-1346-proximity-wallet-demosfrom
feature/wal-1347-nfc-proximity-transport

Conversation

@szijpeter

@szijpeter szijpeter commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements holder-side NFC engagement and device retrieval for WAL-1347, so the existing proximity session can use conventional ISO NFC handover/retrieval and an isolated provisional NFC Engagement v2 profile through the same wallet contract.

This PR is stacked on the complete WAL-1346 wallet integration and application-configurable reader-trust policy in walt-id/waltid-identity#2160. The implementation follows the architecture contract in walt-id/waltid-architecture#60. The stacked demo-host integration is in walt-id/waltid-identity#2166.

What Changed

Shared mdoc and transport protocol

  • Adds exact conventional NFC NDEF, Connection Handover, Type 4 Tag/TNEP, ISO 7816 APDU, retrieval, transcript, status, termination, limits, and lifecycle state under shared KMP ownership.
  • Adds a distinct provisional NFCv2 connection method, AID, CBOR handover, same-channel/hybrid transport, and session-message sequence profile without enabling the unresolved DIS 9.2.3 TNEP placeholder capability.
  • Keeps engagement selection, first-connection ownership, session handover, response processing, and cleanup in the common proximity engine.

Platform integration

  • Adds an Android HCE adapter and generation-bound APDU service registry with validated AIDs, foreground routing, field-loss handling, bounded asynchronous response ownership, and deterministic cleanup.
  • Adds a Swift-owned Core NFC CardSession bridge for native and Compose hosts. Public Core NFC support and eligibility remain runtime-gated. Presentment-intent assertion acquisition is best-effort and does not block an eligible CardSession; the assertion is released on every finish path.
  • Completes the new public NFC-remediation action across every existing Compose and Swift demo consumer, while leaving actual NFC host registration and callback wiring to the stacked child PR.

Wallet SDK

  • Exposes precise conventional and provisional-NFCv2 retrieval configurations through sealed Kotlin variants and Swift-native value types, avoiding illegal combinations such as QR plus NFCv2 retrieval.
  • Extends capability preparation, session lifecycle, Kotlin ABI, Swift facade, DocC parameter coverage, and regression coverage without leaking platform or implementation-detail types.

Architecture Notes

  • The implementation is walt-owned. No external wallet-stack artifact or source enters the runtime, dependency graph, public ABI, or platform facade.
  • Shared code owns protocol bytes, APDU/handover state, races, sequence semantics, and errors. Android and Apple adapters own only OS service/session callbacks and byte delivery.
  • The literal handoverSessionEstablishment capability remains unadvertised until the unresolved DIS placeholder can be reconciled with authoritative material.
  • The provisional NFCv2 profile emits direction-local, monotonic seq values. Structurally valid inbound values are non-enforcing in this provisional profile; malformed values and any seq on conventional sessions fail closed.

Caveats and Follow-Ups

  • Conventional Android Negotiated Handover through NFC to a reader-selected BLE bearer completed end to end against an external identity reader on a frozen earlier ancestry. A later QR-to-NFC hybrid canary also passed on frozen [WAL-1348] feat(mdoc): implement Wi-Fi Aware retrieval #2168 head ae4efeb2dfaf60fa7daaab80db4415c4a63c57b0; neither result is cross-credited to the rewritten head, so exact-head physical qualification remains open.
  • The official ISO/IEC TS 18013-6:2025 Appendix 2 holder catalogue now provides conventional NFC technology cases mDL_Tech_DE_NFC_01 through _17 and mDL_Tech_DR_NFC_01 through _07. They are mapped into the qualification plan in architecture PR #61; the normative TS main text is still required before any conformance claim.
  • NFCv2 remains provisional because the published appendices do not define the NFCv2 AID, Action Point 112.05 behavior, or handoverSessionEstablishment. Bounded Android direct and NFCv2-to-BLE hybrid interoperability, early field-loss handling, fresh-session recovery, and a 42,507-byte single-APDU response remain exact-build evidence rather than standards qualification.
  • Apple has approved HCE access for the Compose and native wallet host bundle identifiers and the requested AID prefixes. Child PR [WAL-1347] feat(wallet): integrate NFC proximity in demos #2166 contains the matching host entitlements, and a native SwiftUI development build carrying that capability completed the bounded physical conventional NFC-to-BLE exchange recorded in architecture PR #61. Compose iOS HCE, direct NFC retrieval, provisional NFCv2 variants, refreshed distribution signing, release-build entitlement inspection, and the broader Appendix 2 matrix remain open.

Breaking

  • The unreleased mobile SDK proximity retrieval configuration is tightened into conventional and provisional-NFCv2 variants. No compatibility shim or migration is provided because the mobile SDK is not published.

@szijpeter szijpeter added the ci:mobile Run mobile related CI workflows for this PR label Aug 30, 2026
@linear-code

linear-code Bot commented Aug 30, 2026

Copy link
Copy Markdown

WAL-1347

WAL-1346

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 1359934e-afcf-418b-88d0-6e06651ce03e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from a578bc7 to 340cce3 Compare August 30, 2026 22:09
@szijpeter
szijpeter changed the base branch from feature/wal-1346-proximity-wallet-demos to feature/wal-1346-reader-trust-policy August 30, 2026 22:09
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch 2 times, most recently from e4995e1 to 34f5587 Compare August 30, 2026 23:30
@szijpeter
szijpeter force-pushed the feature/wal-1346-reader-trust-policy branch from 1a98938 to d1d35e5 Compare August 31, 2026 10:14
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch 2 times, most recently from 97224bb to a8a7634 Compare September 1, 2026 10:45
@szijpeter
szijpeter changed the base branch from feature/wal-1346-reader-trust-policy to feature/wal-1346-proximity-wallet-demos September 1, 2026 10:53
@szijpeter szijpeter added ci:mobile Run mobile related CI workflows for this PR and removed ci:mobile Run mobile related CI workflows for this PR labels Sep 1, 2026
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch 4 times, most recently from de2a097 to bd58ed4 Compare September 1, 2026 13:06
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 4752ed4 to 786edf1 Compare September 1, 2026 14:55
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch 2 times, most recently from 86e45b2 to 7ea51f7 Compare September 1, 2026 15:57
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 8858e02 to 60b3c88 Compare September 2, 2026 08:54
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from 7ea51f7 to f837c81 Compare September 2, 2026 08:54
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 60b3c88 to 8bd5718 Compare September 2, 2026 09:43
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from f837c81 to 1cb6204 Compare September 2, 2026 09:43
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 8bd5718 to f828be5 Compare September 2, 2026 10:04
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch 2 times, most recently from 9acafd4 to 370b687 Compare September 2, 2026 10:28
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from 370b687 to aa15be8 Compare September 2, 2026 12:00
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 279e391 to 02d41ca Compare September 2, 2026 14:59
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from d3a3ba1 to d43e58a Compare September 2, 2026 14:59
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 02d41ca to 1442b3d Compare September 2, 2026 19:37
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from d43e58a to 5639e50 Compare September 2, 2026 19:37
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 1442b3d to 5b2e130 Compare September 3, 2026 14:12
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from 5639e50 to 384ff4b Compare September 3, 2026 14:12
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 5b2e130 to de6101a Compare September 4, 2026 12:04
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from 4b1b1e6 to c95de2e Compare September 4, 2026 12:04
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from de6101a to e3ec547 Compare September 4, 2026 12:51
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from c95de2e to da3e671 Compare September 4, 2026 12:51
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from e3ec547 to 7731703 Compare September 4, 2026 13:11
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from da3e671 to c617c96 Compare September 4, 2026 13:12
@szijpeter
szijpeter force-pushed the feature/wal-1346-proximity-wallet-demos branch from 7731703 to 6407f3e Compare September 4, 2026 14:38
@szijpeter
szijpeter force-pushed the feature/wal-1347-nfc-proximity-transport branch from c617c96 to d8375dc Compare September 4, 2026 14:38
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:mobile Run mobile related CI workflows for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant