feat(wallet): restore Operator and Evonode Operator masternode keys - #812
Conversation
…lies The masternode keys tool regressed to Owner/Voting-only when it was migrated off DashSync (dfcc387) — at the time the FFI could not export per-index BLS/EdDSA public keys. It can now (ManagedPlatformWallet.providerKeyAtIndex), so this restores the full four-family screen: - Operator (BLS): public key in modern + legacy serialization, private key hex — all serialized on the Rust side. - Evonode Operator (Ed25519, formerly "HPMN Operator"): Platform Node ID, public key, private key, and the Tenderdash node key (base64 of priv‖pub) in dashmate's expected format. - Overview counts ("N key(s) / M used") and per-keypair usage lines ("Used at: <ip:port>" / "Previously used at:" for revoked registrations) are resolved from the Rust masternode aggregation (PlatformWalletManager.masternodes(for:)); the detail screen opens at the first unused keypair again. Owner/Voting keep their existing key-wallet derivation path. Derived provider keys are memoized per index since Ed25519 derivation pulls the seed through the mnemonic resolver on every call. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughMasternode key support now includes operator and Evonode operator provider-key exports, SDK-backed key derivation, masternode usage resolution, overview counts, and per-keypair usage labels. ChangesMasternode key export and usage tracking
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant WalletKeysOverviewViewModel
participant MasternodeKeyUsage
participant SwiftDashSDKHost
participant DerivationPathKeysModel
participant PlatformWallet
WalletKeysOverviewViewModel->>MasternodeKeyUsage: resolve usage
MasternodeKeyUsage->>SwiftDashSDKHost: read wallet masternodes
SwiftDashSDKHost-->>MasternodeKeyUsage: masternode usage and key indexes
WalletKeysOverviewViewModel-->>DerivationPathKeysModel: provide selected key family
DerivationPathKeysModel->>PlatformWallet: providerKeyAtIndex
PlatformWallet-->>DerivationPathKeysModel: provider key material
DerivationPathKeysModel-->>WalletKeysOverviewViewModel: key values and usage text
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
The Tools → Masternode keys screen regressed to Owner/Voting-only when it was migrated off DashSync (dfcc387) — at the time the SwiftDashSDK FFI could not export per-index BLS/EdDSA public keys, so the Operator and HPMN Operator families were dropped. The SDK has since grown exactly that surface (
ManagedPlatformWallet.providerKeyAtIndex, backed byplatform_wallet_provider_key_at_index), which the SwiftExampleApp already uses. This PR restores the screen to its full four-family glory: Owner, Voting, Operator, Evonode Operator.Changes
MNKeyis back to four cases; "HPMN Operator keys" returns as Evonode Operator keys (current terminology).platform_node_id), public key, private key, and the Tenderdash node key — base64 of the 64-bytepriv‖pubblob, the exact string dashmate's "Enter Ed25519 node key" prompt accepts (master rendered this as "Private / Public Keys (base64)").PlatformWalletManager.masternodes(for:)) — Rust reports in-wallet key indexes directly for Operator/Evonode; Owner/Voting are joined by base58 address.<ip:port>", "Previously used at: …" for revoked registrations, "Not yet used" otherwise; the screen opens at the first unused keypair instead of always keypair 0.m/9'/<coin>'/3'/1'|2') unchanged. Derived provider keys are memoized per index because Ed25519 derivation pulls the seed through the mnemonic resolver on every call.DASHSYNC_MIGRATION.mdrow 15 updated from "dropped, surfaces unavailable" to fully migrated; 12 new en localization strings.Test plan
dashpayarm64 simulator build🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation