C++ generate bitcoin address - Tell
4. Crypto and Private Keys¶
4.4. Different Key Formats¶
4.4.1. Hex-Encoded Secret¶
The secret parameter is a value used by the elliptic curve formula to compute the private key.
secret_parametersecret=decode_hex_digest<secret_parameter>("33cc7e35fbb78d17d207e53d0fe950d1db571be889b3ff87aec653e501759264");// The secret parameter is used to compute the private key// by the elliptic curve formula.elliptic_curve_keyprivkey;if(!privkey.set_secret(secret))log_error()<<"Error set private key.";
// Display the secret parameter.std::cout<<privkey.secret()<<std::endl;
4.4.2. Wallet Import Format¶
Wallet Import Format (WIF) is a way to encode the secret parameter to make copying the private key easier.
- std::string (const secret_parameter& secret)¶
Convert a secret parameter to the wallet import format. Returns an empty string on error.
std::stringwif=secret_to_wif(secret);if(wif.empty())// Error...
- secret_parameter (const std::string& wif)¶
Convert wallet import format key to secret parameter. Returns a nulled secret on error.
secret_parametersecret=wif_to_secret("5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ");if(secret==null_hash)// Error...
4.4.3. Casascius Minikey¶
Casascius coins encode private keys in a format known as Casascius minikey. converts a Casascius minikey to a secret parameter.
- secret_parameter (const std::string& minikey)¶
Convert Cascasius minikey to secret parameter. Returns a nulled secret on error.
secret_parametersecret=minikey_to_secret("S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy");if(secret==null_hash)// Error...

0 thoughts on “C++ generate bitcoin address”