from hashlib import sha256
import hashlib
version = "00000020"
previoushash = "823a1913f9e43541545befa600134906819ea60ecfe71e000000000000000000"
merkleroot = "f717f1770bfcf49e72e58f28f1b7c53247a8235933fea24823687655009265ec"
timestamp = "3983595c"
bits = "15683017"
nonce = "f2a164a0"
header = (str(version) + str(previoushash) + str(merkleroot) + str(timestamp) + str(bits) + str(nonce)).decode('hex')
print sha256(sha256(header).digest()).digest()[::-1].encode('hex')
for next block
version = "00000020"
OKprevioushash = "0000000000000000000a93736d47dbfecc769c598931b56a63f2c7547a700229" inversed
OKmerkle root = sha256(transaction(s))
OKtimestamp = in the future
OKbits = random
NO OKnonce = random
NO OKcreate new block possible with genesis :
python genesis.py -z "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" -n 2083236893 -t 1231006505