-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change --use_master_seed default: to False! #2514
base: py3
Are you sure you want to change the base?
Conversation
#2512 If anyone need to use a master_seed to generate private keys for sites in a range, than that person should use the config parameter --use_master_seed True. By default all user should backup private keys instead of generating a few million key in a limited private key space between 0x1 and 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140. While using a seed is good if any of the addresses get compromised from the range of generated private keys an attacker can compromise all and every site generated using that seed! So, generate a new randomly-selected private key for each new address and let the user practice backing up private keys.
@imachug @HelloZeroNet https://raw.githubusercontent.com/AbdussamadA/electrum-xprv/master/xprv.py
@imachug : |
And now for something completely different: private keys are generated in the same range without master_seed. |
Please elaborate on how this attack could be performed. AFAIK BIP32 was created to have a single private key that can't be compromised if any derived key is stolen. |
@imachug |
Huh, if you think the private key is generated as |
10000 was just an example. I can use a hybrid quantum computer at https://www.dwavesys.com to run a python code and generate 100,000,000 private keys in a given range in a few minutes. With 64 GB RAM is also just a few hour really. Overall, this pull request should be merged and the use of master_seed should be "False" by default. |
Again, the private keys are not in a given range, they are almost random. Think of BIP32 as of a deterministic random key generator. |
I'm not in favor of BIP32 because keys are related to each other in a way which is dangerous. Any private key which exposed in BIP32 helps attacker determinate the location of the range and so the other private keys. All private key should be generated randomly without any seed and independently from each other, meaning not generating from a randrange. |
Okay, I've done some research and found out that all private keys can only be recovered if the master public key is known and some private key is known. The first sounds impossible because we only share (sometimes, accidentally) the master address, and recovering the public key from an address is impossible AFAIK. |
Each private key below the master key is generated from a range, that is why you have something called index. If one or more private key are compromised, you convert that key to a big integer and you will get a very good idea about the range of the other private keys. BIP32 is helps in recovery of all of your private key to all of your site at once, it is not secure at all! BIP32 is created for the idiots who not backing up keys, no security or anything like that if one or more keys compromised in the range. |
Except that Bitcoin developers and community recommend to not use "normal" private keys and to use deterministic wallets instead... |
Theymos (the owner of bitcoin.it domain) is a maniac liar. He has self interest. For example Wikipedia says that BitcoinTalk.org is founded by Satoshi Nakamoto which is false! Satoshi Nakamoto never published a single post on BitcoinTalk.org which registered by Theymos in 2011. You can reuse your Bitcoin address how much time you want if the private key is secure! BIP32 is a big trash when it comes to security. So yes, we don't need BIP32 "super seed" in ZeroNet by default. It should be turned off and everyone should back up the private keys, like how ZeroNet ask you to do when you @filips123 Bitcoin developers are on GitHub which is funny, I would expect them to develop Bitcoin in a decentralized manner not on Microsoft. @imachug have a very good GitHub alternative. ;) |
You don't have to be so specific, I have a good enough overview on elliptic curve cryptography. Let's take a look at my implementation of BIP32 non-hardened keys: # Round 1
h = hmac.new(key=b"Bitcoin seed", msg=seed, digestmod="sha512").digest()
private_key1 = h[:32]
x, y = self.private_to_public(private_key1)
public_key1 = bytes([0x02 + (y[-1] % 2)]) + x
private_key1 = bytes_to_int(private_key1)
# Round 2
msg = public_key1 + self._int_to_bytes(child, 4)
h = hmac.new(key=h[32:], msg=msg, digestmod="sha512").digest()
private_key2 = bytes_to_int(h[:32])
return self._int_to_bytes((private_key1 + private_key2) % self.n) The first part computes the base of the private key by using HMAC. The second part uses HMAC and the child ID to generate the offset. It's true that if the second part was just Luckily, the offset is not calculated in such a silly way, it's HMAC which uses both the child number and the seed. So, you know that the private key is Here's how the attack you mentioned works: notice that if the public key and the chain key were both known and you somehow got a private key of some site, it would become possible to compute Luckily, in our case, if In conclusion: your attack can't be performed on ZeroNet. |
We don't use Bitcoin, we use secp256k1 and BIP32, i.e. Bitcoin cryptography, these are different things. I'm understanding your last message as "Pretend if someone uses the same private key for both their ZeroNet site and their Bitcoin wallet. In this case, their funds and other sites may be in danger". Do I get it right? Please notice that importing your master seed from Bitcoin to ZeroNet is just shooting yourself in the foot. |
What's the advantage of using xprv instead of WIF? |
@imachug |
So you telling me that 1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D is not a valid Bitcoin address and is dangerous to receive funds into this address or you say that the WIF private key can't be used to spend the received funds from this address? You say "Bitcoin cryptography" while in reality files are hashed using sha512 which by itself very secure. So tell me @imachug what the hell is 1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D, is not a valid Bitcoin address? @HelloZeroNet https://www.blockchain.com/btc/address/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D Not valid for sure and your funds are in big danger right @imachug? |
@HelloZeroNet would be nice to hear from you regarding "we don't use Bitcoin" thing what @imachug posted.. |
🤣 https://www.blockchain.com/btc/tx/43954c4e0b411e599b3d805a77063a03226d13be38a118b4ea7e418e45dae619 is clearly showing that @shortcutme has spent from 1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D so tell me @imachug that ZeroNet is not using Bitcoin public keys for addressing or that is dangerous to send funds to the addresses generated by ZeroNet! Hey, @filips123 say something, help imachug because he is very tired and lost his mind.... Public key for 1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D is I see no problem with Sigscript so the funds on @HelloZeroNet are secure. (not according to @imachug who even say this is not a Bitcoin address 🤣 ) |
#2512
If anyone need to use a master_seed to generate private keys for sites in a range, than that person should use the config parameter --use_master_seed True.
By default all user should backup private keys instead of generating a few million key in a limited private key space between 0x1 and 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140.
While using a seed is good if any of the addresses get compromised from the range of generated private keys an attacker can compromise all and every site generated using that seed!
So, generate a new randomly-selected private key for each new address and let the user practice backing up private keys.