Skip to content

Commit a9fbf60

Browse files
feat(wallet): implement unified offline private key export API (#2542)
This introduces the `get_private_keys` RPC method, providing a unified and robust way to export private keys, public keys, and addresses for coins without requiring them to be activated. This is crucial for wallet recovery, auditing, and management. The new API supports two distinct wallet structures: * **HD Mode** (`"mode": "hd"`): For Hierarchical Deterministic wallets, deriving keys using BIP39/BIP44 standard derivation paths. The response includes the full derivation path for each address. * **Iguana Mode** (`"mode": "iguana"`): For legacy wallets that use a single private key derived directly from the passphrase. Key features and improvements include: * **Offline Capability:** Works for any coin defined in the configuration, regardless of its activation status. * **Protocol-Specific Logic:** * **UTXO/EVM/Tendermint:** Correctly generates addresses and key formats (WIF, hex) based on the protocol. * **ZHTLC (Shielded Coins):** Implements accurate key derivation for shielded accounts, returning the correct viewing key and both transparent (`derivation_path`) and shielded (`z_derivation_path`) derivation paths. --- Co-authored-by: Devin AI Note: This marks Devin AI's first contribution to the Komodo DeFi Framework.
1 parent fbab8ec commit a9fbf60

File tree

6 files changed

+1273
-17
lines changed

6 files changed

+1273
-17
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mm2src/coins/rpc_command/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub mod init_account_balance;
77
pub mod init_create_account;
88
pub mod init_scan_for_new_addresses;
99
pub mod init_withdraw;
10+
pub mod offline_keys;
1011
pub mod tendermint;
1112

1213
#[cfg(not(target_arch = "wasm32"))] pub mod lightning;

0 commit comments

Comments
 (0)