Author

Topic: I REGAINED access to Bitcoins in my made-up brainwallet! (Read 617 times)

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
can you write each step and share the result of each step?
See this post. Reading the topic before responding helps. Also, there's no need for long quotes.

Quote
I need to understand the process you are doing, then I can write suggestions for you.
Why? Even the topic title shows I regained access.
sr. member
Activity: 1190
Merit: 469
Hello.
Can you simulate the process step by step?


he already did in post 11: https://bitcointalksearch.org/topic/m.64125626
member
Activity: 73
Merit: 19
TL;DR
Years ago, I sent some Bitcoin to an address without any physical backup, to see if I could find it back years later. Now, I can't find them back. Lol.

Long version
I combined a brainwallet with BIP38 encryption to make it very hard to crack. A bit like this proposal, but my own version. I kept notes of what I did:
Code:
1. Passphrase > brainwallet > uncompressed privkey
2. BIP38 compress this key with passphrase2
3. Take this 6P encrypted key, add -1, use this as brainwallet and fund the compressed addy
I don't remember the address.
I remember the amount on 2 addresses used to fund it.
I don't remember the transaction fee.
I don't remember the year I did all this. I guess it was somewhere between 2017 and 2020.
I'm pretty sure all addresses involved were legacy.
Blockchair's transaction search gives thousands of potential transactions. I can narrow it down to less than a thousand by making some assumptions. I can't select all search options I'd need for a lower number of transactions.
I do remember the passphrases used. I won't say I'm 100% certain, so let's say I'm 99% certain those are correct. That makes it likely there's something in my method that I can't reproduce.
I am 100% certain nobody brute-forced my private key. The passphrase was too long for heavy BIP38 encryption, and the setup was too complicated (so automated searches (which are used to attack all regular brainwallets at once) can't be used.

Questions
Why did I do step 1 and 2? That could have been done in one step, unless I'm missing something now.
Does BIP38 encryption always produce the same encrypted key, or could the same privkey and passphrase produce a different encrypted string if I use different software? I probably used bitaddress.org or the other (now scamming) paper wallet site from back in those days.
The annoying part: to try anything, takes me several manual actions on an air-gapped system. I can't quickly test a lot of options.

How much?
I wasn't dumb enough to use a large amount, but I'd still like to find it back. I won't lose sleep over the amount, but I already know if I can't recover it, it's going to torment me for years. I rarely lose data, and I don't like it.

No spam
Self-moderated to prevent spam. Discussion is of course allowed. I already know I was stupid, but feel free to rub it in Tongue Telling me "I told you so" is allowed too Tongue

Hello.
Can you simulate the process step by step?
For example.
let's say you chose brainwallet Passphrase ‘mamu’ in the first step. can you write each step and share the result of each step? I need to understand the process you are doing, then I can write suggestions for you.
sr. member
Activity: 1190
Merit: 469
It's a fact of life that not all Bip38 tools produce the same output.

I'd like to see proof for this claim! Which commonly used tools or wallets have a flawed BIP38 implementation?

none that i know of that are commonly used tools such as bitaddress.

but there's this piece of bip38 python software that only implements EC non-multiply mode. It is completely unaware of the multiply mode. So when it comes across encrypted private keys of that type, it decodes them but incorrectly. I woudn't call it a bug, I would call it more like being an incomplete implementation of bip38. but that could certainly lead to confusion. i can't really say the name of the software but it's definitely not commonly used. it's just something someone wrote but didn't really complete it, i guess. i just happened to come across it and i became aware of that bug when i tried testing it out on some EC multiply test addresses.

if this particular software developer made that mistake though, it's possible someone else might too if they are just a hobbyist programmer so it's something to lookout for...
 Shocked

even software like bitaddress for bip38 it is not a complete implementation. it can decode EC multiply but I think it uses the non-multiply mode to encode. but i guess it is ok.
member
Activity: 500
Merit: 38
It must be the same result. If it is used:

Code:
prefactor = hexstrlify(scrypt.hash(password, salt, 16384, 8, 8, 32))


Maybe there are different tools that have different prefixes. (nothing else can cause confusion)


Code:
Range in base58check encoding for non-EC-multiplied keys without compression (prefix 6PR):
Minimum value: 6PRHv1jg1ytiE4kT2QtrUz8gEjMQghZDWg1FuxjdYDzjUkcJeGdFj9q9Vi (based on 01 42 C0 plus thirty-six 00's)
Maximum value: 6PRWdmoT1ZursVcr5NiD14p5bHrKVGPG7yeEoEeRb8FVaqYSHnZTLEbYsU (based on 01 42 C0 plus thirty-six FF's)
Range in base58check encoding for non-EC-multiplied keys with compression (prefix 6PY):
Minimum value: 6PYJxKpVnkXUsnZAfD2B5ZsZafJYNp4ezQQeCjs39494qUUXLnXijLx6LG (based on 01 42 E0 plus thirty-six 00's)
Maximum value: 6PYXg5tGnLYdXDRZiAqXbeYxwDoTBNthbi3d61mqBxPpwZQezJTvQHsCnk (based on 01 42 E0 plus thirty-six FF's)
Range in base58check encoding for EC-multiplied keys without compression (prefix 6Pf):
Minimum value: 6PfKzduKZXAFXWMtJ19Vg9cSvbFg4va6U8p2VWzSjtHQCCLk3JSBpUvfpf (based on 01 43 00 plus thirty-six 00's)
Maximum value: 6PfYiPy6Z7BQAwEHLxxrCEHrH9kasVQ95ST1NnuEnnYAJHGsgpNPQ9dTHc (based on 01 43 00 plus thirty-six FF's)
Range in base58check encoding for EC-multiplied keys with compression (prefix 6Pn):
Minimum value: 6PnM2wz9LHo2BEAbvoGpGjMLGXCom35XwsDQnJ7rLiRjYvCxjpLenmoBsR (based on 01 43 20 plus thirty-six 00's)
Maximum value: 6PnZki3vKspApf2zym6Anp2jd5hiZbuaZArPfa2ePcgVf196PLGrQNyVUh (based on 01 43 20 plus thirty-six FF's)


I have my own tool that only encode/decode  EC-multiplied keys  (prefix 6Pn).

Code:
import scrypt
from binascii import hexlify, unhexlify
from Crypto.Cipher import AES  # pip install pycryptodome
from gmpy2 import mpz  # pip install gmpy2
import secp256k1 as ice # https://github.com/iceland2k14/secp256k1
import hashlib

# Utility function to decode base58
def b58d(s, check=True):
    b58_digits = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
    zero_digit = b58_digits[0]
    assert s  
    n = 0
    for c in s:
        n = n * 58 + b58_digits.index(c)  
    h = hex(n)[2:]
    if len(h) % 2:
        h = "0" + h  
    res = unhexlify(h.encode("utf8"))
    pad = 0  
    for c in s:
        if c == zero_digit:
            pad += 1
        else:
            break  
    o = b"\x00" * pad + res  
    if check:
        double_sha256 = hashlib.sha256(hashlib.sha256(o[:-4]).digest()).digest()
        assert double_sha256[:4] == o[-4:]
        return hexlify(o[:-4]).decode("ascii")
    else:
        return hexlify(o).decode("ascii")


def simple_aes_decrypt(msg, key):
    assert len(msg) == 16
    assert len(key) == 32
    cipher = AES.new(key, AES.MODE_ECB)
    decrypted_msg = hexstrlify(cipher.decrypt(msg))
    decrypted_msg = decrypted_msg.rstrip('7b')
    padding_length = (32 - len(decrypted_msg)) // 2
    decrypted_msg += '7b' * padding_length
    assert len(decrypted_msg) == 32
    return unhexlify(decrypted_msg)

def dechex(num, zfill=0):
    if isinstance(num, mpz):
        hex_num = num.digits(16)
        if len(hex_num) % 2:
            hex_num = '0' + hex_num
        hex_bytes = hex_num.rjust(zfill * 2, '0')
        return hex_bytes
    else:
        raise TypeError('Input must be mpz.')

def multiplypriv(p1, p2):
    result = (mpz(p1, 16) * mpz(p2, 16)) % ice.N
    return dechex(result, 32)

def strlify(a):
    return str(a).replace("b'", "").rstrip("'")

def hexstrlify(a):
    return strlify(hexlify(a))

def privtopub(priv, outcompressed=True):
    priv_int = int(priv, 16)
    pub = ice.scalar_multiplication(priv_int)
    return ice.point_to_cpub(pub)

def hash256(hexstring):
    return hashlib.sha256(hashlib.sha256(bytes.fromhex(hexstring)).digest()).digest().hex()

def bip38decrypt(password, encrypted_private_key, target):
    encrypted_private_key = b58d(encrypted_private_key)
    owner_entropy = encrypted_private_key[14:30]
    enchalf1half1 = encrypted_private_key[30:46]
    enchalf2 = encrypted_private_key[46:]
    owner_salt = owner_entropy
    salt = unhexlify(owner_salt)
    prefactor = hexstrlify(scrypt.hash(password, salt, 16384, 8, 8, 32))
    passfactor = prefactor
    passpoint = privtopub(passfactor, True)
    password = unhexlify(passpoint)
    combined_salt = unhexlify(encrypted_private_key[6:14] + owner_entropy)
    encseedb = hexstrlify(scrypt.hash(password, combined_salt, 1024, 1, 1, 64))
    key = unhexlify(encseedb[64:])
    tmp = hexstrlify(simple_aes_decrypt(unhexlify(enchalf2), key))
    enchalf1half2_seedblastthird = mpz(tmp, 16) ^ mpz(encseedb[32:64], 16)
    enchalf1half2_seedblastthird = dechex(enchalf1half2_seedblastthird, 16)
    enchalf1half2 = enchalf1half2_seedblastthird[:16]
    enchalf1 = enchalf1half1 + enchalf1half2
    decrypted_enchalf1 = hexstrlify(simple_aes_decrypt(unhexlify(enchalf1), key))
    seedb = mpz(decrypted_enchalf1, 16) ^ mpz(encseedb[:32], 16)
    seedb = dechex(seedb, 16) + enchalf1half2_seedblastthird[16:]
    factorb = hash256(seedb)
    priv = multiplypriv(passfactor, factorb)
    dec = int(priv, 16)
    caddr = ice.privatekey_to_address(0, True, dec)
    uaddr = ice.privatekey_to_address(0, False, dec)
    if caddr == target or uaddr == target:
        wifc = ice.btc_pvk_to_wif(priv)
        wifu = ice.btc_pvk_to_wif(priv, False)
        with open("KEY.txt", "a") as file:
            file.write("\nPrivate key (wif) Compressed : " + wifc)
            file.write("\nPrivate key (wif) Uncompressed: " + wifu)
            file.write("\nBitcoin address Compressed: " + caddr)
            file.write("\nBitcoin address Uncompressed: " + uaddr)
            file.write(
                "\n-------------------------------------------------------------------------------------------------------------------------------------------\n"
            )
        return wifc
    else:
        return False

pwd = "Satoshi"
encryptedSecret = "6PnRY7S41Qe6i9SLxRrmSJ1AQhkz4yLjPXw76qtHShLsb1Ch8JrbMWGvPr"
target = "15aAb6P6ysSAR3SEtit6MWWgNPXZgn5YFj"

test = bip38decrypt(pwd, encryptedSecret, target)
print(test)


result form KEY.txt

Private key (wif) Compressed : KxSomWg95w2qRi5S3cuC5FPcQdXiWhHRaWpZZcLkXgvE1UAyhfZq
Private key (wif) Uncompressed: 5J6Pq9Y56ecm3szePoCNYKfevqc44ZEh1Lu1afpXFf3YVh13Ccb
Bitcoin address Compressed: 15aAb6P6ysSAR3SEtit6MWWgNPXZgn5YFj
Bitcoin address Uncompressed: 13XDLESCf3UDBLjGoSEdLH9ksHNuYAybPR


bip38 is pretty well DEPRECATED by now and not really recommended.

The tools, for example, in python, are outdated.
But that doesn't stop me from updating them myself. BIP38 is unhackable.
I barely manage to encode/decode  100 per second with all possible accelerations around.

The scrypt function is slow by design.

It can NOT be accelerated. The parameters that include N=16384, r=8, and p=8.
The N parameter defines the CPU/memory cost, and larger values like that make the function more memory-intensive.

This is a deliberate design choice to prevent attackers from using specialized hardware, like GPUs or ASICs, which might have less memory available per processing unit.
legendary
Activity: 2730
Merit: 7065
I'd like to see proof for this claim! Which commonly used tools or wallets have a flawed BIP38 implementation?
If they are using the same standard in the exact same way, the results have to be identical. If you have input 1 that is being encrypted with said standard, it has to spit out result 1. If you are getting results 2 and 3 as well, there is some deviation somewhere. A flawed tool or wallet would produce different results. But that's not a problem with the implementation, but rather the scheme that buggy software is using.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Which commonly used tools or wallets have a flawed BIP38 implementation?
I've used Mycelium to decrypt BIP38 in the past, but I've only used BitAddress (and the (now phishing) site that's based on it) to create them. It makes sense BIP38 was mostly used for paper wallets, which would explain why other wallets don't create them.
Not that it matters much for me, BitAddress is widely used and that's what I'll use in the future to decrypt this. I've already tested 2 different BitAddress versions, both produce the same.
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
It's a fact of life that not all Bip38 tools produce the same output.

I'd like to see proof for this claim! Which commonly used tools or wallets have a flawed BIP38 implementation?
hero member
Activity: 560
Merit: 1060
That's another issue with trying to use bip38 and brainwallets is that bip38 is pretty well DEPRECATED by now and not really recommended. It's a fact of life that not all Bip38 tools produce the same output. So you better stick with the software you originally used to encrypt which apparently is bitaddress.

That's what I thought, but I couldn't find evidence for it. This would indeed mess up my system.

Any info about it? Sounds like an intriguing case-study.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Before you start funding an address like that, you should probably make sure whatever software you are using to generate that compressed address works with other software tools the same way.
Before funding, I indeed reproduce my steps using different software.

Quote
1BsQ1rYAi2nNpnqpCLyQS4fkV4dEf3jegB would be the correct compressed address for a brainwallet corresponding to the passphrase "6PRKrgToVFyMzHL3qYa9Pq7e1ZugAiaYGYUxK2ccVaUoSeK9PYnqFti5Br-1".
You're right, I copied the addy from the previous step instead of the final step. There's another reason to verify everything twice, which I didn't do for this example. I've edited my post.

Quote
That's another issue with trying to use bip38 and brainwallets is that bip38 is pretty well DEPRECATED by now and not really recommended.
Says who? It's a standard that's widely used, but just in case, I keep my own copies of the software. And so do many other people, I'm pretty sure someone would share it if I'd ask for it 20 years from now.
I've actually thought about creating an archive site with all kinds of old Bitcoin-related software, but I didn't want to deal with potential copyright issues.

Quote
It's a fact of life that not all Bip38 tools produce the same output.
That's what I thought, but I couldn't find evidence for it. This would indeed mess up my system.
sr. member
Activity: 1190
Merit: 469


As an example (I did this online because it's only for testing):
  • Go to bitaddress.org
  • Click Wallet Details
  • In privkey field, enter "longpassphrasetoremember"
  • Tick "BIP38 Encrypt"
  • Enter "extrapassphrase" and click Encrypt BIP38
  • Click OK to use it as brainwallet
  • The resulting encrypted privkey is 6PRKrgToVFyMzHL3qYa9Pq7e1ZugAiaYGYUxK2ccVaUoSeK9PYnqFti5Br
based on this small test vector of yours and the results below, I'm not sure you are doing things correctly.


Quote
  • Now create a new brainwallet out of "6PRKrgToVFyMzHL3qYa9Pq7e1ZugAiaYGYUxK2ccVaUoSeK9PYnqFti5Br-1", and use compressed addy 14ut6qNTdRaexXRtMjYQc7bkStr2FLNfhk to store funds (don't use this one, obviously)
  • Before funding anything, see if you can reproduce your address from scratch
This is what I did. By now, a Segwit version would be better.

Before you start funding an address like that, you should probably make sure whatever software you are using to generate that compressed address works with other software tools the same way.  1BsQ1rYAi2nNpnqpCLyQS4fkV4dEf3jegB would be the correct compressed address for a brainwallet corresponding to the passphrase "6PRKrgToVFyMzHL3qYa9Pq7e1ZugAiaYGYUxK2ccVaUoSeK9PYnqFti5Br-1".


That's another issue with trying to use bip38 and brainwallets is that bip38 is pretty well DEPRECATED by now and not really recommended. It's a fact of life that not all Bip38 tools produce the same output. So you better stick with the software you originally used to encrypt which apparently is bitaddress.

Quote
Every existing "classic" brainwallet is attacked by many people doing billions if not trillions of password hacking attempts per second.
i wouldnt say "every". maybe just the sha256 one.

Quote
See Collection of 18.509 found and used Brainwallets (https://bitcointalksearch.org/topic/collection-of-18509-found-and-used-brainwallets-4768828). By adding BIP38 to the equation, suddenly an attacker would only be able to do a few attempts per second. It's not worth the electricity to even try.

so would making your sha256 brainwallet "unclassic" by making a few small modifications to how it worked like having a second passphrase (which your's has anyway)...
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
so the real issue is why we would need to invent a new rather obscure algorithm to do a brainwallet when we could achieve the same thing by just increasing the length of our passphrase
Every existing "classic" brainwallet is attacked by many people doing billions if not trillions of password hacking attempts per second. See Collection of 18.509 found and used Brainwallets. By adding BIP38 to the equation, suddenly an attacker would only be able to do a few attempts per second. It's not worth the electricity to even try.
sr. member
Activity: 1190
Merit: 469

What you're suggesting is called security through obscurity:
yes i think you're relying partly on security through obscurity

Quote
I trust my passphrase to be difficult enough.
i could say the same thing about my simple sha256 brainwallet.


Quote
If you don't understand that one random character added to the passphrase adds more "difficulty" than 10 rounds of the same encryption, I give up Tongue


i imagine you're not talking about step 3 in your algorithm:

Code:
3. Take this 6P encrypted key, add -1, use this as brainwallet and fund the compressed addy

a bip 38 encrypted private key is already long enough. adding -1,-2 and so on was your idea of having some type of way to generate extra addresses in a sequential manner. it doesn't really do anything for security. so we're back to where we started which is the original passphrase. if it's long enough, its not feasible to hack no matter what brainwallet algorithm you use. i think you would probably agree with that statement.

so the real issue is why we would need to invent a new rather obscure algorithm to do a brainwallet when we could achieve the same thing by just increasing the length of our passphrase



legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Maybe I am missing something, but if you remember the passphrases used? Why couldn't you just use the passphrasees to generate the private key and address?
You must have missed this part:
my mind had added a character to my passphrase
Now I can reproduce it again.

The reason I did this, was because I wanted to add heavy encryption to a brainwallet,
what does that even mean though? i don't think you're really encrypting anything. encryption is typically encrypting a final output. your final output is a clear private key.
The final output is produced from encrypted data. I don't see the point of going into semantics.

now those are some pretty big statements you made there which i'm not so sure i can agree with. for example, if adding one more character is more secure than doing 10 rounds of encryption then i don't know what to say. except maybe we disagree.  Shocked
If you don't understand that one random character added to the passphrase adds more "difficulty" than 10 rounds of the same encryption, I give up Tongue
But here's a hint:
First wallet was cracked in under 3 hours. [pwd: BarT]
Second wallet was cracked in under 10 hours. [pwd: grAce]
Fourth wallet was cracked in under 2 days. [pwd: pxrmg]
Third wallet was NOT CRACKED in two years. [pwd: zLwMiR]
sr. member
Activity: 1190
Merit: 469
The reason I did this, was because I wanted to add heavy encryption to a brainwallet,
what does that even mean though? i don't think you're really encrypting anything. encryption is typically encrypting a final output. your final output is a clear private key.

Quote
and at the same time avoid the brute-forcers who can attack all "standard" brainwallets at the same time.
Now, there's WarpWallet for that.
so why not use warpwallet then? its harder to brute force than your scheme. and now that you have published your scheme, so that the whole world can know, your bitcoin private key is more likely to be broken than someone using warpwallet.

Quote
I did: I wrote down the steps, and that's not a weakness in the system. I've posted my steps here, it now serves as an additional backup of the steps I took, but doesn't help anyone to gain access to my coins.
it makes it more likely they will gain access to your coins than if you never published your "brainwallet algorithm". since according to you that's the only way they could come up with the same private key.


Quote
Quote
to get even more security why not iterate this entire procedure 10 times? taking the output of step 3 as the input to step 1.
If that would be necessary, they would have included 10 more rounds in the BIP38 protocol. Adding just one more character to the BIP38-passphrase adds much more "strength" than doing 10 rounds of encryption.
now those are some pretty big statements you made there which i'm not so sure i can agree with. for example, if adding one more character is more secure than doing 10 rounds of encryption then i don't know what to say. except maybe we disagree.  Shocked
copper member
Activity: 2996
Merit: 2374
I do remember the passphrases used.



As an example (I did this online because it's only for testing):
  • Go to bitaddress.org
  • Click Wallet Details
  • In privkey field, enter "longpassphrasetoremember"
  • Tick "BIP38 Encrypt"
  • Enter "extrapassphrase" and click Encrypt BIP38
  • Click OK to use it as brainwallet
  • The resulting encrypted privkey is 6PRKrgToVFyMzHL3qYa9Pq7e1ZugAiaYGYUxK2ccVaUoSeK9PYnqFti5Br
  • Now create a new brainwallet out of "6PRKrgToVFyMzHL3qYa9Pq7e1ZugAiaYGYUxK2ccVaUoSeK9PYnqFti5Br-1", and use compressed addy 14ut6qNTdRaexXRtMjYQc7bkStr2FLNfhk to store funds (don't use this one, obviously)
  • Before funding anything, see if you can reproduce your address from scratch
This is what I did. By now, a Segwit version would be better.
Maybe I am missing something, but if you remember the passphrases used? Why couldn't you just use the passphrasees to generate the private key and address?

I don't really see much value in knowing the details of the transaction if you don't know the private key, and the private key can lead you to information that will allow you to get the details of the transaction so you can create a new transaction to spend the coin.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Now, seriously, were you doing an experiment (for fun) ?
Kinda Smiley

Another flaw in this whole thing is "inventing your own method". It is never a good idea specially when it comes to cryptography related stuff. There are a lot of things that could go wrong, from small bugs that could not be reproduced when trying to recover to serious bugs that could be categorized as security flaw.
Yep, I agree Smiley
The reason I did this, was because I wanted to add heavy encryption to a brainwallet, and at the same time avoid the brute-forcers who can attack all "standard" brainwallets at the same time.
Now, there's WarpWallet for that.

but in his case it's not because it is cryptographically weak. its because after a few years, you won't remember what the
I did: I wrote down the steps, and that's not a weakness in the system. I've posted my steps here, it now serves as an additional backup of the steps I took, but doesn't help anyone to gain access to my coins.

you could have just eliminated the bip38 part since the final step was just hashing some string to get the private key. anyone else finds any other string with the same hash they don't need to reproduce your bip38 step at all  Shocked but i think your premise is you think your string is the only one that anyone could ever use to get that hash. it's an assumption.
It's a very good assumption!
You're saying anyone could use any different random number to gain access to your Bitcoin address. Duh Tongue There are about 296 valid private keys for each Bitcoin address. If anyone could find them, Bitcoin wouldn't exist.

Quote
to get even more security why not iterate this entire procedure 10 times? taking the output of step 3 as the input to step 1.
If that would be necessary, they would have included 10 more rounds in the BIP38 protocol. Adding just one more character to the BIP38-passphrase adds much more "strength" than doing 10 rounds of encryption.
sr. member
Activity: 1190
Merit: 469
Another flaw in this whole thing is "inventing your own method".
but in his case it's not because it is cryptographically weak. its because after a few years, you won't remember what the steps you did are. unless you wrote them down. which you're not supposed to do with a "brainwallet"...



I combined a brain wallet with BIP38 encryption to make it very hard to crack.
you could have just eliminated the bip38 part since the final step was just hashing some string to get the private key. anyone else finds any other string with the same hash they don't need to reproduce your bip38 step at all  Shocked but i think your premise is you think your string is the only one that anyone could ever use to get that hash. it's an assumption.

Quote
A bit like this proposal, but my own version. I kept notes of what I did:


and of course you kept notes of what you did because if you wouldn't have you probably would have forgotten those 3 simple steps. and they were very simple. and yet, we all find even simple steps hard to recall after YEARS.

Code:
1. Passphrase > brainwallet > uncompressed privkey
2. BIP38 compress this key with passphrase2
3. Take this 6P encrypted key, add -1, use this as brain wallet and fund the compressed addy


to get even more security why not iterate this entire procedure 10 times? taking the output of step 3 as the input to step 1. surely that would be even MORE secure because what adversary would go through all of that?





legendary
Activity: 3472
Merit: 10611
The funny part is: I took notes of the method I used, because I wasn't sure I'd remember all the details (even though, as a relative Bitcoin Newbie back then, I didn't realize the first 2 steps could have been done in one step). What surprised me, is that I doubted the method I wrote down, and not the passphrase:
Another flaw in this whole thing is "inventing your own method". It is never a good idea specially when it comes to cryptography related stuff. There are a lot of things that could go wrong, from small bugs that could not be reproduced when trying to recover to serious bugs that could be categorized as security flaw.
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange

While I like your Bash script, I don't think I will ever use brainwallet addresses. I'm quite well aware of the unreliability of my own memory, unless I train and use memorized details on a regular basis, emphasis on regular. I'm simply too old to keep stuff solely in my head. For me this would be a sure recipe for desaster, especially when I don't have to use it frequently.

If I were tempted to use brainwallet addresses, I'd use also additional protection with BIP38 encryption, but I'd keep'n'hide a written backup for sure, which kind of defeats the purpose of a true brainwallet. I shall not be tempted...
hero member
Activity: 560
Merit: 1060
Quote
I don't think anyone actually uses BIP38 anymore outside the collectibles community.
I think you're wrong, but can't prove it Wink

I could help proving this statement  Tongue
Now, seriously, were you doing an experiment (for fun) ?
Personally, if I used something like that, I would definitely keep the phrases in paper backups, without ever mentioning or stating they had anything to do with Bitcoin.

Simple brainwallets (by human standards) are in many cases fundamentally flawed which has been proven. You simply can't use anything that's online available as source for a simple brainwallet (simple in terms of taking only the SHA-256 of the source phrase as private key).

Or use my tool https://bitcointalksearch.org/topic/brain21-a-simple-brain-wallet-generator-in-bash-5488789 (Only kidding of course!)
member
Activity: 378
Merit: 93
Enable v2transport=1 and mempoolfullrbf=1
I was throwing away some old empty seeds I had written down and saw the 12 words from my first hardware wallet. I had memorized these before, but I switched devices ~5 years ago. Out of those 12 words I memorized, I only remembered 1 now.

Strength of passwords and number of unique passwords seems like a bottleneck that humans are running into. Machines are becoming more powerful at guessing passwords, so humans are required to remember longer and more complex phrases. To access my Bitcoin wallet on my node running on my laptop, I'm burdened with 4 layers of passwords - disk decryption, user login, node login, wallet login.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Out of curiosity: the subtraction of 1 from the intermediate 6P private key (I assume after conversion from WIF to hex format, otherwise the WIF's checksum would break) is an intentional obfuscation step?
I'm not subtracting "-1", I'm adding it (see this example) as a nonce. I could use "-2" to get the next address. In a way, they're like hardened private keys: if one leaks, it's not possible to find the next one.

Quote
Simple brainwallets (by human standards) are in many cases fundamentally flawed which has been proven. You simply can't use anything that's online available as source for a simple brainwallet (simple in terms of taking only the SHA-256 of the source phrase as private key).
Have a look at WarpWallet.
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
Out of curiosity: the subtraction of 1 from the intermediate 6P private key (I assume after conversion from WIF to hex format, otherwise the WIF's checksum would break) is an intentional obfuscation step?

Your recipe is already a bit complex. But why this subtraction step? Didn't you trust your initial passphrase1 and encryption passphrase2 enough?

Simple brainwallets (by human standards) are in many cases fundamentally flawed which has been proven. You simply can't use anything that's online available as source for a simple brainwallet (simple in terms of taking only the SHA-256 of the source phrase as private key).
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
BIP38 with segwit addresses would be non-standard, because it only mentions encoding the address into compressed or uncompressed base58.
I could create a Segwit address from the resulting private key.

Quote
I don't think anyone actually uses BIP38 anymore outside the collectibles community.
I think you're wrong, but can't prove it Wink

Quote
There are better ways to encrypt large amounts of private keys especially the ones that are derived from HD keys.
Do tell: how? What standard encryption is heavy enough to keep $1000 secure for 2 years with password zLwMiR, even after giving hints? I'd like to use something better, but I haven't seen anything that follows a standard.
For the record: this exercise wasn't only about encryption, it was about remembering everything from scratch.

Quote
PS: Your algorithm for deriving a brainwallet is quite hard to remember Tongue
That's why I wrote it down Wink
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
By now, a Segwit version would be better.

BIP38 with segwit addresses would be non-standard, because it only mentions encoding the address into compressed or uncompressed base58.

I don't think anyone actually uses BIP38 anymore outside the collectibles community. There are better ways to encrypt large amounts of private keys especially the ones that are derived from HD keys.

PS: Your algorithm for deriving a brainwallet is quite hard to remember Tongue
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I don't get this part:

Quote
1. Passphrase > brainwallet > uncompressed privkey
This is a better description:
Code:
1. Passphrase for brainwallet + passphrase2 for BIP38 (on air-gapped bitaddress.org) > compressed key (starting with 6P)
2. Take this 6P encrypted key, add -1 at the end, and use this as passphrase to create a brainwallet. Fund the compressed addy

Quote
If you didn't initially know the address then when you use the private key to generate its base58 address, you could've checked it for a balance on a block explorer, without the other steps.
I didn't know the address nor privkey. Now I know both again.



As an example (I did this online because it's only for testing):
  • Go to bitaddress.org
  • Click Wallet Details
  • In privkey field, enter "longpassphrasetoremember"
  • Tick "BIP38 Encrypt"
  • Enter "extrapassphrase" and click Encrypt BIP38
  • Click OK to use it as brainwallet
  • The resulting encrypted privkey is 6PRKrgToVFyMzHL3qYa9Pq7e1ZugAiaYGYUxK2ccVaUoSeK9PYnqFti5Br
  • Now create a new brainwallet out of "6PRKrgToVFyMzHL3qYa9Pq7e1ZugAiaYGYUxK2ccVaUoSeK9PYnqFti5Br-1", and use compressed addy 14ut6qNTdRaexXRtMjYQc7bkStr2FLNfhk 1BsQ1rYAi2nNpnqpCLyQS4fkV4dEf3jegB to store funds (don't use this one, obviously)
  • Before funding anything, see if you can reproduce your address from scratch
This is what I did. By now, a Segwit version would be better.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
I don't get this part:

Quote
1. Passphrase > brainwallet > uncompressed privkey

If you didn't initially know the address then when you use the private key to generate its base58 address, you could've checked it for a balance on a block explorer, without the other steps.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Guess what: I figured it out! It turns out my mind had added a character to my passphrase, that shouldn't be there. Without it, I can recover the address.
To me, this proves (and/or confirms) 2 things:
1. My "it's all in my head" storage system works.
2. My "it's all in my head" storage system is far too risky.

The funny part is: I took notes of the method I used, because I wasn't sure I'd remember all the details (even though, as a relative Bitcoin Newbie back then, I didn't realize the first 2 steps could have been done in one step). What surprised me, is that I doubted the method I wrote down, and not the passphrase I memorized:
I do remember the passphrases used. I won't say I'm 100% certain, so let's say I'm 99% certain those are correct. That makes it likely there's something in my method that I can't reproduce.
It was the other way around. It's funny how my mind tricks me into trusting .... my mind Grin

Lessons learned
Don't do brainwallets Tongue Even though I'll keep this one for now, it's still not recommended. And if you do insist (which you should only do if you know for sure it's difficult enough to withstand brute-force attacks): keep a backup. Or just don't do it. But if you do, and if you can't restore it in the future: please open a topic about it Tongue

which address I put in my email then, in 2015, when I received my 10k sats?
That's not much to go on. It gives 71,371 possible transactions.
copper member
Activity: 821
Merit: 1992
Quote
Years ago, I sent some Bitcoin to an address without any physical backup, to see if I could find it back years later. Now, I can't find them back. Lol.
Yes, it is quite common. Having at least a single physical backup is very important. If someone want to dig into the chain, then I have a similar puzzle, good luck finding it:

1. The amount was exactly 10k satoshis.
2. It was sent from this site as a giveaway, for writing an email: https://web.archive.org/web/20150106042627/http://99bitcoins.com:80/get-your-first-bitcoin/
3. I put that into this scammy wallet, probably in 2015: https://bitcointalksearch.org/topic/easycoin-easycoinsayj7p5lonion-scam-943146

I guess this was the first time, when I saw some on-chain transaction, filled with the data I wanted to use. Of course, those coins are now gone, and that website is no longer reachable (also because Tor moved into new address types). Probably those coins were moved long time ago, but no matter how hard I tried, it is impossible for me, to find them. Also, the mailbox, which I used, was removed in 2016, so it is long gone.

Quote
I'm guessing the most plausible things you can remember here would be the amount and a more accurate time of transaction, this ca narrow down the search a lot further.
I don't think so. If I am wrong, then tell me: which address I put in my email then, in 2015, when I received my 10k sats?

Quote
But puzzles that I can't solve are frustrating, until someone else solves them.
There are many unsolved puzzles, related to brainwallets, for example bc1qt2mdkehmphggajer3ur3g8l754scj4fdrmw3rn now contains 0.01 BTC. I guess it is related into writing "pi" value somehow, but the most obvious things, like writing "3.14" in ECDSA, does not lead to the right key (and addresses like 17mKugcBDEJbu391Fq41AdwLeGHwJLPRDf were cleared long time ago).
hero member
Activity: 714
Merit: 1298

Questions
Why did I do step 1 and 2? That could have been done in one step, unless I'm missing something now.


Certainly you could do it in one single step. Probably you didn't notice BIP-38 encryption option at first, thus , applied it afterwards


Questions

Does BIP38 encryption always produce the same encrypted key,

Yes,  providing it is properly coded.


Questions

 could the same privkey and passphrase produce a different encrypted string if I use different software?


Yes, providing the different software is    intentionally designed to produce a different encrypted string (the aim being to steal your fund) , known to person, who is behind this software,
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I'm guessing the most plausible things you can remember here would be the amount and a more accurate time of transaction, this ca narrow down the search a lot further.
I think it must have been 2018, but I could be off. I can't narrow it down more accurately. I know the input amounts, the sum of that minus the transaction fee is on the address I'm looking for. Unless it was dusted later, in that case the balance can be a bit higher.

I don't remember the address.
I remember the amount on 2 addresses used to fund it.
Can you work it another way? Did you send them from a wallet you control?
Nope.

I have been trying the second website which is now a scam website. I tried it just to know how the encryption is but if you try anything with passphrase on the site, it will keep on loading and not give you any result. I just want to test it, not use it.
I have an old version, from before the site got sold. You may still be able to find it on Github.

I'm currently new to these though but can you retry same process over and over again on empty wallets ??
Yes. Actually, all I get is empty wallets.



I should have just posted a BIP38 encrypted key on Bitcointalk as a backup Tongue



I like "treasure hunts". I like Bitcoin puzzles. I even like Fork recoveries. It always feels like a challenge to find money. I like it. But puzzles that I can't solve are frustrating, until someone else solves them. In this case, that won't happen, which is why this will be "tormenting" me forever until I find it Cheesy
sr. member
Activity: 476
Merit: 299
Learning never stops!
~

I'm currently new to these though but can you retry same process over and over again on empty wallets ??
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
Does BIP38 encryption always produce the same encrypted key, or could the same privkey and passphrase produce a different encrypted string if I use different software? I probably used bitaddress.org or the other (now scamming) paper wallet site from back in those days.
The annoying part: to try anything, takes me several manual actions on an air-gapped system. I can't quickly test a lot of options.

I have been trying the second website which is now a scam website. I tried it just to know how the encryption is but if you try anything with passphrase on the site, it will keep on loading and not give you any result. I just want to test it, not use it.

If it is on bitaddress, it will always give you the same encryption if you use the same passphrase to encrypt the private key.

I think BIP38 is a standardized encryption and it supposed to be the same result irrespective of the website used, but some wallets paper wallet generator can go another way.
legendary
Activity: 3500
Merit: 6320
Crypto Swap Exchange
I don't remember the address.
I remember the amount on 2 addresses used to fund it.

Can you work it another way? Did you send them from a wallet you control? If so can you narrow down the info from there?

The annoying part: to try anything, takes me several manual actions on an air-gapped system. I can't quickly test a lot of options.

And

I wasn't dumb enough to use a large amount, but I'd still like to find it back. I won't lose sleep over the amount...

If it's an amount you don't mind loosing then stop worrying about using an air gapped system that is taking you more time and effort. You are more likely to make a mistake and miss the fact they yes you did find the addresses & keys.


Other then to see if you could was there another reason for this? Perhaps something else that may help you remember.
i.e. I was annoyed at DaveF when I did this so I vanitygenned 1FuckDave as one of the addresses?

-Dave


legendary
Activity: 2114
Merit: 2248
Playgram - The Telegram Casino
I don't remember the address.
I remember the amount on 2 addresses used to fund it.
I don't remember the transaction fee.
I don't remember the year I did all this. I guess it was somewhere between 2017 and 2020.
I'm guessing the most plausible things you can remember here would be the amount and a more accurate time of transaction, this ca narrow down the search a lot further. You can try linking the action to at other event you did before or after at the time, so for example if you were taking an exam when you did this or attended a wedding. With the address you can use any available tool that works now to check that with the passphrase to know if it's valid.

If you do get the amount and it's less insignificant, it will make the 'I told you sos' more fun'.

Also do you think at that time you would have left some clues for you now to find it?
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
TL;DR
Years ago, I sent some Bitcoin to an address without any physical backup, to see if I could find it back years later. Now, I can't find them back. Lol.

Long version
I combined a brainwallet with BIP38 encryption to make it very hard to crack. A bit like this proposal, but my own version. I kept notes of what I did:
Code:
1. Passphrase > brainwallet > uncompressed privkey
2. BIP38 compress this key with passphrase2
3. Take this 6P encrypted key, add -1, use this as brainwallet and fund the compressed addy
I don't remember the address.
I remember the amount on 2 addresses used to fund it.
I don't remember the transaction fee.
I don't remember the year I did all this. I guess it was somewhere between 2017 and 2020.
I'm pretty sure all addresses involved were legacy.
Blockchair's transaction search gives thousands of potential transactions. I can narrow it down to less than a thousand by making some assumptions. I can't select all search options I'd need for a lower number of transactions.
I do remember the passphrases used. I won't say I'm 100% certain, so let's say I'm 99% certain those are correct. That makes it likely there's something in my method that I can't reproduce.
I am 100% certain nobody brute-forced my private key. The passphrase was too long for heavy BIP38 encryption, and the setup was too complicated (so automated searches (which are used to attack all regular brainwallets at once) can't be used.

Questions
Why did I do step 1 and 2? That could have been done in one step, unless I'm missing something now.
Does BIP38 encryption always produce the same encrypted key, or could the same privkey and passphrase produce a different encrypted string if I use different software? I probably used bitaddress.org or the other (now scamming) paper wallet site from back in those days.
The annoying part: to try anything, takes me several manual actions on an air-gapped system. I can't quickly test a lot of options.

How much?
I wasn't dumb enough to use a large amount, but I'd still like to find it back. I won't lose sleep over the amount, but I already know if I can't recover it, it's going to torment me for years. I rarely lose data, and I don't like it.

No spam
Self-moderated to prevent spam. Discussion is of course allowed. I already know I was stupid, but feel free to rub it in Tongue Telling me "I told you so" is allowed too Tongue
Jump to: