Upgrade libbitcoin 1.0 code samples to libbitcoin 2.0

This commit is contained in:
Amir Taaki
2015-01-18 21:19:57 +01:00
parent 665f0b69ba
commit f7804da5db
2 changed files with 17 additions and 7 deletions

View File

@@ -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;