#include
#include
#include
using namespace bc;
payment_address create_multi_signature_address(const data_chunk& calculated_script) {
// generate address from script.
short_hash sh2 = generate_ripemd_hash(calculated_script);
data_chunk raw_address;
raw_address.push_back((unsigned char)5);
for (unsigned char c : sh2)
raw_address.push_back(c);
hash_digest check_sum_digest = generate_sha256_hash(raw_address);
for (int i = sha256_digest_size-1; i >= sha256_digest_size-4; --i) {
raw_address.push_back(check_sum_digest[i]);
}
return payment_address(encode_base58(raw_address));
}
Compile with "-lwallet -lboost_system -lcrypto -lbitcoin".