mirror of
https://github.com/tappollo/bitcoinbook.git
synced 2026-04-28 19:05:32 +08:00
Upgrade libbitcoin 1.0 code samples to libbitcoin 2.0
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
int main()
|
||||
{
|
||||
// Private secret key.
|
||||
bc::ec_secret secret = bc::decode_hash(
|
||||
bc::ec_secret secret;
|
||||
bool success = bc::decode_hash(secret,
|
||||
"038109007313a5807b2eccc082c8c3fbb988a973cacf1a7df9ce725c31b14776");
|
||||
assert(success);
|
||||
// Get public key.
|
||||
bc::ec_point public_key = bc::secret_to_public_key(secret);
|
||||
std::cout << "Public key: " << bc::encode_hex(public_key) << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user