Skip to content

iOS integration - #341

Open
pgherveou wants to merge 43 commits into
mainfrom
worktree-issue-96-mobile-followup
Open

iOS integration#341
pgherveou wants to merge 43 commits into
mainfrom
worktree-issue-96-mobile-followup

Conversation

@pgherveou

Copy link
Copy Markdown
Collaborator

Summary

  • expose and integrate the shared Rust SSO responder lifecycle for the iOS host
  • keep the iOS submodule synchronized with paritytech/polkadot-app-ios-v2#1290
  • enforce the RFC-0022 identity, ring-VRF, allowance, product-account, and ECDH derivations for every host
  • remove the platform-selected legacy iOS crypto profile and its obsolete compatibility vectors
  • document the simulator setup and the build/network pitfalls found during end-to-end validation

Validation

  • cargo test -p truapi-server -p truapi-host-cli -q (541 passed)
  • bun diagnosis and WebSocket tests (14 passed)
  • cargo fmt --all -- --check
  • cargo clippy -p truapi-server -p truapi-host-cli --all-targets --all-features -- -D warnings
  • direct and RFC CLI-to-CLI batteries: 46 supported passed, 19 known unwired
  • iOS 18.3 simulator build and HandshakeProposalTests
  • iOS RFC pairing battery: all 46 supported cases passed; one transient Preimage lookup submission was rerun successfully in isolation

Follow-up to #215. iOS counterpart: paritytech/polkadot-app-ios-v2#1290.

pgherveou and others added 30 commits July 17, 2026 19:07
Use codec-derived runtime payloads and metadata-aware storage projections so field ordering and variant encoding stay aligned with chain types. Derive SSO message labels once and keep normal transcript events at debug.
Native executors need dispatch futures that can move across Tokio worker
threads. Keep concise async signatures while teaching rustdoc codegen to
unwrap async-trait futures.
…ile-followup

# Conflicts:
#	.gitmodules
#	Cargo.lock
#	Makefile
#	deny.toml
#	ios/truapi-host/README.md
#	ios/truapi-host/Sources/TrUAPIHost/TrUAPIHost.swift
#	rust/crates/truapi-codegen/tests/golden/host-callbacks.ts
#	rust/crates/truapi-platform/src/lib.rs
#	rust/crates/truapi-server/README.md
#	rust/crates/truapi-server/src/host_logic/attestation.rs
#	rust/crates/truapi-server/src/host_logic/permissions.rs
#	rust/crates/truapi-server/src/host_logic/product_account.rs
#	rust/crates/truapi-server/src/host_logic/sso/messages.rs
#	rust/crates/truapi-server/src/host_logic/sso/messages/v1.rs
#	rust/crates/truapi-server/src/host_logic/sso/pairing.rs
#	rust/crates/truapi-server/src/host_logic/statement_store.rs
#	rust/crates/truapi-server/src/host_logic/statement_store/statement.rs
#	rust/crates/truapi-server/src/host_logic/transaction.rs
#	rust/crates/truapi-server/src/native.rs
#	rust/crates/truapi-server/src/runtime.rs
#	rust/crates/truapi-server/src/runtime/bulletin_rpc.rs
#	rust/crates/truapi-server/src/runtime/pairing_host/sso_channel.rs
#	rust/crates/truapi-server/src/runtime/signing_host.rs
#	rust/crates/truapi-server/src/runtime/signing_host/local_activation.rs
#	rust/crates/truapi-server/src/runtime/signing_host/ring_vrf.rs
#	rust/crates/truapi-server/src/runtime/signing_host/sso_responder.rs
#	rust/crates/truapi-server/src/runtime/statement_allowance.rs
#	rust/crates/truapi-server/src/runtime/statement_allowance/extension.rs
#	rust/crates/truapi-server/src/runtime/statement_allowance/extrinsic.rs
#	rust/crates/truapi-server/src/runtime/statement_allowance/proof.rs
#	rust/crates/truapi-server/src/runtime/statement_allowance/ring.rs
#	rust/crates/truapi-server/src/runtime/statement_allowance/rpc.rs
#	rust/crates/truapi-server/src/runtime/statement_allowance/slot.rs
#	rust/crates/truapi-server/src/runtime/statement_store.rs
#	rust/crates/truapi-server/src/runtime/statement_store_rpc.rs
#	rust/crates/truapi-server/src/test_support.rs
#	rust/crates/truapi/src/api/chain.rs
#	rust/crates/truapi/src/api/signing.rs
#	rust/crates/truapi/src/lib.rs
@pgherveou
pgherveou requested a review from a team August 4, 2026 21:36
@pgherveou pgherveou changed the title feat(sso): complete iOS integration on RFC-0022 iOS integration Aug 6, 2026
@pgherveou pgherveou closed this Aug 7, 2026
@pgherveou pgherveou reopened this Aug 7, 2026
@pgherveou
pgherveou marked this pull request as draft August 7, 2026 12:35
# Conflicts:
#	hosts/ios
#	ios/truapi-host/Package.swift
#	ios/truapi-host/Sources/TrUAPIHost/TrUAPIHost.swift
#	rust/crates/truapi-server/src/native.rs
…bile hosts

Restore the SSO pairing crypto to X25519 ECDH + ChaCha20-Poly1305 with
32-byte raw public keys, matching the deployed iOS and Android wallets
(the P-256/AES-GCM variant could not pair with either app: both decode
exactly 32 key bytes). The RFC-0022 scalar derivation is unchanged; only
the curve interpretation and AEAD move back.

Wire conformance additions the mobile wallets already implement:
- MetadataKey::Location (SCALE index 6) so proposals advertising a
  location remain decodable
- bootstrap_channel ("channel" suffix) used as the statement channel of
  pairing answers, so Success replaces Pending in the store
- the responder posts Pending(AllowanceAllocation) before Success and a
  best-effort Failed(reason) on error, mirroring the wallet answer flow

Also regenerates the Swift bindings (doc-comment-only diff) and fixes
the wasm vector test import broken by the truapi-platform re-export
change in #329.

Verified: full battery (both CLI roles, real paired handshake) and
make e2e-dotli (browser WASM pairing host answered by the CLI signing
host, 44 diagnosis successes, failures within the committed baseline).
…ile-followup

# Conflicts:
#	ios/truapi-host/Sources/TrUAPIHost/truapi_server.swift
#	ios/truapi-host/Sources/truapi_serverFFI/include/truapi_serverFFI.h
#	rust/crates/truapi-server/src/native.rs
#	rust/crates/truapi-server/src/runtime/signing_host.rs
@pgherveou
pgherveou marked this pull request as ready for review August 8, 2026 19:44
@pgherveou
pgherveou enabled auto-merge August 8, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants