Skip to content
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

Deriveing Bitcoin private key from it's p2sh-segwit address (p2sh p2wpkh) #67

Open
avirils opened this issue Aug 8, 2023 · 3 comments

Comments

@avirils
Copy link

avirils commented Aug 8, 2023

Am going to share some details on how to get the private key from address.

I know you'll be thinking by now that the private key can't be derived from the address, that's what I thought on till I told my self nothing is impossible .
Now instead of you guys running brute force attack or try to reverse the algorithm why not create/find a different calculation that can be use to derive the address from the private key and then reverse your own calculation, now it may sound impossible looking at it this way f16dd077d18c6a2c64293da97cc84fad6e3ba8acc4079b32693a8e950fd0ce24 to 3MvhVPJesYH3teZ6eydZkdeMMGmjkQRF4M but after using the below script

from decimal import Decimal

user = input("1: Priv to position\n2: Position to priv\n3: Add to position\n4: Position to add\n[Ans]: ")

if user == '1':
   def find_position(hex_str):
       return int(hex_str, 16)+1

   key = input("\nkey: ")
   print ('Position:',find_position(key))

elif user == '2':
     def find_private_key(position):
         return hex(int(position) - 1)[2:].zfill(64)

     position = Decimal(input("\nPosition: "))
     private_key = find_private_key(position)
     print("Private Key:", private_key)

elif user == '3':
     def calculate_position(string):
         characters = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
         base = len(characters)
         length = len(string)
         position = 0
         power = 1

         for i in range(length - 1, -1, -1):
             char = string[i]
             digit = characters.index(char)
             position += digit * power
             power *= base

         return position

     input_string = input("\n[address]: ")
     position = calculate_position(input_string)+1
     print(f"Position:",position)

elif user == '4':
     def calculate_address(position):
         characters = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
         base = len(characters)
         address = ""

         while position > 0:
               position, remainder = divmod(position , base)
               address = characters[remainder] + address

         return address

     input_position = int(input("\nPosition: ")) - 1
     address = calculate_address(input_position)
     print("Address:", address)

else:
   print ('\nWrong input')

This how you should be looking at it 109201421632169861550405429025058298838764240157642115744110253215387890011685 to 36828257717136275917320730136896267955301102672325362318923 now it should look more vulnerable for your brain to comprehend.

Am not going to share the calculation/script I use in deriving the address from the private key but if you're planning on following the idea I just gave I want you to consider that

  1. Nothing is impossible
  2. It's not going to be an easy one (finding a different approach for deriveing the address from the private key)
  3. Don't be afraid of errors or failure instead fine a way to solve the issue or find a different approach (you only fail when you stop trying)
  4. Try to take a break(free your mind a bit)

If you have a calculation in mind but don't know how to implement it in python3 or any other programming language try using an Ai chatbot.

I will not be giving any prove on this

@ghost3666
Copy link

ghost3666 commented Oct 17, 2023

I tried with AI and converted to a valid bitcoin address, tested also on blockchain.com/explorer, but i dont know about the private key generated will import successfully into wallet

@Espresso0org
Copy link

Am going to share some details on how to get the private key from address.

I know you'll be thinking by now that the private key can't be derived from the address, that's what I thought on till I told my self nothing is impossible . Now instead of you guys running brute force attack or try to reverse the algorithm why not create/find a different calculation that can be use to derive the address from the private key and then reverse your own calculation, now it may sound impossible looking at it this way f16dd077d18c6a2c64293da97cc84fad6e3ba8acc4079b32693a8e950fd0ce24 to 3MvhVPJesYH3teZ6eydZkdeMMGmjkQRF4M but after using the below script

from decimal import Decimal

user = input("1: Priv to position\n2: Position to priv\n3: Add to position\n4: Position to add\n[Ans]: ")

if user == '1':
   def find_position(hex_str):
       return int(hex_str, 16)+1

   key = input("\nkey: ")
   print ('Position:',find_position(key))

elif user == '2':
     def find_private_key(position):
         return hex(int(position) - 1)[2:].zfill(64)

     position = Decimal(input("\nPosition: "))
     private_key = find_private_key(position)
     print("Private Key:", private_key)

elif user == '3':
     def calculate_position(string):
         characters = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
         base = len(characters)
         length = len(string)
         position = 0
         power = 1

         for i in range(length - 1, -1, -1):
             char = string[i]
             digit = characters.index(char)
             position += digit * power
             power *= base

         return position

     input_string = input("\n[address]: ")
     position = calculate_position(input_string)+1
     print(f"Position:",position)

elif user == '4':
     def calculate_address(position):
         characters = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
         base = len(characters)
         address = ""

         while position > 0:
               position, remainder = divmod(position , base)
               address = characters[remainder] + address

         return address

     input_position = int(input("\nPosition: ")) - 1
     address = calculate_address(input_position)
     print("Address:", address)

else:
   print ('\nWrong input')

This how you should be looking at it 109201421632169861550405429025058298838764240157642115744110253215387890011685 to 36828257717136275917320730136896267955301102672325362318923 now it should look more vulnerable for your brain to comprehend.

Am not going to share the calculation/script I use in deriving the address from the private key but if you're planning on following the idea I just gave I want you to consider that

  1. Nothing is impossible
  2. It's not going to be an easy one (finding a different approach for deriveing the address from the private key)
  3. Don't be afraid of errors or failure instead fine a way to solve the issue or find a different approach (you only fail when you stop trying)
  4. Try to take a break(free your mind a bit)

If you have a calculation in mind but don't know how to implement it in python3 or any other programming language try using an Ai chatbot.

I will not be giving any prove on this

Hello.tnx for your informations.can you give me a little details about this script?what is these positions exactly?

@ghost3666
Copy link

If you have script then you can share and may be we test it and try, i know its even impossible, but there are some scripts that test 1mkey/s and i m running some on my gpu and some on cpu.....

@goldenhippo58
Copy link

@ghost3666 hey can you share the code that does 1mkey/s? This one tops out at about 7000key/s. Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@ghost3666 @Espresso0org @avirils @goldenhippo58 and others