45 std::cout << __func__ <<
": ---" << strName <<
"---" << std::endl;
47 std::cout <<
"mnemonic: ***CRYPTED***" << std::endl;
48 std::cout <<
"mnemonicpassphrase: ***CRYPTED***" << std::endl;
49 std::cout <<
"seed: ***CRYPTED***" << std::endl;
53 std::cout <<
"seed: " <<
HexStr(
vchSeed).c_str() << std::endl;
60 std::cout <<
"extended private masterkey: " << b58extkey.
ToString().c_str() << std::endl;
63 extpubkey = extkey.
Neuter();
66 b58extpubkey.
SetKey(extpubkey);
67 std::cout <<
"extended public masterkey: " << b58extpubkey.
ToString().c_str() << std::endl;
87 if (ssMnemonic.empty()) {
94 throw std::runtime_error(std::string(__func__) +
": invalid mnemonic: `" + std::string(ssMnemonicTmp.c_str()) +
"`");
167 masterKey.
Derive(purposeKey, 44 | 0x80000000);
169 purposeKey.
Derive(cointypeKey,
Params().ExtCoinType() | 0x80000000);
171 cointypeKey.
Derive(accountKey, nAccountIndex | 0x80000000);
173 accountKey.
Derive(changeKey, fInternal ? 1 : 0);
175 changeKey.
Derive(extKeyRet, nChildIndex);
void SetMaster(const unsigned char *seed, unsigned int nSeedLen)
SecureVector vchMnemonicPassphrase
bool GetMnemonic(SecureVector &vchMnemonicRet, SecureVector &vchMnemonicPassphraseRet) const
bool Derive(CExtKey &out, unsigned int nChild) const
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
SecureVector GetSeed() const
CCriticalSection cs_accounts
void DeriveChildExtKey(uint32_t nAccountIndex, bool fInternal, uint32_t nChildIndex, CExtKey &extKeyRet)
std::string ToString() const
bool GetAccount(uint32_t nAccountIndex, CHDAccount &hdAccountRet)
static bool Check(SecureString mnemonic)
static const int CURRENT_VERSION
CExtPubKey Neuter() const
std::vector< unsigned char, secure_allocator< unsigned char > > SecureVector
std::string GetKeyPath() const
std::map< uint32_t, CHDAccount > mapAccounts
uint256 Hash(const T1 pbegin, const T1 pend)
void SetCrypted(bool fCryptedIn)
const CChainParams & Params()
static SecureString Generate(int strength)
bool SetMnemonic(const SecureVector &vchMnemonic, const SecureVector &vchMnemonicPassphrase, bool fUpdateID)
bool SetAccount(uint32_t nAccountIndex, const CHDAccount &hdAccount)
bool SetSeed(const SecureVector &vchSeedIn, bool fUpdateID)
static void ToSeed(SecureString mnemonic, SecureString passphrase, SecureVector &seedRet)
void SetKey(const K &key)
void Debug(std::string strName) const