aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.h
diff options
context:
space:
mode:
authorDusan Klinec <dusan.klinec@gmail.com>2018-11-12 00:07:25 +0100
committerDusan Klinec <dusan.klinec@gmail.com>2018-12-04 18:38:16 +0100
commitd21dad70ddda771bf33a19f9a53c48cc91d8464f (patch)
tree381a34cb060174556bbd156b94d014cc87524889 /src/wallet/wallet2.h
parentdevice/trezor: passphrase entry on host (diff)
downloadmonero-d21dad70ddda771bf33a19f9a53c48cc91d8464f.tar.xz
device: enable to use multiple independent device wallets
- adds a new option `--hw-device-deriv-path` to the simple wallet. Enables to specify wallet derivation path / wallet code (path avoided so it can be misinterpreted as a file path). - devices can use different derivation mechanisms. Trezor uses standard SLIP-10 mechanism with fixed SLIP-44 prefix for Monero - Trezor: when empty, the default derivation mechanism is used with 44'/128'/0'. When entered the derivation path is 44'/128'/PATH. - Trezor: the path is always taken as elements are hardened (1<<31 bit turned on)
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index c07054177..a588e8003 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -191,6 +191,7 @@ namespace tools
static bool has_testnet_option(const boost::program_options::variables_map& vm);
static bool has_stagenet_option(const boost::program_options::variables_map& vm);
static std::string device_name_option(const boost::program_options::variables_map& vm);
+ static std::string device_derivation_path_option(const boost::program_options::variables_map &vm);
static void init_options(boost::program_options::options_description& desc_params);
//! Uses stdin and stdout. Returns a wallet2 if no errors.
@@ -978,6 +979,8 @@ namespace tools
void confirm_non_default_ring_size(bool always) { m_confirm_non_default_ring_size = always; }
const std::string & device_name() const { return m_device_name; }
void device_name(const std::string & device_name) { m_device_name = device_name; }
+ const std::string & device_derivation_path() const { return m_device_derivation_path; }
+ void device_derivation_path(const std::string &device_derivation_path) { m_device_derivation_path = device_derivation_path; }
bool get_tx_key(const crypto::hash &txid, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys) const;
void set_tx_key(const crypto::hash &txid, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys);
@@ -1384,6 +1387,7 @@ namespace tools
std::unordered_set<crypto::hash> m_scanned_pool_txs[2];
size_t m_subaddress_lookahead_major, m_subaddress_lookahead_minor;
std::string m_device_name;
+ std::string m_device_derivation_path;
// Aux transaction data from device
std::unordered_map<crypto::hash, std::string> m_tx_device;