hi,
i have a problem with deriving the chaincode from the root key in my own code, i tried different private keys differently in c, php and python and i always get the same digest, but that digest does not fit the provided chaincode in the wallet generated by armory which i am checking against.
as far as i understand, i simply get it like that:
hmac_sha256( key=sha256(sha256(ROOTKEY)) , ascii_message="Derive Chaincode from Root Key")
basically, i can treat the message the same as hex
0x44657269766520436861696E636F64652066726F6D20526F6F74204B6579
right? however, i tried it both as char * and uint8_t *.
let my example be:
ROOTKEY = 0xC263A3ED1351B0E07D57B788688C3BD8EA0DE54788739093880AAEC2DFF21BCF
hash256(ROOTKEY) = 0xa7941f148f0537ddb2794c923a9ef15a9eada511f7ee5aad851e86ecb86d3b0a (yes, its double-hashed)
all my sample programs, including the following python-script (sry, i really suck at python), deliver me
chaincode = 0x52c4ec3cd49b4af3c944f498e8d08fce2f3c432687408577ff6ae307d9ef1e6f
while the wallet file says the actual chaincode is
chaincode_wallet = 0x90CED6C81A642182660C91A0418CDAF1165AE311378A3862723AED81D48A767E
can someone please elaborate what i am getting wrong?
thanks
inf
python code:
#!/usr/local/bin/python2.7
import hmac
import hashlib
k = bytearray([0xa7,0x94,0x1f,0x14,0x8f,0x05,0x37,0xdd,0xb2,0x79,0x4c,0x92,0x3a,0x9e,0xf1,0x5a,0x9e,0xad,0xa5,0x11,0xf7,0xee,0x5a,0xad,0x85,0x1e,0x86,0xec,0xb8,0x6d,0x3b,0x0a]);
x = hmac.new(k, "Derive Chaincode from Root Key", hashlib.sha256);
print x.hexdigest()
edit: i am using armory 0.92.1, generating wallets version 1.35.