Skip to content

feat(wallet): restore Operator and Evonode Operator masternode keys - #812

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
claude/masternode-keys-regression-6bc7c7
Jul 16, 2026
Merged

feat(wallet): restore Operator and Evonode Operator masternode keys#812
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
claude/masternode-keys-regression-6bc7c7

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Jul 16, 2026

Copy link
Copy Markdown
Member

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 by platform_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

  • MNKey is back to four cases; "HPMN Operator keys" returns as Evonode Operator keys (current terminology).
  • Operator (BLS) rows: public key in modern (IETF) and Dash legacy serialization, plus the private key hex — all serialization happens on the Rust side.
  • Evonode Operator (Ed25519) rows: Platform Node ID (the ProRegTx platform_node_id), public key, private key, and the Tenderdash node key — base64 of the 64-byte priv‖pub blob, the exact string dashmate's "Enter Ed25519 node key" prompt accepts (master rendered this as "Private / Public Keys (base64)").
  • Overview counts restored: each family shows "N key(s) / M used" again, resolved from the Rust masternode aggregation (PlatformWalletManager.masternodes(for:)) — Rust reports in-wallet key indexes directly for Operator/Evonode; Owner/Voting are joined by base58 address.
  • Usage lines restored on the detail screen: "Used at: <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.
  • Owner/Voting keep their existing key-wallet derivation path (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.md row 15 updated from "dropped, surfaces unavailable" to fully migrated; 12 new en localization strings.

Test plan

  • Clean dashpay arm64 simulator build
  • Testnet smoke on a wallet that owns masternodes: overview shows correct counts, keypair usage lines show the node's ip:port
  • Cross-check keypair 0's operator public key (both serializations) and platform node ID against SwiftExampleApp on the same mnemonic

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Operator and Evonode Operator key families to Masternode Keys.
    • Added platform node ID, Tenderdash node key, public key, and legacy public key details.
    • Displayed key counts, usage counts, and per-key usage status, including service information and previously used keys.
    • Added support for deriving and exporting provider keys through the platform wallet.
  • Documentation

    • Updated the migration documentation to reflect the expanded provider-key scope.

…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>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 58eb95b9-a8d0-47bd-bf8c-9476efcfc25a

📥 Commits

Reviewing files that changed from the base of the PR and between 8e65fb6 and ba5c486.

📒 Files selected for processing (6)
  • DASHSYNC_MIGRATION.md
  • DashWallet/Sources/UI/Menu/Tools/Masternode Keys/DerivationPathKeys/DerivationPathKeysView.swift
  • DashWallet/Sources/UI/Menu/Tools/Masternode Keys/DerivationPathKeys/Models/DerivationPathKeysModel.swift
  • DashWallet/Sources/UI/Menu/Tools/Masternode Keys/Overview/KeysOverviewView.swift
  • DashWallet/Sources/UI/Menu/Tools/Masternode Keys/Overview/Model/WalletKeysOverviewModel.swift
  • DashWallet/en.lproj/Localizable.strings

📝 Walkthrough

Walkthrough

Masternode 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.

Changes

Masternode key export and usage tracking

Layer / File(s) Summary
Resolve key usage and overview counts
DashWallet/Sources/UI/Menu/Tools/Masternode Keys/Overview/...
Adds operator key families, resolves per-index usage from wallet masternode data and Rust aggregation, and displays key and usage counts.
Derive provider key values
DashWallet/Sources/UI/Menu/Tools/Masternode Keys/DerivationPathKeys/Models/DerivationPathKeysModel.swift
Separates ECDSA and provider derivation and exposes provider public keys, platform node IDs, private keys, and Tenderdash node keys.
Display keypair usage and localized labels
DashWallet/Sources/UI/Menu/Tools/Masternode Keys/DerivationPathKeys/DerivationPathKeysView.swift, DashWallet/en.lproj/Localizable.strings, DASHSYNC_MIGRATION.md
Shows per-keypair usage text and adds localization and migration documentation for the expanded key data.ka

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
Loading

Possibly related PRs

Suggested reviewers: llbartekll, ross-dash, hashengineering

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/masternode-keys-regression-6bc7c7

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@QuantumExplorer
QuantumExplorer changed the base branch from master to swift-sdk-integration July 16, 2026 06:14
@QuantumExplorer QuantumExplorer changed the title feat(masternode-keys): restore Operator and Evonode Operator key families feat(wallet): restore Operator and Evonode Operator masternode keys Jul 16, 2026
@QuantumExplorer
QuantumExplorer merged commit c04c230 into swift-sdk-integration Jul 16, 2026
2 of 4 checks passed
@QuantumExplorer

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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