feat: reuse Pubky Ring identities - #643
Draft
Jasonvdb wants to merge 5 commits into
Draft
Conversation
10 tasks
9 tasks
ovitrif
force-pushed
the
codex/pubky-paykit-figma-alignment
branch
from
July 27, 2026 15:54
d769ad1 to
cc972d7
Compare
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.
Important
Dependencies and merge/release order
This branch is stacked on #636; the Android parent chain does not block this branch. At runtime, this PR and Ring #342 are counterparts: Ring-to-Bitkit requires Ring to ship first, while Ring's reverse “Use from Bitkit” flow becomes available after this consumer ships its Bitkit-owned shared record. This PR must remain draft until the Apple capability/profiles and signed two-app device tests are complete.
Part of #571
Description
This PR:
The shared protocol is versioned and uses a canonical 52-character bare Pubky plus a 64-character lowercase secret-key encoding. Shared records use
WhenUnlockedThisDeviceOnlyand are not synchronized through iCloud.Migration is deliberately non-destructive: the existing app-private Keychain item remains canonical indefinitely, and the shared item is a replaceable access mirror. Reconciliation writes and reads back the current mirror before pruning stale Bitkit-owned mirrors. Explicit destructive flows remove and verify the mirror before touching private state; a shared deletion failure stops the private deletion.
The Pubky Ring URL scheme is only an availability hint. The shared Keychain entitlement, strict payload validation, and derived-public-key match are the trust boundary. A source-authenticated liveness handshake remains a follow-up hardening item.
Apple configuration is not available yet, which is safe for implementation and review: missing entitlement errors defer mirroring instead of migrating or deleting the private source. Shipping requires creating the shared Keychain group in App Store Connect, attaching it to both App IDs, regenerating provisioning profiles, and completing signed physical-device interoperability tests.
Linked Issues/Tasks
Locked Content Payment Flow — Technical Product SpecScreenshot / Video
An independent six-screen audit accounts for every supplied reference. The new Profile choice screen matches its reference with 97% certainty. The audit found and corrected a pre-existing
FOUND CONTACTScopy/layout mismatch in Import Overview; its final native render is within 0–2 px of the measured reference. The other four screens remain unchanged parent implementations with matching static copy and structure. OS chrome and dynamic identity/avatar content are excluded.QA Notes
Manual Tests
regression:Borrowed Ring profile → approve Pubky Auth: approval retrieves and verifies the source key just in time.Automated Checks
SharedPubkyIdentityTests.swift: 22 tests cover wire validation, source ownership, credential matching, crash-safe adoption/cleanup, serialization, migration ordering, borrowed-secret persistence, and canonical pubkys beginning withpubky.PubkyProfileManagerTests.swift: 38 focused profile/session tests pass, including restore and destructive migration failure cases.git diff --checkpass.