Bitcoin Forum
May 04, 2024, 05:46:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Can I get seed from brain wallet in Java?  (Read 118 times)
Sanka555 (OP)
Member
**
Offline Offline

Activity: 96
Merit: 36


View Profile
November 13, 2021, 08:33:32 AM
Last edit: November 13, 2021, 08:43:40 AM by Sanka555
 #1

I am using Java and trying to repeat the trick from brain2bip.com

I already know how to get addresses from the brain wallet
I already know how to get addresses from a seed-phrase

but how to get a seed from an ordinary word?
there is open source how the site does it but I don't understand JS(

I will be very grateful for any help


PS: and will there be any connection between the addresses obtained from the brain wallet and the addresses obtained from the seed-phrase obtained from the brain wallet?
1714801587
Hero Member
*
Offline Offline

Posts: 1714801587

View Profile Personal Message (Offline)

Ignore
1714801587
Reply with quote  #2

1714801587
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714801587
Hero Member
*
Offline Offline

Posts: 1714801587

View Profile Personal Message (Offline)

Ignore
1714801587
Reply with quote  #2

1714801587
Report to moderator
PawGo
Legendary
*
Offline Offline

Activity: 952
Merit: 1367


View Profile
November 13, 2021, 08:45:53 AM
Merited by ABCbits (1)
 #2

Hi,

I am not sure do what you want - to restore seed for a given address/priv key (so you will convert brainwallet -> key -> seed)?
It could be done that way: https://medium.com/geekculture/cryptocurrency-911-how-does-12-word-seed-phrase-work-9d892de9732

Operations are simple and you will encode it in any language without any problems I guess, just the matter of number of words.
Sanka555 (OP)
Member
**
Offline Offline

Activity: 96
Merit: 36


View Profile
November 13, 2021, 09:02:30 AM
 #3

thank you very much for the example. The most important question:

1) This site takes the word. Makes seed-phrase. Seed can be inserted into electrum and get addresses

2) I take the same word. I make a brain wallet out of it (without a seed). I get several types of addresses.


The question is: will the addresses in the first and second cases be somehow connected?
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1512
Merit: 7342


Farewell, Leo


View Profile
November 13, 2021, 09:27:38 AM
Merited by pooya87 (2), ABCbits (1), Charles-Tim (1)
 #4

but how to get a seed from an ordinary word?
Think simply. What's a seed phrase? An entropy of x bits. A twenty four words seed phrase is a representation of 256 ones and zeros (plus 8 which are calculated from those 256). So, in order to get a seed from a word, you'll have to get 256 bits from that word. To do that, you could just hash it.

That's what they're doing in that website. Hash the word “apple” with SHA256 and you'll get:
Code:
3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b

Use the word “apple” as a brain passphrase, and you'll get the same entropy:
Code:
3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b

The site just converts the entropy into words: (Based on BIP-39)
Code:
usage drastic muscle brave attack ridge legal layer party sample mango refuse

(12, 15, 18 and 21 words require less than 256 bits, so it just removes characters from the 256-bit hash)

The question is: will the addresses in the first and second cases be somehow connected?
If I understand correctly, you write a word, the site gives you the seed phrase which was calculated by the hash of that word, you then import it into Electrum and get addresses. Now you take the word and create a brain wallet from a website such as brainwalletx.

No, they won't have any connection at all.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Sanka555 (OP)
Member
**
Offline Offline

Activity: 96
Merit: 36


View Profile
November 13, 2021, 09:36:53 AM
 #5

thank you very much  Smiley
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1512
Merit: 7342


Farewell, Leo


View Profile
November 13, 2021, 12:53:12 PM
 #6

No, they won't have any connection at all.

To be more precise: There won't be any connection if you never share with anyone either the brainwallet's private key or the seed phrase.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
PawGo
Legendary
*
Offline Offline

Activity: 952
Merit: 1367


View Profile
November 13, 2021, 02:05:17 PM
 #7

I think the question was if user receive the same address using both seed and brainwallet. And then yes, as both point to the same private key.
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1512
Merit: 7342


Farewell, Leo


View Profile
November 13, 2021, 02:17:34 PM
Merited by ABCbits (1), PawGo (1)
 #8

I think the question was if user receive the same address using both seed and brainwallet. And then yes, as both point to the same private key.

They don't point to the same private key. The brainwalletx will give you an address whose private key will be the hash of your word and the other will give you private keys whose master private keys' entropy will be the hash of the word.

With brainwalletx and the entropy I used above, we get this:
Code:
1HmwnvKYDQX1qr5UJxMbMP69RizXQSNV85

But, by deriving the addresses of that entropy (BIP32) we get:
Code:
path,address,public key,private key
m/0/0,1BXzAYeGfAfukysx9u3jNVmDHotuvC7c56,,
m/0/1,1A6FVYA9HK16dUG5HFoXe86uYwYL7CoDCt,,
m/0/2,166CEjEnx4YG5wcbrVjZfaN6iuAHrvvqet,,
m/0/3,1CAThBwUATTKM76qYA2DyRNApRqGcoywC4,,
m/0/4,1Nna3pcMqgzzF68WFnfX16942eTGQQNYcu,,
m/0/5,1F2FAkokmpZeSMiuN5dUB3CDux9fht5ysK,,
m/0/6,187UUwEq8VLp1Gk1ujymZEBmS722F26WA8,,
m/0/7,18P22y4bNYn5RzDaJ6AaxVKEKMXP9huo5q,,
m/0/8,13btapJMLaHDpasQNHuQYtTGbpWkSdYZY1,,
m/0/9,1FP3HcDkes9hPcMjx4oLaSC4xXHn5D4wDC,,
m/0/10,15HJWVG8g7EKzqRkhE8RiHkGP7a28jR4r6,,
m/0/11,1EfDjyuK4Kme7w6X5Y3ag9L2tqsNgLCffh,,
m/0/12,1NDkwp2rVQQmBhiXfXiytsjRuaPvwmGGvW,,
m/0/13,182EqE96vc9DA93j6qdJrYT9PKw4bLjYir,,
m/0/14,1PbDazL1vk2asbX275k7ZBRF8XXYThLWob,,
m/0/15,1CBDtNjz5oyyrHanBwrNxXSKsBREr7w6cz,,
m/0/16,1CUm963uvpc9vjnYGNHaSnMHf7MSzaMCQZ,,
m/0/17,1AQ5F9LRg6HPe93Ws9rH4tCHCCFyZYvkiz,,
m/0/18,14uiQMBA9nMhyUhBcAjygmSc4LTs2ezrui,,
m/0/19,1H4vTaFXZwWSpgGXzVmWPxg5keg86XD81W,,

They don't have any connection unless you reveal the entropy.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
PawGo
Legendary
*
Offline Offline

Activity: 952
Merit: 1367


View Profile
November 13, 2021, 02:47:09 PM
 #9


They don't point to the same private key. The brainwalletx will give you an address whose private key will be the hash of your word and the other will give you private keys whose master private keys' entropy will be the hash of the word.


Yes, right - the difference is how you retrieve address from private key. One way it is "direct", other way "indirect" as you create children using additional algorithm.
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3214



View Profile
November 15, 2021, 04:00:48 AM
Last edit: November 15, 2021, 04:12:09 AM by odolvlobo
 #10

but how to get a seed from an ordinary word?

The brain wallet's private key is typically the result of a SHA-256 operation on the passphrase. The seed phrase would be a conversion of the SHA-256 result according to BIP-39. The seed is then the result of a cryptographic operation on the seed phrase.

https://en.bitcoin.it/wiki/BIP_0039

and will there be any connection between the addresses obtained from the brain wallet and the addresses obtained from the seed-phrase obtained from the brain wallet?

There is no way for anyone to tell that the brain wallet address and the BIP-32 addresses are related without knowing (or guessing) the passphrase.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
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!