thank you, etotheipi, I stand corrected. I wanted to help too quickly last night
And yes, I am reverse engineering the shit out of the Armory code, tx files and wallets since several weeks lately, I hope I can present soon what for
I took another 30 mins and wrote a (now tested and working) import function in PHP:
{
$nc = array(' '=>'',
'a'=>'0', 's'=>'1', 'd'=>'2', 'f'=>'3',
'g'=>'4', 'h'=>'5', 'j'=>'6', 'k'=>'7',
'w'=>'8', 'e'=>'9', 'r'=>'a', 't'=>'b',
'u'=>'c', 'i'=>'d', 'o'=>'e', 'n'=>'f');
foreach($nc as $easy16 => $normal) {
$root_id = str_replace($easy16, $normal, $root_id);
$root_data = str_replace($easy16, $normal, $root_data);
}
$sign = gmp_strval(gmp_and(gmp_init(substr($root_id, 0, 2), 16), gmp_init('80', 16))) ? '03' : '02';
$x_coord = substr($root_data, 0, 32).substr($root_data, 36, 32);
$rootpubkey = BitcoinLib::decompress_public_key($sign.$x_coord);
$chaincode = substr($root_data, 72, 32).substr($root_data, 108, 32);
return array('rootpubkey' => $rootpubkey['public_key'],
'chaincode' => $chaincode);
}
You can use it like this now:
$root_data = "kgei aokr eira ghst dfod utdf djte trot wggjtaiu grfr autk idre tugh sodi dwuk ffww sesnkoet hfgk tjhj kawf geds wgrn ehtt wofo fitakght nsgh ttet ntia gggk tjod unuk dgaw dahj";
$wallet = import_watchonly_wallet($root_id, $root_data);
$chaincode = $wallet['chaincode'];
$pubkey = $wallet['rootpubkey'];
for($i = 0; $i < 10; $i++) {
$pubkey = compute_chained_pubkey($pubkey, $chaincode);
echo BitcoinLib::public_key_to_address($pubkey, '00');
echo "\n";
}
which actually spits out now
14xUP1ZxeTdNLHuAVwKSqvgotBBo1KT59W
1Hv1PQD8n1fxdn7o8tsKjb4rrypWZWD3o4
18wrjH3VEs4LHAvPEbsvGjuCHvYunTZTfa
1GaEQsNjwiuT5W8eXjnnuR433Y2ZskNVhD
1PUrFjaV1vymvQtz4j1EePXfKAYpZUyCTV
19R5Jj4CHuWy7gozxBeHAvTAqmVtpCj4xL
1AYpG5z7fH2pKTWnujnr9iwkBSromdNxZv
1FZbWDL3qwm9HncqdMKdsNmpkBUifvVtem
16Wafgea7vyJAoqgzqDv1g1USMaj8Ms1PW
Have fun!
Btw, I would generate the rootpubkey and chaincode only once and store it somehow, then. You also do not have to start the generation again beginning with the root pubkey, just always store the last used pubkey and generate more from that point, this saves computation time.