feat: reuse Pubky Ring identities#1109
Draft
Jasonvdb wants to merge 3 commits into
Draft
Conversation
This was referenced Jul 24, 2026
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 #1097, which depends on #1084; the iOS parent 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 provider. This PR must remain draft until final Play-signed Ring and Bitkit artifacts pass installed interoperability tests.
Description
This PR:
The versioned provider protocol carries only a canonical 52-character bare Pubky for discovery and a 64-character lowercase secret-key encoding on the explicitly selected credential route. Borrowed credentials are excluded from app-private key storage and backups.
Migration is deliberately non-destructive: an existing Bitkit private key remains the canonical source, and sharing is enabled only after deriving and verifying the same public key. Export state is a separate, fail-closed gate. Cleanup disables sharing first, while quarantine markers preserve ambiguous private state for recovery instead of silently reclassifying or deleting it.
The provider uses dynamic Bitkit authorities for build variants while keeping the production source identity canonical. Dev and testnet merged manifests resolve to their expected authorities and signature permissions.
Production release still requires confirming that the Bitkit CI keystore certificate is the Play-installed app-signing certificate rather than only an upload certificate. If Play uses a distinct app-signing key, Ring's upload signing and installed-certificate pinning must be handled separately, and the Play-generated Ring APK must be verified against the installed Bitkit certificate.
Preview
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
SharedPubkyContractTest.kt,SharedPubkyManifestTest.kt, andSharedPubkyProviderTest.ktcover strict wire parsing, source ownership, provider rows, export gating, and manifest security.PubkyRepoTest.ktandPaykitSdkServiceTest.ktcover adoption, source loss, lifecycle serialization, quarantine recovery, backup exclusion, and non-persistence of borrowed credentials.PubkyChoiceViewModelTest.ktcovers discovery, profile resolution, explicit selection, import routing, and failures.AppViewModelSendFlowTest.ktverifies foreground source validation reaches the Pubky repository.just compile,just lint, and all 1,709 unit tests pass with zero failures, errors, or skips;git diff --checkis clean.google-services.jsonlacking ato.bitkitFirebase client; placeholder expansion itself is deterministic.