EDIT: "how should I match the things to get xprv?" 
OK I got it... I just composed the HEX 'index+chain code+secret key' and 
then convert to base58. 

now I've got all the xpriv of all the M/0h , M/0h/0 , M/0h/1... 

 unfortunately when I try to re-build the chain the only correct address is 
the last change address (with its prv key) because it is the only address 
generated HD with the main M/0h/1,the other have been generated in another 
unknown way.

My opinion is that the main wallet address, main priv and pub keys are well 
correlated, but  the main chain code is missing and I cannot get it because 
the 12 words mnemonic is wrong / bit-flipped error ....and this was my last 
chance to find the main xpriv since the change address chain is corrupted.

I'm now in a blind way...

To andreas: could I send you the files in order you to verify/check?

Thanks
Stefano

Il giorno martedì 27 giugno 2017 10:22:27 UTC+2, Stefano Pieri ha scritto:
>
> yes, I agree that the code I attached seems to be the 0/1, but the 
> converted readable key of secret 
> bytes  "\247\031\222\016\377\......blabla............/"  is  a 64 char 
> string 
> "a719920effc3ec46e47871ae9f55d77c........................................" 
>  and not xprv.......
>
> how should I match the things to get xprv?
>
> Il giorno lunedì 26 giugno 2017 18:48:54 UTC+2, Andreas Schildbach ha 
> scritto:
>>
>> I think bitcoinj serializes the secret bytes for these hierarchies: 0, 
>> 0/0, 0/1. All the signing keys are derived on the fly, when needed for 
>> signing. 
>>
>> Actually the key you're quoting below should be an extended key. It's 
>> the parent of the internal keychain (which is used mostly for change 
>> addresses). 
>>
>>
>> On 06/26/2017 06:01 PM, Stefano Pieri wrote: 
>> > I wrote an octave script to convert the protobuf raw text into priv and 
>> > pub keys and I succeeded. 
>> > 
>> > <<my raw-dump file is very similar to this 
>> > one: 
>> http://grepcode.com/file/repo1.maven.org/maven2/org.bitcoinj/bitcoinj-core/0.12.1/org/bitcoinj/wallet/deterministic-wallet-serialization.txt>>
>>  
>>
>> > 
>> > Ok now I have many priv keys more  - but not the extended keys and I'm 
>> > little bit in confusion..., 
>> > 
>> > next, 
>> > since  I have the "hidden" info about the parents that generated the 
>> > main address list but also the change address list (already checked) 
>> > --see the following code-- path 1, with 18 subkeys... 
>> > key { 
>> >   type: DETERMINISTIC_KEY 
>> >   secret_bytes: 
>> > "\247\031\222\016\377\................blabla......................../" 
>> >   public_key: "\003 \341=\232?\203\363\355\022N\............ 
>> > blabla................................" 
>> >   deterministic_key { 
>> >     chain_code: 
>> > 
>> "d\271\001\203\327\362.\032\.............blabla................................."
>>  
>>
>> >     path: 2147483648 
>> >     path: 1 
>> >     issued_subkeys: 18 
>> >     lookahead_size: 100 
>> >   } 
>> > } 
>> > 
>> > since the BTC are in subkey #2....my question is how could I generate 
>> > the priv keys of the 'subs' starting from these keys.... 
>> > 
>> > I know "HMAC-SHA512(Parent_PublicKey + Parent_ChainCode + 
>> > Index)...blabla " but I don't know how to apply it.... 
>> > 
>> > could you ELI5? 
>> > 
>> > thx 
>> > 
>> > 
>> > 
>> > Il giorno venerdì 23 giugno 2017 13:07:53 UTC+2, Andreas Schildbach ha 
>> > scritto: 
>> > 
>> >     I believe what you're seeing is the protobuf text format, as 
>> created by 
>> >     this mehod in com.google.protobuf.ByteString: 
>> > 
>> >     public static String escapeBytes(ByteString input) 
>> > 
>> >     Escapes bytes in the format used in protocol buffer text format, 
>> which 
>> >     is the same as the format used for C string literals. All bytes 
>> that 
>> >     are 
>> >     not printable 7-bit ASCII characters are escaped, as well as 
>> backslash, 
>> >     single-quote, and double-quote characters. Characters for which no 
>> >     defined short-hand escape sequence is defined will be escaped using 
>> >     3-digit octal sequences. 
>> > 
>> >     If I'm right, you can convert that back into a byte string 
>> (basically 
>> >     byte array) using: 
>> > 
>> >     public static ByteString unescapeBytes(CharSequence charString) 
>> >                                     throws 
>> >     TextFormat.InvalidEscapeSequenceException 
>> > 
>> >     Un-escape a byte sequence as escaped using escapeBytes(ByteString). 
>> >     Two-digit hex escapes (starting with "\x") are also recognized. 
>> > 
>> > 
>> >     On 06/22/2017 11:05 AM, Stefano Pieri wrote: 
>> >     > I'm trying to restore a corrupted wallet (flip-bit error 
>> >     > https://github.com/bitcoinj/bitcoinj/issues/968 
>> >     <https://github.com/bitcoinj/bitcoinj/issues/968>) to read the 
>> priv 
>> >     keys 
>> >     > and get the BTC back. 
>> >     > 
>> >     > Unfortunately, with wallet-tool dump --dump-privkeys I get the 
>> >     dump file 
>> >     > with all the pub but just two priv keys readable. 
>> >     > 
>> >     > When I try with raw-dump option, the raw file has 11 
>> "secret_bytes: 
>> >     > XX\XXX\XX..." so I'm wondering if there is the possibility to 
>> convert 
>> >     > that hex/byte/base58 (?!?) format into something that could be 
>> >     readable? 
>> >     > 
>> >     > thanks, 
>> >     > Stefano 
>> >     > 
>> >     > -- 
>> >     > You received this message because you are subscribed to the 
>> Google 
>> >     > Groups "bitcoinj" group. 
>> >     > To unsubscribe from this group and stop receiving emails from it, 
>> >     send 
>> >     > an email to bitcoinj+u...@googlegroups.com 
>> >     > <mailto:bitcoinj+u...@googlegroups.com>. 
>> >     > For more options, visit https://groups.google.com/d/optout 
>> >     <https://groups.google.com/d/optout>. 
>> > 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> > Groups "bitcoinj" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> > an email to bitcoinj+u...@googlegroups.com 
>> > <mailto:bitcoinj+u...@googlegroups.com>. 
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to