RFC: Contacts API#17
Open
filvecchiato wants to merge 3 commits into
Open
Conversation
- Rewrite motivation: frame around privacy model (alias-per-context), contact list as private mapping notebook, social circle analogy - Replace generic bullet points with concrete value propositions - Note that hosts already have internal contact schemas - Clarify ContactContext/Ring VRF type relationship and DerivationIndex need - Fix tier 1 safety explanation - Add context: Option<DotNsIdentifier> parameter to host_contacts_get - Flesh out alternatives with clear rationale - Add unresolved question about contact ingestion - Expand pagination concern
- Clarify that new DevicePermission variants are defined in this RFC, not as an amendment to RFC-0002 (@Imod7) - Document when each ContactsErr variant is returned - Explain what tier 1 reveals vs what a product already knows: the product knows its own user's alias but not other users' aliases in the same context (@BigTava) - Flesh out alternatives with concrete examples and threat model so trade-offs are easier to evaluate (@BigTava)
4 tasks
pgherveou
added a commit
that referenced
this pull request
May 17, 2026
Products running in a WebView/WKWebView now connect to the Rust core through the localhost WebSocket bridge instead of a base64-over- JavascriptInterface (Android) / base64-over-WKScriptMessageHandler (iOS) shim. The Rust ws_bridge already existed; this commit adds the matching JS client and strips the obsolete native transport. @parity/truapi: - New `createWebSocketProvider(url, opts?)` producing a `Provider` over a binary WebSocket. Connects to the localhost endpoint the native shell prints via `startWsBridge`. android/TrUAPIHost.kt: - Drop `WebViewTransport`, `CoreInbound`, `bootstrapScript`, and all base64/JavascriptInterface plumbing. - `TrUAPIHostCore` keeps its `receiveFromProduct` entrypoint for tests and alternative transports; the WS bridge feeds the core internally. ios/TrUAPIHost.swift: - Drop `WebViewTransport` (`WKScriptMessageHandler` + base64 path) and `CoreInbound` protocol. Drop the `WebKit` import. - Keep `LocalhostBridgeBootstrap` — its purpose is exactly to publish the WS endpoint to the product page so it can call `createWebSocketProvider(url)`. READMEs for both native shells now describe the WS-bridge flow: 1. Host calls `core.startWsBridge()` → gets port + token. 2. Inject the endpoint into the product page (Android: query string; iOS: `LocalhostBridgeBootstrap.script()` as a WKUserScript). 3. Product JS reads the URL and passes it to `createWebSocketProvider`. @parity/truapi build + tests pass with the new export.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC: Contacts API
Summary
Exposes the user's host-managed address book to products via Host API. Each contact pairs local metadata with a context-scoped map keyed by
ProductAccountId, enabling products to resolve human-readable identities to accounts.Checklist
docs/rfcs/0014-contacts-api.mdwith completed frontmatterdocs/rfcs/_index.mdwith a link to the new RFCrfc,proposalMotivation
Products need to resolve human-readable identities to accounts. Without this API, users must paste raw keys or scan QR codes for every interaction. Renumbered from 0011 to 0014. Migrated from paritytech/triangle-js-sdks#137.