feat: add Paykit server accounts#630
Conversation
Greptile SummaryThis PR adds Paykit Server watch-only accounts. The main changes are:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| Bitkit/Services/PubkyService.swift | Adds companion authorization and preserves account tracking for the documented post-delivery authorization failure. |
| Bitkit/Services/WatchOnlyAccountService.swift | Adds account allocation, persistence, authorization lifecycle, backup restoration, and tracking reconciliation. |
| Bitkit/Services/LightningService.swift | Integrates watch-only accounts with LDK startup, scanning, address lookahead, and tracking controls. |
Reviews (3): Last reviewed commit: "fix: derive Paykit Noise key from wallet..." | Re-trigger Greptile
|
Same review notes as the companion Android PR: synonymdev/bitkit-android#1084 (comment) (Please apply the same UI gating / testing / ADR questions there.) CI / merge
|
67d11d0 to
3d5c9be
Compare
990db23 to
e4a5c92
Compare
|
Thanks — the corresponding iOS items are now addressed on the latest commit. UI gatingSettings → Advanced → Server Accounts is now only visible when Enable Paykit UI is enabled. Testing the flowReviewers can exercise the Bitkit-side flow using this disposable request: Enable Paykit UI, then paste or scan it. This exercises the watch-only consent, normal Pubky authorization, account allocation/xpub export, both relay deliveries, local activation, and Server Accounts UI. The xpub can then be copied from the account details sheet and used to test external address derivation, funding, restart discovery, spending, and disabling/re-enabling tracking. Because the request secret is public, this should only be done with a disposable regtest wallet. The missing part is requester-side polling, decryption, and signature verification; that requires a Paykit Server listener or receiver harness. Server stagingThe intended next server-side QA step is to deploy Paykit Server on staging once runtime/listener composition exists. There is no staging endpoint yet, and that work is outside these mobile PRs. Retry and activation behaviorThe same post-delivery behavior is covered on iOS:
Protocol versionADR 0001's CI and regressionThe branch was rebased and is currently mergeable. The notification-target failure was fixed through the target membership exclusion list; The existing |
|
Same retest notes as the companion Android PR: synonymdev/bitkit-android#1084 (comment) iOS-specific bits already covered there: Enter-manually gap for |
|
Retested after the alignment fixes. Looks good to approve on my side. Verified:
No remaining iOS blockers from this pass. Android still has a home-Scan gating bug (home Scan is modeled as Send, so |
jvsena42
left a comment
There was a problem hiding this comment.
Simulator.Screen.Recording.-.iPhone.17.-.2026-07-24.at.10.05.22.mov
Approved with some nits
Description
This PR builds on #620 to add Paykit Server watch-only accounts:
x-bitkit-claim=watch-only-account-v1and the exact/pub/paykit/v0/bitkit/server/:rwcapability, rejecting missing, unknown, duplicate, or mismatched companion parameters.0.1.0-rc37, LDK Node0.7.0-rc.57, and Bitkit Core0.4.2; Bitkit Core now supplies trusted extended-public-key serialization, so Base58Swift and its BigInt dependency are no longer required.The relay claim contains only the versioned account index, address type, and serialized xpub. Local names and tracking state are not disclosed. Ordinary Pubky Auth remains unchanged.
References:
QA Notes
This slice implements ADR 0001's
watch-only-account-v1claim, which is the currently agreed protocol. ADR 0002's proposedwatch-only-account-service-v1delegation flow has not been agreed and is not part of the current implementation.Reviewers can exercise the complete Bitkit-side setup and account lifecycle with this disposable test request:
Enable Paykit UI, then scan or paste the URL. It exercises watch-only consent, normal Pubky authorization, account allocation and xpub export, companion-claim delivery followed by AuthToken delivery, local activation, and Server Accounts management. The xpub can be copied from the account details and used for external address derivation, funding, restart discovery, spending, and tracking disable/re-enable testing.
The request secret is public, so this URL must only be used with a disposable regtest wallet. A Paykit Server listener or receiver harness is still required to verify requester-side relay polling, decryption, and signature verification. A staging deployment is intended once Paykit Server runtime/listener composition is available.
Manual Tests
Automated Checks
WatchOnlyAccountServiceTests.swiftPubkyAuthApprovalSheetTests.swiftPubkyAuthRequestTests.swiftPaykitReceiverNoiseKeyStoreTests.swiftDEBUG E2E_BUILD) succeeds with the notification target's watch-only/localization membership dependencies.git diff --checkpassed.