How can I get the Legacy Bitcoin Address from the ec_private without using HD Keys. My code is as follows and I am quite struggling to use libbitcoin documentation.
<code>#include <bitcoin/system.hpp>
using namespace bc;
using namespace std;
int main()
{
data_chunk seed(16);
pseudo_random_fill(seed);
ec_secret secretKey = bitcoin_hash(seed);
wallet::ec_private wif(secretKey, 0x8000, true);
// I'm not sure, the following method is correct or not?
string legacyAddress = wif.to_payment_address().encoded();
// How to get the segwit address?
...
return 0;
}
</code>
<code>#include <bitcoin/system.hpp>
using namespace bc;
using namespace std;
int main()
{
data_chunk seed(16);
pseudo_random_fill(seed);
ec_secret secretKey = bitcoin_hash(seed);
wallet::ec_private wif(secretKey, 0x8000, true);
// I'm not sure, the following method is correct or not?
string legacyAddress = wif.to_payment_address().encoded();
// How to get the segwit address?
...
return 0;
}
</code>
#include <bitcoin/system.hpp>
using namespace bc;
using namespace std;
int main()
{
data_chunk seed(16);
pseudo_random_fill(seed);
ec_secret secretKey = bitcoin_hash(seed);
wallet::ec_private wif(secretKey, 0x8000, true);
// I'm not sure, the following method is correct or not?
string legacyAddress = wif.to_payment_address().encoded();
// How to get the segwit address?
...
return 0;
}