Title: Attempting to create a 2 of 3 multi-sig address in C++ Post by: sdp on March 10, 2015, 05:42:56 PM I am attempting to create a 2 of 3 multi-sig address in C++. The example I am using is from http://www.soroushjp.com/2014/12/20/bitcoin-multisig-the-hard-way-understanding-raw-multisignature-bitcoin-transactions/ (http://www.soroushjp.com/2014/12/20/bitcoin-multisig-the-hard-way-understanding-raw-multisignature-bitcoin-transactions/). I generate the script okay with the keys provided. But when I generate the address, it is wrong.
Briefly in psuedocode I am trying to do this: We define intermediate with: intermediate = 5 concat ( ripemd( sha256( script_bytes ) ) ) Then the address is encodeBase58( intermediate concat sha256( sha256( intermediate ) )[0..3] ) Is this psuedocode wrong? Here is the C++ code: Code: hash_digest lh0 = generate_sha256_hash(calculated_script); ??? I am looking at this page and the code I have here, they look the same. The addresses do not match in the end though. Title: Re: Attempting to create a 2 of 3 multi-sig address in C++ Post by: sdp on March 11, 2015, 02:13:23 AM It turns out there is no SHA256 on the initial chunk of script bytes at all. Thanks for all who replied. For the rest of you, thanks for nothing. :D
Code: #include <bitcoin/bitcoin.hpp> Compile with "-lwallet -lboost_system -lcrypto -lbitcoin". |