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.
hash160 <<< 3, BLOCK_SIZE >>>(dev_pattern, dev_out, dev_nonce);
hash160 <<< 3, BLOCK_SIZE >>>(dev_pattern, dev_out, dev_nonce);
__global__ void hash160(char *pattern, unsigned char *out, uint32_t *nonce)
hash160(dev_pattern, dev_out, dev_nonce);
uint32_t index = blockIdx.x * blockDim.x + threadIdx.x;
#include
#include
#include
#include
#include
#include
#define BLOCK_SIZE 1024
__global__ void hash160(char *pattern, unsigned char *out, uint32_t *nonce)
{
uint32_t index = blockIdx.x * blockDim.x + threadIdx.x;
unsigned char hash[SHA256_DIGEST_LENGTH];
char str[64];
for (int i = 0; i < 9; i++) {
str[i] = pattern[i];
}
for (uint32_t i = *nonce; i < UINT32_MAX; i += gridDim.x * blockDim.x) {
sprintf(&str[9], "%08x", i);
SHA256((const unsigned char*)str, strlen(str), hash);
RIPEMD160(hash, SHA256_DIGEST_LENGTH, &out[index * 20]);
if (out[index * 20] == 0x00 && out[index * 20 + 1] == 0x00) {
// Found a match!
*nonce = i;
break;
}
}
}
int main()
{
char pattern[10] = "1abcdefg"; // 9 characters pattern
// Allocate memory on the host
unsigned char *out = new unsigned char[3 * 20];
uint32_t *nonce = new uint32_t;
*nonce = 0;
// Allocate memory on the device
char *dev_pattern;
unsigned char *dev_out;
uint32_t *dev_nonce;
cudaMalloc((void**)&dev_pattern, 10);
cudaMalloc((void**)&dev_out, 3 * 20);
cudaMalloc((void**)&dev_nonce, sizeof(uint32_t));
// Copy input data to the device
cudaMemcpy(dev_pattern, pattern, 10, cudaMemcpyHostToDevice);
cudaMemcpy(dev_out, out, 3 * 20, cudaMemcpyHostToDevice);
cudaMemcpy(dev_nonce, nonce, sizeof(uint32_t), cudaMemcpyHostToDevice);
// Launch the kernel
hash160 << < 3, BLOCK_SIZE >> >(dev_pattern, dev_out, dev_nonce);
// Copy output data from the device
cudaMemcpy(out, dev_out, 3 * 20, cudaMemcpyDeviceToHost);
cudaMemcpy(nonce, dev_nonce, sizeof(uint32_t), cudaMemcpyDeviceToHost);
// Print the results
for (int i = 0; i < 3; i++) {
std::cout << "Address " << i + 1 << ": " << std::setbase(16);
for (int j = 0; j < 20; j++) {
std::cout << std::setw(2) << std::setfill('0') << (int)out[i * 20 + j];
}
std::cout << std::endl;
}
std::cout << "Nonce: " << *nonce << std::endl;
// Free memory
delete[] out;
delete nonce;
cudaFree(dev_pattern);
cudaFree(dev_out);
cudaFree(dev_nonce);
return 0;
}