Bitcoin Forum
October 31, 2024, 05:05:09 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Get master key from 128bit  (Read 122 times)
Sanka555 (OP)
Member
**
Offline Offline

Activity: 96
Merit: 36


View Profile
November 20, 2021, 02:24:14 PM
Last edit: November 20, 2021, 02:37:09 PM by Sanka555
 #1

i write in Java

when i get master key from bip-39 string i do this

Quote
byte [] seed = PBKDF2SHA512.derive (seedCode, "mnemonic", 2048, 64);
DeterministicKey deterministicKey = HDKeyDerivation.createMasterPrivateKey (seed);
...
...
this works fine.

please tell me
what I need to fix in these two lines, to get the master key (deterministicKey) if I do not have string bip-39 at the entrance
 i have only 128 bit number like this
10101010101010101011000 ...... (128 characters)
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1694
Merit: 8318


Bitcoin is a royal fork


View Profile WWW
November 20, 2021, 02:30:11 PM
 #2

What's the library? If the seedCode requires a seed phrase, then you should convert your 128-bit binary represented number to twelve words. If the seedCode requires an entropy then you should probably convert your binary represented number to hexadecimal or decimal.

It depends on what's seedCode and which type of parameter is the first one from PBKDF2SHA512.derive().

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Sanka555 (OP)
Member
**
Offline Offline

Activity: 96
Merit: 36


View Profile
November 20, 2021, 02:34:01 PM
 #3

library bitcoinj

I don't need to receive Seed. I need to get a master key (deterministicKey) from a 128-bit number
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1694
Merit: 8318


Bitcoin is a royal fork


View Profile WWW
November 20, 2021, 02:53:31 PM
 #4

Alright, so I just checked it. seedCode is supposed to be a string.

I don't need to receive Seed. I need to get a master key (deterministicKey) from a 128-bit number
So what you're asking is how to get the master private key from the 128-bit number (which is the string by the name seedCode)? Is that correct?

Because, here you say without the BIP-39 string at the entrance and I'm wondering on what you are referring:
what I need to fix in these two lines, to get the master key (deterministicKey) if I do not have string bip-39 at the entrance

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Sanka555 (OP)
Member
**
Offline Offline

Activity: 96
Merit: 36


View Profile
November 20, 2021, 03:09:12 PM
 #5

Quote
So what you're asking is how to get the master private key from the 128-bit number (which is the string by the name seedCode)? Is that correct?
yes  Smiley
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1694
Merit: 8318


Bitcoin is a royal fork


View Profile WWW
November 20, 2021, 03:17:34 PM
 #6

yes

And what's the BIP-39 entrance string?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Sanka555 (OP)
Member
**
Offline Offline

Activity: 96
Merit: 36


View Profile
November 20, 2021, 03:23:12 PM
 #7

yes

And what's the BIP-39 entrance string?
for example
"dumb merry course mouse salmon first six charge shoot slogan shiver rule"

BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1694
Merit: 8318


Bitcoin is a royal fork


View Profile WWW
November 20, 2021, 03:39:44 PM
Merited by nc50lc (1)
 #8

for example
"dumb merry course mouse salmon first six charge shoot slogan shiver rule"
So BIP-39 entrance is the seed phrase and seedCode is the variable that should contain the phrase, correct? So what you need is to convert your 128 bits to twelve words, right?

You should use MnemonicCode(). I haven't tried it, but it should be fairly easy. And that's true if I've understood properly what you want to achieve. If any of the above questions' conclusion is incorrect, let me know.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6309


Self-proclaimed Genius


View Profile
November 21, 2021, 02:10:26 AM
 #9

what I need to fix in these two lines, to get the master key (deterministicKey) if I do not have string bip-39 at the entrance
 i have only 128 bit number -snip-
I don't need to receive Seed. I need to get a master key (deterministicKey) from a 128-bit number
There's no shortcut to this since the entropy (128 bit number) needs to be a 'UTF-8 normalized' mnemonic before you can get the 'binary seed'.
You'll need to do the above to convert it into a mnemonic, then use the result to your code.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!