Skip to content

Feat: add profile fetching from pubky#476

Open
ben-kaufman wants to merge 5 commits intomasterfrom
feat/pubky-profile
Open

Feat: add profile fetching from pubky#476
ben-kaufman wants to merge 5 commits intomasterfrom
feat/pubky-profile

Conversation

@ben-kaufman
Copy link
Contributor

@ben-kaufman ben-kaufman commented Mar 5, 2026

Summary

Integrates Pubky decentralized identity into Bitkit, allowing users to connect their Pubky profile via Pubky Ring authentication. Once connected, the user's profile name and avatar are displayed on the home screen header, and a full profile page shows their bio, links, and a shareable QR code.

What's included

  • Authentication flow via Pubky Ring deep links (pubkyauth://) with relay-based session exchange, session persistence in Keychain, and automatic restoration on app launch
  • Profile page displaying name, bio, links, and a QR code with the profile picture overlaid
  • Home screen integration showing the authenticated user's name and avatar in the header
  • PubkyService — service layer wrapping paykit-ffi (profile/contacts/payments) and bitkit-core (auth relay, PKDNS file fetching)
  • PubkyProfileManager — manages auth state, session lifecycle, and profile data with all FFI/Keychain/disk operations offloaded to background threads
  • PubkyImage component for loading pubky:// URIs with two-tier (memory + disk) caching
  • Suggestion card auto-dismiss when user is already authenticated
  • QR component — moved QR code generation off the main thread

New dependencies

  • paykit-rs (SPM, branch: master) — Pubky SDK for profile, contacts, and payment operations
  • CoreBluetooth framework (linker flag, required by paykit-rs)

New files

File Purpose
Services/PubkyService.swift FFI bridge to paykit-ffi and bitkit-core
Managers/PubkyProfileManager.swift Auth state, session persistence, profile loading
Models/PubkyProfile.swift Profile data model
Components/PubkyImage.swift pubky:// image loader with disk+memory cache
Views/Profile/ProfileView.swift Full profile page (name, bio, links, QR)
Views/Profile/PubkyRingAuthView.swift Pubky Ring auth flow UI

Modified files

File Change
AppScene.swift Inject PubkyProfileManager, initialize Paykit early
MainNavView.swift Wire up profile/auth navigation routes
Header.swift Show profile name + avatar, navigate to profile
Suggestions.swift Auto-dismiss profile card when authenticated
QR.swift Async QR generation via .task(id:)
Info.plist LSApplicationQueriesSchemes for pubkyauth, ATS config
Keychain.swift Add paykitSession entry type
NavigationViewModel.swift Add .pubkyRingAuth route
ProfileIntro.swift Updated layout and styling
Colors.swift Add pubkyBrand color
Localizable.strings Profile-related translation keys

Test plan

  • Fresh install: tap profile in header → shows intro → continue → auth screen
  • Auth screen: shows "Download Pubky Ring" if Ring not installed, "Authorize" if installed
  • Authorize → opens Pubky Ring → approve → returns to Bitkit → navigates to profile page
  • Profile page shows name, bio, links, QR code with profile picture overlay
  • Home header shows profile name and avatar after authentication
  • Kill and relaunch app → session restored, profile shown without re-auth
  • Sign out from profile page → returns to unauthenticated state
  • Profile suggestion card auto-dismisses when authenticated
ScreenRecording_03-04-2026.23-49-21_1.MP4

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.

1 participant