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.
def i2w(integer):
"""Convert integer to 4 byte word in a string.
Will raise exception if overflows."""
#the < stands for little endian, and I for unsigned int
return struct.pack("
tmp = i2w(v) + p.decode('hex')[::-1] + m.decode('hex')[::-1] + i2w(t) + i2w(b) + i2w(n)
print(hash_two[::-1].encode('hex'))
#! /usr/bin/env python
# The Python Equivalent of http://pastebin.com/Ya3604J0
import hashlib
# This is the data from the 'genesis' block, see: http://blockexplorer.com/b/0
VERSION = 1
PREV_BLOCK = "0000000000000000000000000000000000000000000000000000000000000000"
MERKLE_ROOT = "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
TIMESTAMP = 1231006505
BITS = 486604799
NONCE = 2083236893
def _hex_word_from_integer(integer):
"""Convert integer to 4 byte word in a string.
Will raise exception if overflows."""
work = bin(integer)[2::].zfill(32)
if len(work) > 32:
raise(OverflowError(integer))
tmp = list()
while len(work) > 7:
part = work[:8]
work = work[8:]
char = chr(int(part, 2))
tmp.append(char)
return(''.join(tmp).encode('hex'))
def _hex_value_byteswap(hex_string):
"Swap the byte order in a hex string."
work = hex_string[::]
temp = list()
while len(work) > 1:
# Split string up in parts of two
part = work[0:2]
work = work[2::]
temp.append(part)
temp = temp[::-1] # reverse temp
return(''.join(temp))
def main():
# Building up the header
header = list()
header.append(_hex_word_from_integer(VERSION))
header.append(PREV_BLOCK)
header.append(MERKLE_ROOT)
header.append(_hex_word_from_integer(TIMESTAMP))
header.append(_hex_word_from_integer(BITS))
header.append(_hex_word_from_integer(NONCE))
# In place byteswap the items in the header list
for index in range(len(header)):
header[index] = _hex_value_byteswap(header[index])
# Generic information
header = ''.join(header).decode('hex')
print('sizeof(block_header) = %s' % len(header))
text = "Block header (in human readable hexadecimal representation): %s"
print(text % header.encode('hex'))
# The first hashing
hash = hashlib.sha256()
hash.update(header)
text = "Useless First Pass Checksum: %s"
text = text % _hex_value_byteswap(hash.hexdigest())
print(text)
# The second hashing
next = hash.digest()
hash = hashlib.sha256()
hash.update(next)
text = "Target Second Pass Checksum: %s"
text = text % _hex_value_byteswap(hash.hexdigest())
print(text)
if __name__ == '__main__':
main()
import hashlib
def i2w(integer):
"""Convert integer to 4 byte word in a string.
Will raise exception if overflows."""
work = bin(integer)[2::].zfill(32)
if len(work) > 32:
raise(OverflowError(integer))
tmp = list()
while len(work) > 7:
part = work[:8]
work = work[8:]
char = chr(int(part, 2))
tmp.append(char)
return(''.join(tmp))
if __name__ == '__main__':
# Contents of genesis block: http://blockexplorer.com/b/0
#"hash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
#"ver":1,
#"prev_block":"0000000000000000000000000000000000000000000000000000000000000000",
#"mrkl_root":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
#"time":1231006505,
#"bits":486604799,
#"nonce":2083236893,
#
hash = "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
# Try to reproduce the above hash with below data
v = 1
p = "0000000000000000000000000000000000000000000000000000000000000000"
m = "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
t = 1231006505
b = 486604799
n = 2083236893
tmp = i2w(v) + p.decode('hex') + m.decode('hex') + i2w(t) + i2w(b) + i2w(n)
one = hashlib.sha256()
one.update(tmp)
hash_one = one.digest()
two = hashlib.sha256()
two.update(hash_one)
hash_two = two.digest()
print(hash)
print(hash_two.encode('hex'))