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+unsubscr...@googlegroups.com > <mailto:bitcoinj+unsubscr...@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.