How can I get the Bech32 (Native SegWit) 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;
using namespace wallet;
int main()
{
data_chunk seed(16);
pseudo_random_fill(seed);
ec_secret secretKey = bitcoin_hash(seed);
ec_private wif(secretKey, 0x8000, true);
ec_compressed publicKey = wif.to_public().point();
// How to get the segwit address?
...
return 0;
}
</code>
<code>#include <bitcoin/system.hpp>
using namespace bc;
using namespace std;
using namespace wallet;
int main()
{
data_chunk seed(16);
pseudo_random_fill(seed);
ec_secret secretKey = bitcoin_hash(seed);
ec_private wif(secretKey, 0x8000, true);
ec_compressed publicKey = wif.to_public().point();
// How to get the segwit address?
...
return 0;
}
</code>
#include <bitcoin/system.hpp>
using namespace bc;
using namespace std;
using namespace wallet;
int main()
{
data_chunk seed(16);
pseudo_random_fill(seed);
ec_secret secretKey = bitcoin_hash(seed);
ec_private wif(secretKey, 0x8000, true);
ec_compressed publicKey = wif.to_public().point();
// How to get the segwit address?
...
return 0;
}