I know you're busy, but I have (hopefully) a quick question -- I'm trying to add an address to a wallet following the add 500k address in extras, but only adding 1 key (I took out the key reading loop and just used line = private key). I'm not doing it right because armoryqt.py gives me a checksum error on keys that were already in the wallet: line 3245, in unserialize '('+hash160_to_addrStr(self.addrStr20)+')' armoryengine.UnserializeError: Checksum mismatch in PrivateKey (1LMsGerE3FmWmJig6e5DpmjctFar6RVR2L)
import sys
sys.path.append('..')
from armoryengine import *
# Could use sys.argv but this script will be used, like, once. Hardcode it!
wltID = 'ydeMUhu' # this was the ID of the wallet I tested with
wltDir = 'ydeMUhu' # this was the ID of the wallet I tested with
wltfile = os.path.join(ARMORY_HOME_DIR, 'armory_%s_.wallet' % wltID)
wltfilebak = os.path.join(ARMORY_HOME_DIR, 'armory_%s_backup.wallet' % wltID)
if not os.path.exists(wltfile):
print 'ERROR: Wallet does not exist:', wltfile
exit(1)
# Remove the backup if it exists
if os.path.exists(wltfilebak):
os.remove(wltfilebak)
# If you don't delete the backup, Armory will think the primary wallet
# is corrupted and restore the backup
exampleEntry = hex_to_binary( \
'0047b8ad 0b1d6803 260ce428 d9e09e2c d99fd3b3 5947b8ad 0b1d6803 260ce428 '
'd9e09e2c d99fd3b3 59fb1670 0860fecd 00030000 00000000 00ffffff ffffffff '
'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ff71ca50 49feffff '
'ffffffff ffffffff ffffffff ff000000 00000000 00000000 00000000 005df6e0 '
'e2eeeeee eeeeeeee eeeeeeee eeeeeeee eeeeeeee eeeeeeee eeeeeeee eeeeeeee '
'eec93a79 dd04a706 ad8f7311 5f905002 66f273f7 571df942 9a4cfb4b bfbcd825 '
'227202da bad1ba3d 35c73aec 698af852 b327ba1c 24e11758 936bb632 2fe93d74 '
'69b182f6 6631727c 7072ffff ffff0000 00000000 00000000 0000ffff ffff0000 '
'0000 '.replace(' ',''))
wltOut = open(wltfile, 'ab')
rawAddrEntry = exampleEntry[21:]
addr20 = rawAddrEntry[:24]
fixed1 = rawAddrEntry[ 24:108]
prvkey = rawAddrEntry[ 108:144]
pubkey = rawAddrEntry[ 144:213]
fixed2 = rawAddrEntry[ 213:]
addrDataToWrite = []
line = "5KaPWnaXTLUdv5WdbwbiXbjDqUFXEUT1aAgSGrYHtzuGD5mooWv"
privBin = base58_to_binary(line[1:-4])
pubBin = CryptoECDSA().ComputePublicKey(SecureBinaryData(privBin)).toBinStr()
addr20 = hash160(pubBin)
# Pre-PyBtcAddr Entry Header
addrDataToWrite.append('\x00')
addrDataToWrite.append(addr20)
# PyBtcAddr itself
addrDataToWrite.append(addr20)
addrDataToWrite.append(computeChecksum(addr20))
addrDataToWrite.append(fixed1)
addrDataToWrite.append(privBin)
addrDataToWrite.append(computeChecksum(privBin))
addrDataToWrite.append(pubBin)
addrDataToWrite.append(computeChecksum(pubBin))
addrDataToWrite.append(fixed2)
wltOut.write(''.join(addrDataToWrite))
wltOut.close()
Any ideas?