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:
- Move the HD key selection logic from the derivehdkey RPC into CWallet::SelectHDKey().
- Update derivehdkey RPC to call CWallet::SelectHDKey(), keeping its argument parsing, guards and error codes in the RPC.
- Return util::Expected<CExtKey, WalletError> from CWallet::SelectHDKey(), using WalletErrorCode::UnlockNeeded for a locked wallet so callers can prompt for a passphrase and retry.
- Add CWallet::DeriveHDKey(), which selects the HD key and derives it at the requested path.
- 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().