It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
std::cout <<"\nCoinbase: "<< txScriptSig <<"\nPubkeyScript: "<< pubScriptSig <<"\nMerkle Hash: "<< merkleHash <<"\nByteswapped: "<< merkleHashSw <<"\nGenerating block...\n\n";
unsigned char block_hash1[32];
#ifdef _MSC_VER
_declspec(align(16)) unsigned char block_hashfp[32];
#else
__attribute__((aligned(16))) unsigned char block_hashfp[32];
#endif
unsigned int counter=0, start = time(NULL);
int drift = 4;
__m128i r, m, b, camp;
__m128i zero = _mm_setzero_si128();
unsigned short turt;
while(1) {
SHA256((unsigned char*)&block_header, 80, block_hash1);
SHA256(block_hash1, 32, block_hashfp);
r = _mm_load_si128((__m128i *)block_hashfp);
m = _mm_load_si128((__m128i *)(block_hashfp+16));
switch (drift)
{
case 0:
break;
case 1:
b = _mm_alignr_epi8(m, r, 31);
break;
case 2:
b = _mm_alignr_epi8(m, r, 30);
break;
case 3:
b = _mm_alignr_epi8(m, r, 29);
break;
case 4:
b = _mm_alignr_epi8(m, r, 28);
break;
case 5:
b = _mm_alignr_epi8(m, r, 27);
break;
case 6:
b = _mm_alignr_epi8(m, r, 26);
break;
case 7:
b = _mm_alignr_epi8(m, r, 25);
break;
case 8:
b = _mm_alignr_epi8(m, r, 24);
break;
case 9:
b = _mm_alignr_epi8(m, r, 23);
break;
case 10:
b = _mm_alignr_epi8(m, r, 22);
break;
case 11:
b = _mm_alignr_epi8(m, r, 21);
break;
case 12:
b = _mm_alignr_epi8(m, r, 20);
break;
case 13:
break;
default:
break;
}
/*now it turns out like:
* Hashes 6018c18fcd4bfabb523f2ee1f6c18880f38135f3eb0ff1aa76acbc2fa94eb8ce
* And
* b 0000000000000000 000000006018c18f
*/
camp = _mm_cmpeq_epi8(b ,zero);
turt = _mm_movemask_epi8(camp);
if (turt == 0xffff)
{
std::reverse(block_hashfp,block_hashfp +32);
std::cout << "\nBlock found!\nHash: " << bin2hex(block_hashfp, 32) <<"\nNonce: " << block_header.startNonce << "\nUnix time: "<< block_header.unixtime << std::endl;
break;
}
if(time(NULL) - start > 0) {
std::cout << counter <<" Hashes/s, Nonce "<< block_header.startNonce<<'\r';
start = time((time_t *)(counter = 0));
}
if( ++block_header.startNonce == 0 ) block_header.unixtime++ ; //trick is that to change pre-start time to find a block(really it's smth else) faster then nonce wraps
counter++;
}
std::cout <<"\nCoinbase: "<< txScriptSig <<"\nPubkeyScript: "<< pubScriptSig <<"\nMerkle Hash: "<< merkleHash <<"\nByteswapped: "<< merkleHashSw <<"\nGenerating block...\n\n";
unsigned char block_hash1[32];
#ifdef _MSC_VER
_declspec(align(16)) unsigned char block_hashfp[32];
#else
__attribute__((aligned(16))) unsigned char block_hashfp[32];
#endif
unsigned int counter=0, start = time(NULL);
int drift = 4;
__m128i r, m, b, camp;
__m128i zero = _mm_setzero_si128();
unsigned short turt;
while(1) {
SHA256((unsigned char*)&block_header, 80, block_hash1);
SHA256(block_hash1, 32, block_hashfp);
r = _mm_load_si128((__m128i *)block_hashfp);
m = _mm_load_si128((__m128i *)(block_hashfp+16));
switch (drift)
{
case 0:
break;
case 1:
b = _mm_alignr_epi8(m, r, 31);
break;
case 2:
b = _mm_alignr_epi8(m, r, 30);
break;
case 3:
b = _mm_alignr_epi8(m, r, 29);
break;
case 4:
b = _mm_alignr_epi8(m, r, 28);
break;
case 5:
b = _mm_alignr_epi8(m, r, 27);
break;
case 6:
b = _mm_alignr_epi8(m, r, 26);
break;
case 7:
b = _mm_alignr_epi8(m, r, 25);
break;
case 8:
b = _mm_alignr_epi8(m, r, 24);
break;
case 9:
b = _mm_alignr_epi8(m, r, 23);
break;
case 10:
b = _mm_alignr_epi8(m, r, 22);
break;
case 11:
b = _mm_alignr_epi8(m, r, 21);
break;
case 12:
b = _mm_alignr_epi8(m, r, 20);
break;
case 13:
break;
default:
break;
}
/*now it turns out like:
* Hashes 6018c18fcd4bfabb523f2ee1f6c18880f38135f3eb0ff1aa76acbc2fa94eb8ce
* And
* b 0000000000000000 000000006018c18f
*/
camp = _mm_cmpeq_epi8(b ,zero);
turt = _mm_movemask_epi8(camp);
if (turt == 0xffff)
{
std::reverse(block_hashfp,block_hashfp +32);
std::cout << "\nBlock found!\nHash: " << bin2hex(block_hashfp, 32) <<"\nNonce: " << block_header.startNonce << "\nUnix time: "<< block_header.unixtime << std::endl;
break;
}
if(time(NULL) - start > 0) {
std::cout << counter <<" Hashes/s, Nonce "<< block_header.startNonce<<'\r';
start = time((time_t *)(counter = 0));
}
if( ++block_header.startNonce == 0 ) block_header.unixtime++ ; //trick is that to change pre-start time to find a block(really it's smth else) faster then nonce wraps
counter++;
}
def parse_element(hex_str, offset, element_size):
"""
:param hex_str: string to parse the element from.
:type hex_str: hex str
:param offset: initial position of the object inside the hex_str.
:type offset: int
:param element_size: size of the element to extract.
:type element_size: int
:return: The extracted element from the provided string, and the updated offset after extracting it.
:rtype tuple(str, int)
"""
return hex_str[offset:offset+element_size], offset+element_size
def dissect_signature(hex_sig):
"""
Extracts the r, s and ht components from a Bitcoin ECDSA signature.
:param hex_sig: Signature in hex format.
:type hex_sig: hex str
:return: r, s, t as a tuple.
:rtype: tuple(str, str, str)
"""
offset = 0
# Check the sig contains at least the size and sequence marker
assert len(hex_sig) > 4, "Wrong signature format."
sequence, offset = parse_element(hex_sig, offset, 2)
# Check sequence marker is correct
assert sequence == '30', "Wrong sequence marker."
signature_length, offset = parse_element(hex_sig, offset, 2)
# Check the length of the remaining part matches the length of the signature + the length of the hashflag (1 byte)
assert len(hex_sig[offset:])/2 == int(signature_length, 16) + 1, "Wrong length."
# Get r
marker, offset = parse_element(hex_sig, offset, 2)
assert marker == '02', "Wrong r marker."
len_r, offset = parse_element(hex_sig, offset, 2)
len_r_int = int(len_r, 16) * 2 # Each byte represents 2 characters
r, offset = parse_element(hex_sig, offset, len_r_int)
# Get s
marker, offset = parse_element(hex_sig, offset, 2)
assert marker == '02', "Wrong s marker."
len_s, offset = parse_element(hex_sig, offset, 2)
len_s_int = int(len_s, 16) * 2 # Each byte represents 2 characters
s, offset = parse_element(hex_sig, offset, len_s_int)
# Get ht
ht, offset = parse_element(hex_sig, offset, 2)
assert offset == len(hex_sig), "Wrong parsing."
return r, s, ht
example_sig = None # insert_sig_here
r, s, ht = dissect_signature(example_sig)
print "r: %s\ns: %s\nht: %s\n" % (r, s, ht)
for (int i=0; i{
sum1 += data[i+0];
sum2 += data[i+1];
sum3 += data[i+2];
sum4 += data[i+3];
}
sum = sum1 + sum2 + sum3 + sum4;