<<< prev block              block 332200              next block >>>

+------------------------------------------------------------------+
| THIBA - Things/Texts Hidden In Bitcoin Addresses      readme >>> |
+------------------------------------------------------------------+
| hash160                                  | decoded text          |
+------------------------------------------------------------------+

+------------------------------------------------------------------+
| 322a611420e5a0aeefae17ae6e9c017778dea16ee1c1643adffdda40a1063def |
+------------------------------------------------------------------+
| 696d706f7274206f730a696d706f727420686173 | import os import has
| 686c69620a232052657475726e73207468652068 | hlib # Returns the h
| 617368206f66206120626c6f636b2c2062617365 | ash of a block, base
| 64206f6e20636f64652066726f6d20456c656374 | d on code from Elect
| 72756d20312e39782e2028456c65637472756d27 | rum 1.9x. (Electrum'
| 7320626974636f696e2e70792c20626c6f636b63 | s bitcoin.py, blockc
| 6861696e2e70792c20474e552047504c20332c20 | hain.py, GNU GPL 3,
| 2068747470733a2f2f6769746875622e636f6d2f | https://github.com/
| 737065736d696c6f2f656c65637472756d290a23 | spesmilo/electrum) #
| 204e6565647320626c6f636b636861696e5f6865 | Needs blockchain_he
| 61646572732066696c6520666f756e6420617420 | aders file found at
| 687474703a2f2f686561646572732e656c656374 | http://headers.elect
| 72756d2e6f72672f626c6f636b636861696e5f68 | rum.org/blockchain_h
| 6561646572730a23206173682c20323031342d31 | eaders # ash, 2014-1
| 312d33300a0a646566207368613235362878293a | 1-30 def sha256(x):
| 0a2020202072657475726e20686173686c69622e | return hashlib.
| 7368613235362878292e64696765737428290a0a | sha256(x).digest()
| 0a64656620686173682878293a0a202020206966 | def hash(x): if
| 207479706528782920697320756e69636f64653a | type(x) is unicode:
| 2078203d20782e656e636f646528277574662d38 | x = x.encode('utf-8
| 27290a2020202072657475726e20736861323536 | ') return sha256
| 28736861323536287829290a0a0a646566207265 | (sha256(x)) def re
| 765f6865782873293a0a2020202072657475726e | v_hex(s): return
| 20732e6465636f6465282768657827295b3a3a2d | s.decode('hex')[::-
| 315d2e656e636f6465282768657827290a0a0a64 | 1].encode('hex') d
| 656620696e745f746f5f68657828692c206c656e | ef int_to_hex(i, len
| 6774683d31293a0a2020202073203d2068657828 | gth=1): s = hex(
| 69295b323a5d2e72737472697028274c27290a20 | i)[2:].rstrip('L')
| 20202073203d20223022202a202832202a206c65 | s = "0" * (2 * le
| 6e677468202d206c656e28732929202b20730a20 | ngth - len(s)) + s
| 20202072657475726e207265765f686578287329 | return rev_hex(s)
| 0a0a0a646566206865616465725f746f5f737472 | def header_to_str
| 696e6728726573293a0a2020202073203d20696e | ing(res): s = in
| 745f746f5f686578287265732e67657428277665 | t_to_hex(res.get('ve
| 7273696f6e27292c203429205c0a202020202020 | rsion'), 4) \
| 20202b207265765f686578287265732e67657428 | + rev_hex(res.get(
| 27707265765f626c6f636b5f6861736827292920 | 'prev_block_hash'))
| 5c0a20202020202020202b207265765f68657828 | \ + rev_hex(
| 7265732e67657428276d65726b6c655f726f6f74 | res.get('merkle_root
| 272929205c0a20202020202020202b20696e745f | ')) \ + int_
| 746f5f68657828696e74287265732e6765742827 | to_hex(int(res.get('
| 74696d657374616d702729292c203429205c0a20 | timestamp')), 4) \
| 202020202020202b20696e745f746f5f68657828 | + int_to_hex(
| 696e74287265732e676574282762697473272929 | int(res.get('bits'))
| 2c203429205c0a20202020202020202b20696e74 | , 4) \ + int
| 5f746f5f68657828696e74287265732e67657428 | _to_hex(int(res.get(
| 276e6f6e63652729292c2034290a202020207265 | 'nonce')), 4) re
| 7475726e20730a0a0a646566206865616465725f | turn s def header_
| 66726f6d5f737472696e672873293a0a20202020 | from_string(s):
| 6865785f746f5f696e74203d206c616d62646120 | hex_to_int = lambda
| 733a20696e742827307827202b20735b3a3a2d31 | s: int('0x' + s[::-1
| 5d2e656e636f6465282768657827292c20313629 | ].encode('hex'), 16)
| 0a20202020686173685f656e636f6465203d206c | hash_encode = l
| 616d62646120783a20785b3a3a2d315d2e656e63 | ambda x: x[::-1].enc
| 6f6465282768657827290a2020202068203d207b | ode('hex') h = {
| 7d0a20202020685b2776657273696f6e275d203d | } h['version'] =
| 206865785f746f5f696e7428735b303a345d290a | hex_to_int(s[0:4])
| 20202020685b27707265765f626c6f636b5f6861 | h['prev_block_ha
| 7368275d203d20686173685f656e636f64652873 | sh'] = hash_encode(s
| 5b343a33365d290a20202020685b276d65726b6c | [4:36]) h['merkl
| 655f726f6f74275d203d20686173685f656e636f | e_root'] = hash_enco
| 646528735b33363a36385d290a20202020685b27 | de(s[36:68]) h['
| 74696d657374616d70275d203d206865785f746f | timestamp'] = hex_to
| 5f696e7428735b36383a37325d290a2020202068 | _int(s[68:72]) h
| 5b2762697473275d203d206865785f746f5f696e | ['bits'] = hex_to_in
| 7428735b37323a37365d290a20202020685b276e | t(s[72:76]) h['n
| 6f6e6365275d203d206865785f746f5f696e7428 | once'] = hex_to_int(
| 735b37363a38305d290a2020202072657475726e | s[76:80]) return
| 20680a0a0a64656620726561645f686561646572 | h def read_header
| 2866696c656e616d652c20626c6f636b5f686569 | (filename, block_hei
| 676874293a0a202020206966206f732e70617468 | ght): if os.path
| 2e6578697374732866696c656e616d65293a0a20 | .exists(filename):
| 2020202020202066203d206f70656e2866696c65 | f = open(file
| 6e616d652c2027726227290a2020202020202020 | name, 'rb')
| 662e7365656b28626c6f636b5f68656967687420 | f.seek(block_height
| 2a203830290a202020202020202068203d20662e | * 80) h = f.
| 72656164283830290a2020202020202020662e63 | read(80) f.c
| 6c6f736528290a20202020202020206966206c65 | lose() if le
| 6e286829203d3d2038303a0a2020202020202020 | n(h) == 80:
| 2020202068203d206865616465725f66726f6d5f | h = header_from_
| 737472696e672868290a20202020202020202020 | string(h)
| 202072657475726e20680a0a0a64656620686173 | return h def has
| 685f68656164657228686561646572293a0a2020 | h_header(header):
| 202072657475726e207265765f68657828686173 | return rev_hex(has
| 68286865616465725f746f5f737472696e672868 | h(header_to_string(h
| 6561646572292e6465636f646528276865782729 | eader).decode('hex')
| 292e656e636f646528276865782729290a0a0a69 | ).encode('hex')) i
| 66205f5f6e616d655f5f203d3d20275f5f6d6169 | f __name__ == '__mai
| 6e5f5f273a0a2020202066696c656e616d65203d | n__': filename =
| 2027626c6f636b636861696e5f68656164657273 | 'blockchain_headers
| 270923207767657420687474703a2f2f68656164 | ' # wget http://head
| 6572732e656c65637472756d2e6f72672f626c6f | ers.electrum.org/blo
| 636b636861696e5f686561646572730a20202020 | ckchain_headers
| 68203d20726561645f6865616465722866696c65 | h = read_header(file
| 6e616d652c2030290a0a202020207072696e7420 | name, 0) print
+------------------------------------------------------------------+