This PR adds a wallet interface for derivehdkey.
The motivation is the same as #35436 and #34861. The derivehdkey RPC exists (#32784), but the GUI does not go through RPC, so the logic is currently out of its reach. A dedicated wallet interface makes it available for multisig setup. Alongside the addhdkey interface, this lets the GUI add an HD key and derive a shareable xpub from it. Tracked as the deriveHDKey item in #35645.
Key changes:
- Add CWallet::DeriveHDKey(), which selects the HD key and derives it at the requested path.
- Update the derivehdkey RPC to call it, rather than repeating the hardened path check, the key selection and the derivation. The watch-only and unlock checks stay in the RPC, along with the xpub argument parsing.
- Add interfaces::Wallet::deriveHDKey(), which returns the derived xpub and its key origin. Private key material does not cross the interface.
- Add unit test coverage for interfaces::Wallet::deriveHDKey().
The RPC maps every WalletError to -4, moving the unhardened path and failed derivation cases from -8 and the key selection cases from -5. The watch-only -4 and locked wallet -13 are unchanged.