Repository navigation
refactor(identity): choose and check signing keys with platform-wallet's selector - #1133
Claudius-Maginificent wants to merge 10 commits into
Conversation
Pins every dashpay/platform crate to 6bb7927a (dashpay/platform#5588, branch feat/platform-wallet-public-signing-key-selection, on v5.1-dev 575d961fe), which makes platform-wallet's protocol 14 key selector, explicit-key check, SigningScope bounds check and own encryption key selector public. The revision is not yet on v1.0-dev's pinned ancestry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…t's selector Upstream platform-wallet now exposes the protocol 14 key selector (usable_signing_key), the explicit-key check (check_signing_key), the SigningScope they share with its bounds check, and its own encryption key selector; dpp exposes the accepted security levels for a requirement. DET's copies of those rules go: select_signing_key, select_identity_signing_key, is_auto_selectable, bounds_permit, document_security_levels, DET's own SigningScope, the DPNS chosen-key predicate, the auto-accept encryption key mirror, and the tests that duplicated upstream's. What is left is DET's own: KeyRequirements as the argument bundle, KeyLookupOnly for informational lookups that ignore what the device holds, and the key chooser's caveats, which take the bounds verdict from upstream. Two choices change to follow upstream: - A username registration refuses a chosen key that has expired before anything is paid, with the expired-key message, and accepts a chosen key bound to a contract group (Platform decides membership). - Contract bounds limit only AUTHENTICATION keys, as in consensus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
|
🕓 Review not started yet because this PR is a draft.
Commit 0c7a9c1. Normal review starts when eligible; priority review starts as soon as a slot is available. |
… key selection branch Conflict: QualifiedIdentity::auto_accept_proof_key, which this branch routed through platform-wallet's select_own_encryption_key and #1117 removed with DET's own auto-accept code; it stays removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
|
Next steps: still blocked by dashpay/platform#5588. The updated #1117 head is merged in locally and verified; it will be pushed after #1117. Once #5588 merges, the Platform pin moves to the merged revision and this PR leaves draft. 🤖 Co-authored by Claudius the Magnificent AI Agent |
…let key selection branch Conflicts: - src/model/qualified_identity/mod.rs: signing_key_now keeps upstream's selector and hands it ObtainableKeys, a signer view whose can_sign_with admits only keys whose private half this device can obtain (#1117's holds_obtainable_key fix). - src/model/identity_key_usability.rs: this branch's removal of document_security_levels stays (dpp's accepted_for_requirement already returns exactly MASTER for MASTER); the MASTER test moves to qualified_identity, through document_signing_key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…-wallet key selection branch Conflicts in Cargo.toml and Cargo.lock: v1.0-dev moves Platform to 575d961f; this branch keeps its pin at 6bb7927a (dashpay/platform#5588), which already contains v5.1-dev up to 575d961f. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…gner requires The view names only the identity id, so key material never reaches a debug print. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Its sign methods forward to the identity without re-checking holds_obtainable_key, so an unobtainable key keeps failing with the identity's typed signing errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…n-via-platform-wallet Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WunYYhY7P2FJqHVgkHiXtT
…n-via-platform-wallet Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WunYYhY7P2FJqHVgkHiXtT
TL;DR: The app now chooses and checks identity signing keys with Platform's own wallet library instead of its own copy of the rules. Key choice stays the same as #1117, with two exceptions. A username registration refuses an expired key the user picked before anything is paid. And a key bound to a contract group is left to the network to accept or refuse.
User story
As a user, I want the app to pick signing keys exactly as Platform's wallet library does, so that this app and other Dash wallets agree on which key signs, and a fix in one reaches the other (IDN-024).
Scenario
An identity has an expired HIGH key. The user picks it under Advanced on the username screen and confirms.
Detailed discussion
Blocked by dashpay/platform#5588. Stacked atop #1117.
What moves upstream
platform_wallet::usable_signing_keypicks the key for every action: documents, usernames, DashPay, tokens, contracts, key updates, credit transfers and withdrawals. It ranks every unlimited key at any accepted level before any limited one, then key id. It skips disabled, expired, out-of-scope and contract-group keys, and keys this device cannot sign with.platform_wallet::check_signing_keychecks it, with the refusal Platform itself would return.SigningScope::bounds_check(over dpp'sContractBounds::check_scope) gives the verdict, including the rule that bounds limit only AUTHENTICATION keys.SecurityLevel::accepted_for_requirementgives the levels a document type accepts.SigningScope.What stays in DET
KeyRequirements: the argument bundle DET's screens pass to the upstream selector.KeyLookupOnly: a signer that signs nothing, for lookups that point the user at a key whatever the device holds (Check Owner Key, Manage Transfer Key).KeyCaveat): they now take their bounds verdict from upstream.Behaviour changes
Dependencies
6bb7927a(the head of feat(platform-wallet)!: expose protocol-14-aware signing-key selection platform#5588, on v5.1-dev575d961fe). That revision is not yet onv1.0-dev's pinned ancestry, soscripts/migration-fixtures/check-pin-ancestry.shfails until the upstream PR merges and the pin moves to the merged revision.Testing
qualified_identity,identity_key_usability,dashpay,dpns,document_action_screen,helpers,tokens,contracts_documents,identity::keys, and the transfer and withdrawal screens (859 passed).cargo clippy --all-features --all-targets -- -D warningsandcargo fmt --allpass.🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q