Строка TX 3 грузится только до ================ RESTART: D:\0777777888-SIG-HACK\starthash.py ================
01000000000101881af1640424935b4f0c54c6fe9f5acd9750aa3b9bda50909a5b8f5da69ced8b0200
, а должна полностью грузится:
01000000000101881af1640424935b4f0c54c6fe9f5acd9750aa3b9bda50909a5b8f5da69ced8b02000000fdffffff0bc7670403000000001976a9146460c7b1069f32a7e5382266b364220f3f824ec688ac80234300000000001976a91485f4f96f3f991a3770face96abc0ca59965220fb88ac4b601800000000001976a9147bf1438d53b8d0a115203375b8a5f9ddcc0c520f88ac113c00000000000017a914742ce9c25e8bd7a30053ee164ca455bf6bd5a6f587a0860100000000001976a914ecd84afa213d4edb6ecb21542ce519ce3618bdaf88ac9e212a000000000017a91431e83e8b275717a102025822f7fab06b3c6f7ff987b01e0400000000001976a9140a5d69037c194b6aec0535825eb6ba508d97570d88ac20505300000000001976a914955db0cde749821c6f99934cc5c1232c636cf97d88ac30570500000000001976a91404139abd0c8f9cd51a8756c69379041fa14ed91488ac80e66a39000000001600145c1e9c33747070609ed2610a374eea857e427e68a08601000000000017a9140a3c23a5197a790e61b806ce702d4dec2ed4700b87024730440220381776b6b7d25f90bb8f078a213464fc2d6ae5834e3f79cb9032e5dd8f89f5ae02207bd3d9b5680241b0951ad61f4b041c5ee0698d5673e78fe54224ca753a8eb2cc012102109171217733e1afa913cb3e13d4582693045df2467e818ab1eba5ae2391f785c13f0a00
Код скрипта:
import hashlib
import txnUtils
import keyUtils
# 1 tx = "01000000011575f1aacac4f66f9cfecd6ea1ef272e8cb5ce33f5ae97d1fcf02cec774a82e0070000008b48304502204117f9f3173b915d03be6170d7af520bfa78d9d9fd35c829d974d3aaead09ae90221008a032016f639b730779945f7b5bedb3701a0645c1752c1b27fccc617019f172b014104ef09f65a570580ae9e33bea461b5d27bef90e521020f924c599a0d918f84c2781eb29f21d8985aefb919e1feccde73bea07edea0cd04b15e7c88a19e80df2dd0ffffffff01a7730100000000001976a91498dccb66b17e1efb1f0d2bba0446502f2625444488ac00000000"
# 2 tx = "0100000001ce1d31f342c1a8dea718ddbdacf4285a004826c879867b7f6a9afeb011d9944e090000006b4830450221008b3a30c3d59008b78fec7eadc57027e0d0d44c4863185e694c35e5f6dc1644a302206d40aab141fd115863a37ae84b6c415257fcdde4932fe6577fd5a4fde44ecd8d0121027abfc94d794e730a0998d3340a8d1709a7dda03c91afcb2502f9d1f1df8472e2ffffffff0f2f5721000000000017a914c954e25aa374e93f1cc688417f21a4ac573e4d6687f8f90300000000001976a91480ba4af478403cfbb84c3c741fd8872ed555ea6688accc031700000000001976a9146849026a6f88d2c30c853414f28a77fd654459f888ac38ef0401000000001976a9147f7452e58e78013a41e6c6a0254312c2204c010688ac302da2640000000017a914c9ae29c3b57bfdef6b2383881d910bb83a8de18f876cbcda010000000017a91443d3f240383f6927066d16e8f180c52d1d5fb5b8875300c9010000000017a9140c34fe0b3a7e6c47a5783bb57c919f697dea806387c0655200000000001976a914e35d5358209d7df82b256fb8a655da7225cc94ec88ac08b51500000000001976a91423166c8d8c53449d801c434f239dbc03151e24bd88ac705ff913000000001976a9142c3ee08ff583a18456546e16c3bab9d104f63a2988ac00c419270000000017a914237531266f96a2663cc1a4aeda7369055d287f1187b85808000000000017a91446d12ed7fe791f40096aad6f5b2eef6c3f0fdd488780c4600f0000000017a914ec3d0f813cda478bce976ef40cb778825b7a244a8730c11d00000000001976a9148014429be1d95ee7f1a6cb07acf5fcfee9d9f34d88ac42d96bdd000000001976a914a193a02eabdbe2348aee081e1447fcdd867429a288ac00000000"
<b># TX 3:</b>
tx = "01000000000101881af1640424935b4f0c54c6fe9f5acd9750aa3b9bda50909a5b8f5da69ced8b0200000000fdffffff0bc7670403000000001976a9146460c7b1069f32a7e5382266b364220f3f824ec688ac80234300000000001976a91485f4f96f3f991a3770face96abc0ca59965220fb88ac4b601800000000001976a9147bf1438d53b8d0a115203375b8a5f9ddcc0c520f88ac113c00000000000017a914742ce9c25e8bd7a30053ee164ca455bf6bd5a6f587a0860100000000001976a914ecd84afa213d4edb6ecb21542ce519ce3618bdaf88ac9e212a000000000017a91431e83e8b275717a102025822f7fab06b3c6f7ff987b01e0400000000001976a9140a5d69037c194b6aec0535825eb6ba508d97570d88ac20505300000000001976a914955db0cde749821c6f99934cc5c1232c636cf97d88ac30570500000000001976a91404139abd0c8f9cd51a8756c69379041fa14ed91488ac80e66a39000000001600145c1e9c33747070609ed2610a374eea857e427e68a08601000000000017a9140a3c23a5197a790e61b806ce702d4dec2ed4700b87024730440220381776b6b7d25f90bb8f078a213464fc2d6ae5834e3f79cb9032e5dd8f89f5ae02207bd3d9b5680241b0951ad61f4b041c5ee0698d5673e78fe54224ca753a8eb2cc012102109171217733e1afa913cb3e13d4582693045df2467e818ab1eba5ae2391f785c13f0a00"
m = txnUtils.parseTxn(tx)
e = txnUtils.getSignableTxn(m)
z = hashlib.sha256(hashlib.sha256(e.decode('hex')).digest()).digest()
z1 = z[::-1].encode('hex_codec')
z = z.encode('hex_codec')
s = keyUtils.derSigToHexSig(m[1][:-2])
pub = m[2]
print 'Signed TX is :', tx
print 'Signature (r, s pair) is :', s
print 'Public Key is :', pub
print ""
print "##################"
print ""
print 'Unsigned TX is :', e
print 'hash of message (z value) is :', z
print 'reversed z :', z1
Модуль который глючит:
Traceback (most recent call last):
File "D:\starthash.py", line 12, in
m = txnUtils.parseTxn(tx)
File "D:\txnUtils.py", line 36, in parseTxn
sigLen = int(script[0:2], 16)
ValueError: invalid literal for int() with base 16: ''
Версия Питона 2.712
Дополнения которые необхоимы для запуска крипта дотупны по сылке
https://github.com/shirriff/bitcoin-code
Еще нужно поставить будет ecdsa==0.16.1
Кусок кода который вылетает по ошибке из модуляя который глючит:
def parseTxn(txn):
first = txn[0:41*2]
scriptLen = int(txn[41*2:42*2], 16)
script = txn[42*2:42*2+2*scriptLen]
<b> sigLen = int(script[0:2], 16)</b>
sig = script[2:2+sigLen*2]
pubLen = int(script[2+sigLen*2:2+sigLen*2+2], 16)
pub = script[2+sigLen*2+2:]
assert(len(pub) == pubLen*2)
rest = txn[42*2+2*scriptLen:]
return [first, sig, pub, rest]
Прошу помочь.
Большушее спасибо !!!