New answers tagged

0

Hope this helps..... Had to make slight modifications to the ParseHex() provided by Andrew Chow.... Headers needed are: #include <string> #include <cstring> #include <assert.h> // assert() is used Sha256 implementation in use is the one provided by Zedwood !! First is the ParseHex function provided by Andrew Chow std::string ParseHex(std::...


0

My answer from this thread should help. Had a lot of help from Andrew Chow.. I assume you already know the whole endian swapping mess in bitcoin... Hope this helps you or anyone else. Cheers!!!


0

This thread should give you a direct working answer. Had a lot of help from Andrew Chow.. Hope this helps you or anyone else. Cheers!!!


0

Alright so it's been quite a ride on this specific task but Thanks to Andrew Chow there's finally a working version that I know a lot of newbies and even intermediate developers & programmers will surely find useful. Had to make slight modifications to the ParseHex() provided by Andrew Chow.... Headers needed are: #include <string> #include <...


2

Note that I am analyzing your code as if I compiled it as is. That means anything that is commented out is ignored. The first major issue is this line: kk = GetBinaryStringFromHexString(char_ToString(hash2)); // convert data to binary format The earlier final(hash); will have produced a char array filled with the SHA256 hash as binary data. Thus there ...


0

This would probably be more suitable asked on Cryptography StackExchange. I think that SHA256() is preferred over the _CTX, _Init, _Update, _Final functions. IIRC, these latter "low-level" functions are deprecated for external usage: SHA256 low level APIs are deprecated for public use, but still ok for internal use. Source 1, Source 2. The ...


0

As noted above, you should take the first 80 bytes from the serialized block. Since this data is hex-encoded, and each byte takes two hex-digit to encode, a block header is 80 * 2 = 160 digits. You will notice that a few fields are inverted, it's because they are represented in little-endian format. Once you double-sha256 this data, you'll find a hash with ...


Top 50 recent answers are included