hi,
here is sample minerd solved and I'm trying to duplicate
JSON protocol response:
{
"error": null,
"result": {
"target": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000",
"midstate": "2eab9f8470f5bb52c6ff06b5624c2075433e76009595424828d33fce5b41afb7",
"hash1": "000000000000000000000000000000000000000000000000000000
00000000000000008000000000000000000000000000000000000000000000000000010000",
"data": "00000001251c6f225f41c2308bb114e6450b2670a49a9134cc6d2ce700000b4400
00000021863d2ba9531e8d51176c58a8b18aaaa2362eef6841bf72761b3786257f4a674ec84e1
51a0e119a0000000000000080000000000000000000000000000000000000000000000000000
0000000000000000000000000000080020000"
},
"id": "1"
[2011-11-19 18:47:24] Proof: 000000006e778f00f9fe8d12b8ad2cce389
eb5b44c97261913eb7d13810261a2
Target: 00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff
TrgVal? YES (hash < target)
[2011-11-19 18:47:24] thread 1: 9645836 hashes, 488.45 khash/sec
[2011-11-19 18:47:24] DBG: sending RPC call: {"method": "getwork", "params":
[ "00000001251c6f225f41c2308bb114e6450b2670a49a9134cc6d2ce700000b440000
000021863d2ba9531e8d51176c58a8b18aaaa2362eef6841bf72761b3786257f4a674ec
84e151a0e119a0d2f93000000008000000000000000000000000000000000000000000
00000000000000000000000000000000000000080020000" ], "id":1}
how come this code:
import hashlib
header_hex = (
"01000000" +
"251c6f225f41c2308bb114e6450b2670a49a9134cc6d2ce700000b4400000000" +
"21863d2ba9531e8d51176c58a8b18aaaa2362eef6841bf72761b3786257f4a67" +
"4ec84e15".decode("hex")[::-1].encode("hex") +
"1a0e119a".decode("hex")[::-1].encode("hex") +
"0d2f9300".decode("hex")[::-1].encode("hex")
)
header_bin = header_hex.decode('hex')
hash = hashlib.sha256(hashlib.sha256(header_bin).digest()).digest()
hash.encode('hex_codec')
print hash[::-1].encode('hex_codec')
prints 3691175a7d3e2fcfa79d89781fce5615db1c9f2ab2fc422784fd9de9dcf00fa2
instead of 000000006e778f00f9fe8d12b8ad2cce389eb5b44c97261913eb7d13810261a2
thanks