 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
41 std::cout <<
"mnemonic: ***CRYPTED***" << std::endl;
42 std::cout <<
"mnemonicpassphrase: ***CRYPTED***" << std::endl;
43 std::cout <<
"seed: ***CRYPTED***" << std::endl;
47 std::cout <<
"seed: " <<
HexStr(
vchSeed).c_str() << std::endl;
54 std::cout <<
"extended private masterkey: " << b58extkey.
ToString().c_str() << std::endl;
57 extpubkey = extkey.
Neuter();
60 b58extpubkey.
SetKey(extpubkey);
61 std::cout <<
"extended public masterkey: " << b58extpubkey.
ToString().c_str() << std::endl;
80 if (ssMnemonic.empty()) {
87 throw std::runtime_error(std::string(__func__) +
": invalid mnemonic: `" + std::string(ssMnemonicTmp.c_str()) +
"`");
160 masterKey.
Derive(purposeKey, 44 | 0x80000000);
164 cointypeKey.
Derive(accountKey, nAccountIndex | 0x80000000);
166 accountKey.
Derive(changeKey, fInternal ? 1 : 0);
168 changeKey.
Derive(extKeyRet, nChildIndex);
const uint256 UINT256_ZERO
constant uint256 instances
void DeriveChildExtKey(uint32_t nAccountIndex, bool fInternal, uint32_t nChildIndex, CExtKey &extKeyRet)
SecureVector vchMnemonicPassphrase
void SetKey(const K &key)
bool Derive(CExtKey &out, unsigned int nChild) const
static void ToSeed(SecureString mnemonic, SecureString passphrase, SecureVector &seedRet)
SecureVector GetSeed() const
bool SetMnemonic(const SecureVector &vchMnemonic, const SecureVector &vchMnemonicPassphrase, bool fUpdateID)
std::string ToString() const
bool GetMnemonic(SecureVector &vchMnemonicRet, SecureVector &vchMnemonicPassphraseRet) const
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
256-bit unsigned big integer.
static SecureString Generate(int strength)
static bool Check(SecureString mnemonic)
void SetCrypted(bool fCryptedIn)
std::vector< unsigned char, secure_allocator< unsigned char > > SecureVector
bool SetSeed(const SecureVector &vchSeedIn, bool fUpdateID)
const CChainParams & Params()
Return the currently selected parameters.
static const int CURRENT_VERSION
void Debug(const std::string &strName) const
std::string Hash(std::string input)
Compute the 256-bit hash of a std::string.
CExtPubKey Neuter() const
void SetMaster(const unsigned char *seed, unsigned int nSeedLen)
std::string GetKeyPath() const