Example #1
0
bool WalletBatch::WriteOfflineXPubKey(const CExtPubKey& offline_xpub)
{
    std::vector<unsigned char> vxpub;
    vxpub.resize(BIP32_EXTKEY_SIZE);
    offline_xpub.Encode(&vxpub[0]);
    return WriteIC(std::string("offlinexpub"), vxpub);
}
Example #2
0
std::string EncodeExtPubKey(const CExtPubKey& key)
{
    std::vector<unsigned char> data = Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY);
    size_t size = data.size();
    data.resize(size + BIP32_EXTKEY_SIZE);
    key.Encode(data.data() + size);
    std::string ret = EncodeBase58Check(data);
    return ret;
}