Conversation
…hentication The account detail screen carried a private-key export that could never work: a PIN sheet nothing opened, a PIN nothing checked, and a stub that replaced the whole screen with "Private key derivation is not yet available". Remove it. The export already exists one tap deeper: every address row opens CoreAddressDetailView, which reveals hex and WIF through platform_wallet_address_private_key for any core account pool. Gate that reveal, and the provider operator / platform-node key reveal on the account screen, with the system device-owner prompt instead of a bare confirmation dialog. Revealed keys leave view state when the screen closes, are marked privacySensitive, and provider private-key copies now expire from the pasteboard after 60 s like the address ones. Add NSFaceIDUsageDescription (the app already called LAContext without it) and the CORE-24 test plan row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
✅ Final review complete — no blockers (commit 440b901) · triage: critical |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
- Revealed private keys stay visible when the app returns from the background —
packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Views/StorageRecordDetailViews.swift:1887-1891(new)
Impact: If a wallet owner reveals a key, switches apps, and hands over the unlocked device, the next person can reopen the wallet and read or copy the key without authenticating.
This SwiftExampleApp change removes an unreachable PIN sheet and replaces the confirmation dialogs for Core address and provider private-key reveals with device-owner authentication. The Swift SDK build-and-test check failed with the same type-check timeout at unchanged SendTransactionView.swift:80 on this head and the exact base, so the failure is not attributable to this diff and CI did not validate the reveal flow. Kotlin SDK CI and PR Hygiene were pending when checked.
🔴 1 blocking | 🟡 4 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); reviewer 5: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 6: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 7: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The change is contained to the example app but adds asynchronous authentication and private-key display lifecycle behavior across two views, without changing key derivation, cryptography, or FFI. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Views/StorageRecordDetailViews.swift`:
- [BLOCKING] packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Views/StorageRecordDetailViews.swift:1887-1891: Revealed private keys stay visible when the app returns from the background
Impact: If a wallet owner reveals a key, switches apps, and hands over the unlocked device, the next person can reopen the wallet and read or copy the key without authenticating.
The device-owner prompt protects the initial reveal, not access to the result after the app backgrounds. This view and `AccountDetailView.swift:155–160` clear their keys only in `onDisappear`; an ordinary app switch can leave the navigation destination mounted, and `.privacySensitive()` does not reset the reveal. The cleanup also does not invalidate pending work: successful authentication can still start derivation, and the completion can still write a key into retained view state after disappearance. In both views, hide secret rows while the scene is inactive, clear the state and invalidate the current request on actual backgrounding or disappearance, and check that the request is still current after authentication and before publishing the derived key. Distinguish the system prompt's temporary inactivity from backgrounding, and add CORE-24 cases for switching away during and after a reveal.
In `packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/AccountDetailView.swift`:
- [SUGGESTION] packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/AccountDetailView.swift:1116: Copied provider private keys can reach another device before they expire
Impact: An operator copying a BLS or Tenderdash private key for local use can make it available on another eligible device through Universal Clipboard.
The new sensitive-copy branch sets an expiration date but does not opt out of Universal Clipboard. Expiry limits the pasteboard item's lifetime; it does not stop cross-device transfer during that window or revoke a key that has already been pasted. Set `.localOnly: true` alongside the expiry, as `CreateInvitationSheet.copyLink` already does for a link containing a WIF. Leave public-key copies unchanged.
- [SUGGESTION] packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/AccountDetailView.swift:906-908: Sharing one BLS operator key with its account xpub can expose the other operator keys
Impact: An operator who gives a node host one private key and the account's extended public key can give that host control of other BLS operator keys in the account.
The warning moved into this caption describes control of the selected key, but the same screen displays the full BLS account extended public key, including its chain code. The pinned key-wallet implementation derives operator keys as non-hardened children, so disclosure of one child secret together with that account xpub compromises the operator account. Warn users before reveal not to share the BLS account xpub with recipients of individual operator keys. This warning does not apply to the hardened Ed25519 platform-node derivation.
In `packages/swift-sdk/SwiftExampleApp/TEST_PLAN.md`:
- [SUGGESTION] packages/swift-sdk/SwiftExampleApp/TEST_PLAN.md:126: CORE-24 lists DashPay accounts that the wallet account list hides
Impact: A tester following CORE-24 cannot reach either DashPay friendship account from the documented wallet route, and a contact-owned address found in Storage Explorer will not yield a WIF.
`AccountListView.swift:35–38` filters out both DashPay account tags. The pinned `all_accounts()` does enumerate both pools, but it is a lookup list, not an ownership check: the external pool tracks addresses derived from the contact's xpub, and `core_address_key.rs:333–335` refuses to return a key that does not control the requested address. Narrow CORE-24 and the PR coverage table to the account types reachable through the wallet list. If documenting a separate Storage Explorer case, distinguish wallet-owned receiving addresses from contact-owned outgoing addresses.
In `packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Utils/DeviceOwnerAuthentication.swift`:
- [SUGGESTION] packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Utils/DeviceOwnerAuthentication.swift:28-53: Cancelling device authentication can show an error for recovery but not for key reveal
Impact: A wallet owner who cancels the system prompt returns quietly from a private-key reveal, but the same cancellation during recovery-phrase reveal can display an authorization-failed alert.
The new helper classifies `userCancel`, `appCancel`, and `systemCancel` as cancellation. The same policy is evaluated separately in `WalletDetailView.swift:732–755` and `ContentView.swift:432–450`, where thrown cancellations take the failure path. Share the LocalAuthentication call and typed outcomes in the app helper so they cannot drift, while preserving each caller's own response to cancellation and orphan recovery's distinction between an unavailable policy and a failed evaluation.
Out-of-scope follow-up suggestions (2)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Core address key copies can bypass expiry or leave the device — The existing Hex and WIF rows offer a native Copy action that does not use the expiring tap handler, and the tap handler does not opt out of Universal Clipboard. Neither copy mechanism changed in this PR.
- Follow-up: Open a follow-up PR to route Core address secret copies through one explicit, local-only, expiring action and remove native text selection for those values.
- Identity re-scan can reveal master authentication keys without a prompt —
SearchWalletsForIdentitiesViewreveals a candidate master authentication WIF by toggling local state and copies it to the general pasteboard without expiry. This is a separate, unchanged export screen, not an alternate route to the keys gated by this PR.- Follow-up: Open a follow-up PR to remove private material from the re-scan preview or gate its display and use a local-only, expiring copy action.
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
…ves the foreground - Revealed address and provider keys are hidden while the scene is not active and cleared on backgrounding or when the screen closes; a reveal still in flight is invalidated by a request token checked after the prompt and before the derived key is published. - Private-key copies are local-only (no Universal Clipboard) as well as expiring after 60 s. - BLS operator accounts warn that the account extended public key plus one operator private key yields the other operator keys. - The recovery-phrase reveal and orphan-wallet recovery use the shared DeviceOwnerAuthentication prompt, so a cancelled prompt no longer shows an "Authorization failed" alert there; recovery treats it as denied. - CORE-24 drops the DashPay accounts the account list hides and adds the background, app-switcher and copy cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Your move: thepastaclaw left review threads unresolved; resolve them. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This follow-up hides revealed account keys while the app is inactive, clears them on backgrounding, makes tap-to-copy local-only, adds BLS sharing warnings, and shares typed authentication outcomes with recovery flows. The Swift SDK build and tests check fails with the same type-check timeout at SendTransactionView.swift:80 on both the exact PR head and its base; the Swift schema and Kotlin checks passed. Review and PR Hygiene checks are pending.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Follow-up candidates (optional) (1)
New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.
🟡 Suggestion: The system Copy menu can sync an address private key to another device
Impact: A wallet owner who uses the standard Copy menu on a revealed hex key or WIF can put the spending key on Universal Clipboard without the app’s 60-second expiry.
packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Views/StorageRecordDetailViews.swift:1981
An ordinary copy of a revealed address key can bypass both clipboard protections. After the owner opens a wallet-owned address and authenticates with View Private Key, both the hex and WIF rows render through copyableKeyRow. Its .textSelection(.enabled) gives iOS its own Copy action, separate from the row’s tap gesture. The new .localOnly option and the 60-second expiry are set only by the tap handler, so native Copy can sync the key to another eligible Handoff device and does not get the app’s expiry. Disable text selection on the two secret values, keep tap-to-copy, and add a long-press check to CORE-24.
.textSelection(.disabled)
source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, security-auditor)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — AccountDetailView.swift and StorageRecordDetailViews.swift change private-key handling through asynchronous device authentication, stale-result rejection, lifecycle-based hiding and clearing, and clipboard restrictions. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- New since the last final review (
cbf9c1ba): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 not confirmed (no longer blocking) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- The recovery phrase stays visible after backgrounding and copies without clipboard restrictions — The recovery sheet stays presented while
revealedMnemonicis non-nil; backgrounding does not clear it or require another prompt. Its Copy button writes the full phrase toUIPasteboard.general.stringwithout opting out of Handoff or setting an expiry, and the individual words are also selectable. These display and export paths are unchanged from the base: the follow-up shares the authentication prompt and its outcomes, not the sheet’s reveal lifetime or clipboard policy.- Follow-up: Track a recovery-phrase hardening PR that hides the words while inactive, clears the phrase and invalidates pending reveals on backgrounding, and either removes clipboard export or restricts it to one local-only, expiring copy path.
|
Bots are done — your move: post |
Basic explanation
The account screen in the iOS example app had a "private key export" that never worked: it asked for a PIN that nothing checked, and its only code replaced the screen with an error. This removes that dead code. You export a key from the screen one tap deeper (tap an address), which already worked. That reveal, and the provider-key reveal on the account screen, now ask for Face ID, Touch ID or the passcode first instead of a plain "Are you sure?" dialog.
Issue being fixed or feature implemented
AccountDetailViewheld a PIN sheet (PINPromptView), four unused@Statevalues andderivePrivateKeyWithPIN(), whose body was a staleTODO(platform-wallet): needs new FFI for WIF derivationthat seterrorMessage = "Private key derivation is not yet available…". Setting that error swapped the whole screen for "Failed to Load Details". Nothing ever opened the sheet, and the PIN was never verified.The FFI that TODO asked for already exists:
platform_wallet_address_private_key(wrapped byManagedPlatformWallet.coreAddressPrivateKey(address:)). It finds the address in any core account pool of the wallet and returns hex plus compressed, network-aware WIF, with the mnemonic read inside Rust through the resolver.CoreAddressDetailView, which each address row of the account screen opens, already calls it.I searched open PRs and issues on dashpay/platform for this and found nothing (the closest are #6087, Kotlin vote signing, and #5519, a DPP refactor).
What was done?
Coverage by account type (from key-wallet
ManagedAccountCollection::all_accountsat the pinned rust-dashcore revision):CoreAddressDetailView→platform_wallet_address_private_keyCoreAddressDetailViewproviderKeyAtIndex(includePrivate: true)PlatformAddressDetailViewoffers no revealNo Rust or FFI changes were needed.
Changes
AccountDetailView: removed the PIN sheet,PINPromptView, the stub, its stale TODO, and the now-unusederrorMessage/ "Failed to Load Details" branch andcopiedText. The provider derived-key reveal now uses device authentication instead of aconfirmationDialog. Its warning stays visible as a caption. Revealed keys are cleared inonDisappear, private-key rows areprivacySensitive(), and private-key copies now expire from the pasteboard after 60 s (before this they never expired).WalletDetailView(recovery phrase) andContentView(orphan recovery) now use the sharedDeviceOwnerAuthenticationprompt, so a cancelled prompt no longer shows "Authorization failed" there; recovery treats it as denied.CoreAddressDetailView: same change. View Private Key → device authentication →coreAddressPrivateKey(address:). The key is cleared inonDisappearand its rows areprivacySensitive(). The copy behaviour (60 s expiry) is unchanged. I added accessibility idscoreAddress.revealPrivateKeyButton,coreAddress.privateKey.hex,coreAddress.privateKey.wifandcoreAddress.revealError.Utils/DeviceOwnerAuthentication.swift: oneLAContext.deviceOwnerAuthenticationprompt (the policy the recovery-phrase reveal already uses). Cancelling shows nothing; an unavailable or failed prompt shows its message. Its doc comment notes that this gates the screen and does not protect the key, because the mnemonic Keychain item has no access control on its read path.Info.plist: addedNSFaceIDUsageDescription. The app already calledLAContextin two places without it.TEST_PLAN.md: new row CORE-24, including how to enroll and match Face ID on the simulator.Before:
After:
docs/sdk/sdk-parity-manifest.jsonhas no tracked capability for key export, so it is unchanged. Kotlin:KotlinExampleApp'sAccountDetailScreenhas no such stub, and neither the Kotlin SDK nor the app exposes an address private-key reveal at all (no binding toplatform_wallet_address_private_key).How Has This Been Tested?
xcodebuildof SwiftExampleApp for the iOS 27.2 simulator, using an xcframework cloned from a sibling worktree with fresher cbindgen headers swapped in. Every Swift file in the app compiled, including the three changed ones and the new file. The build failed only at link, on symbols from the already merged feat(sdk): read contract moderation and fee pots in the Swift SDK and example app #6056 and feat(swift-example-app): update a data contract from its detail screen, with a Rust preview of the changes #6053 (dash_sdk_contract_moderation_*,dash_sdk_contract_get_fee_pots,platform_wallet_preview_data_contract_update,platform_wallet_split_contract_update_source) that the cloned static library predates. This change adds no FFI symbol.TEST_PLAN.mdgives the manual steps.Breaking Changes
None. Only example-app code changed.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
440b901/self-reviewedswift-sdk(packages/swift-sdk/SwiftExampleApp/Info.plist,packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/ContentView.swift,packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/AccountDetailView.swiftand 4 more) — llbartekll or romchornyiWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.