Hello all, I am trying to install bitcrack on my laptop using os ubuntu 22.04 has 16 gb ram and geforce rtx 2080. But I am getting error => make: *** [Makefile:113: dir_clunittest] Error 2.
an anybody direct me to link which shows step by step how to install bitcrack without errors and the command line to use for better results. Thanks
Well, everything is specified in the description! What dependencies are needed, how to compile... You're a lousy student if you don't want to study) https://github.com/brichard19/BitCrack/issues/214
|
|
|
Several people asked me via private message to send them the script I used.
Here is the script.
Apparently you used chatgpt, since I got an almost identical script. There are some minor differences, but the structure is the same.
Here is the script.
Nice script i really like it, i may learn something from you ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) Here there is a function that I use for my keyhunt bsgsd server: def send_and_receive_line(host, port, message): # Create a TCP socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try: # Connect to the server sock.connect((host, port))
# Send the message start_time = time.time() sock.sendall(message.encode())
# Receive the reply reply = sock.recv(1024).decode() end_time = time.time()
# Calculate the elapsed time elapsed_time = end_time - start_time sock.close() return reply, elapsed_time except ConnectionResetError: print("Server closed the connection without replying.") return None, None except ConnectionRefusedError: print("Connection refused. Make sure the server is running and the host/port are correct.") return None, None except AttributeError: return None, None
This function only send a message to a IP:port and wait for the reply returning it also the time elapsed (For speed calculation) I call the previous function with this one that format the publickey with range_A:range_B def keyhunt_client(target): host = 'localhost' # Change this to the server's hostname or IP address port = 8080 # Change this to the server's port number message = "{} {}:{}".format(target["publickey"],target["start"],target["end"]) reply, elapsed_time = send_and_receive_line(host, port, message) if( reply != "404 Not Found"): return reply else: return None
I use some target because i have a list of all puzzles with their respective ranks With those codes you don't depend of Netcat or shell commands. Here's my option. def send_request(self, pub_key, range): global key_found request_str = f"{pub_key} {range}" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect((self.server_address, 8181)) s.sendall(request_str.encode()) response = s.recv(1024) response_str = response.decode().strip() if response_str not in ("404 Not Found", "400 Bad Request"): print(f"\nThe private key for {pub_key} is: {response_str}") with open('Found.txt', 'a') as f: f.write(f"Public key: {pub_key}, Private key: {response_str}\n") key_found = True except ConnectionRefusedError: print(f"Connection refused by {self.server_address}") self.connected = False finally: s.close()
def check_server(self): self.connected = check_server(self.server_address)
def check_server(server_address): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(5) try: s.connect((server_address, 8181)) return True except socket.error: return False finally: s.close()
|
|
|
If this is possible with puzzle 66 address, then any address with tx in mempool is possible to be taken. Just the range is a little bigger but still computing the pvk should be the same easy as is for puzzle 66.
Then all BTC is in danger. You may want to try steal any other tx in mempool when there is pubkey available.
No. Properly generated bitcoin private key is insanely hard to crack (it's 256 bit). Whole bitcoin strength is based on a fact that cracking 256bit is generally considered as impossible. This can change when quantum machines will be introduced but currently you will not crack it even having PK available. Yes, it is possible. Just dividing pubkey by some values. Hitting the pvk is matter of even 2 seconds as other fella said here. Ok ... So why all the puzzles with lower ranges are still sitting there ? Why nobody can crack puzzle 130 ? If that would be possilble all the puzzles would be empty now and every day we would be hearing about stolen bitcoins after making transactions (and releasing public key). Yes, we can divide any public key by any number, but we will never know in what range to look for it. We can't even divide by 2 with 100 confidence that the division was done correctly, since the parity of the public key is unknown.
|
|
|
Yes, I agree with this. I've observed some unusual occurrences because not all miners adhere to the same rules. There have been instances where transactions with lower fees were mined instead of those with higher fees, such as 20 satoshis per virtual byte (sat/vB) being chosen over 200 sat/vB. This happens because not all miners promptly update their block templates when a transaction's fee is increased by a bot. Therefore, even if you offer the highest fee, there's no guarantee you'll win the mining competition.
How can I have this bot of yours, will it be available on github? Probably when 66, 67, 68, 69 are over ![Grin](https://bitcointalk.org/Smileys/default/grin.gif) This is not fair. How can we get a piece of cake? This is not a public pool, everyone invests their time and knowledge. In this thread and in development, the guys are laying out excellent tools, without which we would not have been able to get to 66 and 130. This is your piece of the pie, but it’s up to you to decide how to use it.
|
|
|
Warning, 206088 items lost Hint: Search with less threads (-g) or increse dp (-d) [1400.99 MK/s][GPU 1400.27 MK/s][Count 2^35.26][Dead 1][30s (Avg 26s)][0.9/1.2GB] MB] Key# 0 [1S]Pub: 0x02B38EFE0AFC3DB27D9406F776F601E3FF1A71DD84E19171D460FBAA873F3E333C Priv: 0x342C2F932001C77A
Again in the 62-bit range)
That's all good, but you manually changed the range from 66 to 62. When I insert the 66 range into the bot script, there are no changes afterward. I go to sleep, and the script works by itself. I didn't change the range, I immediately set the range from 1 to 68 bits. 1 fffffffffffffffff 025b2fb64f70afceded779f874ce13407698e406037e0bcd406c1ecec9d1d92880 02b38efe0afc3db27d9406f776f601e3ff1a71dd84e19171d460fbaa873f3e333c
|
|
|
Next transaction https://www.blockchain.com/explorer/transactions/btc/e8f748c596cfa48ce02e22fcb13c31e5b0440c5200b184963f232fd22a74cc14└─# ./kangaroo -t 4 -gpu in.txt Kangaroo v2.2 Start:1 Stop :FFFFFFFFFFFFFFFFF Keys :2 Number of CPU thread: 4 Range width: 2^68 Jump Avg distance: 2^34.02 Number of kangaroos: 2^21.36 Suggested DP: 9 Expected operations: 2^35.09 Expected RAM: 2739.2MB DP size: 9 [0xff80000000000000] SolveKeyCPU Thread 3: 1024 kangaroos SolveKeyCPU Thread 1: 1024 kangaroos SolveKeyCPU Thread 0: 1024 kangaroos SolveKeyCPU Thread 2: 1024 kangaroos GPU: GPU #0 NVIDIA GeForce RTX 3090 (82x0 cores) Grid(164x128) (212.0 MB used) SolveKeyGPU Thread GPU#0: creating kangaroos... SolveKeyGPU Thread GPU#0: 2^21.36 kangaroos [12.5s] Warning, 206088 items lost Hint: Search with less threads (-g) or increse dp (-d) [1400.99 MK/s][GPU 1400.27 MK/s][Count 2^35.26][Dead 1][30s (Avg 26s)][0.9/1.2GB] MB] Key# 0 [1S]Pub: 0x02B38EFE0AFC3DB27D9406F776F601E3FF1A71DD84E19171D460FBAA873F3E333C Priv: 0x342C2F932001C77A Again in the 62-bit range)
The key was not found by a bot, the coins were returned to the address from which they were sent. https://www.blockchain.com/explorer/addresses/BTC/bc1q5a3ak3vlmsawfptv99pvmxzv4qxvg7aj7re48g
|
|
|
INFO.log INFO:root:Fri Jul 19 06:22:18 2024 INFO:root:Extracted Public Key: 025b2fb64f70afceded779f874ce13407698e406037e0bcd406c1ecec9d1d92880 - Version 0.2.230519 Satoshi Quest, developed by AlbertoBSD
- Quiet thread output
- Stats output every 10 seconds
- Threads : 128
- K factor 4096
- Mode BSGS sequential
- Opening file 66.txt
- Added 1 points from file
- Bit Range 66
- -- from : 0x20000000000000000
- -- to : 0x40000000000000000
- N = 0x100000000000
- Bloom filter for 17179869184 elements : 58890.60 MB
- Bloom filter for 536870912 elements : 1840.33 MB
- Bloom filter for 16777216 elements : 57.51 MB
- Allocating 256.00 MB for 16777216 bP Points
- Reading bloom filter from file keyhunt_bsgs_4_17179869184.blm .... Done!
- Reading bloom filter from file keyhunt_bsgs_6_536870912.blm .... Done!
- Reading bP Table from file keyhunt_bsgs_2_16777216.tbl .... Done!
- Reading bloom filter from file keyhunt_bsgs_7_16777216.blm .... Done!
End That man is clown...Another address that is not in the range of 66... # ./kangaroo -t 4 -gpu in.txt Kangaroo v2.2 Start:1 Stop :FFFFFFFFFFFFFFFFF Keys :1 Number of CPU thread: 4 Range width: 2^68 Jump Avg distance: 2^34.02 Number of kangaroos: 2^21.36 Suggested DP: 9 Expected operations: 2^35.09 Expected RAM: 2739.2MB DP size: 9 [0xff80000000000000] SolveKeyCPU Thread 1: 1024 kangaroos SolveKeyCPU Thread 3: 1024 kangaroos SolveKeyCPU Thread 2: 1024 kangaroos SolveKeyCPU Thread 0: 1024 kangaroos GPU: GPU #0 NVIDIA GeForce RTX 3090 (82x0 cores) Grid(164x128) (212.0 MB used) SolveKeyGPU Thread GPU#0: creating kangaroos... SolveKeyGPU Thread GPU#0: 2^21.36 kangaroos [12.3s] Warning, 205727 items lost Hint: Search with less threads (-g) or increse dp (-d) [1327.10 MK/s][GPU 1326.46 MK/s][Count 2^35.47][Dead 1][36s (Avg 27s)][1.1/1.4GB] MB] Key# 0 [1S]Pub: 0x025B2FB64F70AFCEDED779F874CE13407698E406037E0BCD406C1ECEC9D1D92880 Priv: 0x3895508353AA46E8 Done: Total time 01:02 Range 62 bit
|
|
|
Hello everyone! I found the key to puzzle 66, but now I have another problem: how to withdraw the funds so that no one can intercept them with a bot? Please repost this message so the creator sees it! Maybe someone can tweet this so that the owners of large pools can respond, whether they can add the transaction to the next block when it is found, without broadcasting it to the network? Pls, HELP ME!!!!!
i can help you for a reward 15 %, contact me on dm why PM and not publicly posted here into the thread where it belongs to? I am pretty sure everyone is interested you (or other wizards) can help such key finders Judging by the questions, the person who found the key is a newbie. It will be easy to deceive him in private messages. And here we gathered mainly those who are in one way or another familiar first-hand with the work of the blockchain, what public keys and private keys are. And if there is an attempt to deceive, the locals will tell you if something is wrong.
|
|
|
So you're saying there is a chance!
Of course, there is always a chance. In the end, it's more like a lottery than a puzzle. More like a casino. Not only are the chances of winning not great, but it is also very difficult to collect the winnings)) Unless leaving half the winnings, if not more.
|
|
|
I run customise python code on M2, work as like vanity gen, but speed is okay.
i run the 34 Bit Puzzle. and the result is mostly satisfying, it almost hit 50-70% from target.
Searching for addresses starting with 1pwa and matching 1pwabe7ouahg2affqhhvviqovncr4rev7q with partial length 6 in the range 8589934592 to 17179869183 Searched 27902 keys in 6.61 seconds | Private key: 000000000000000000000000000000000000000000000000000000029281670d | Address (Compressed): 1PWaaEg8tHYzVZRoXia4YjkMci2Bq8s5Xd Searched 38419 keys in 9.03 seconds | Private key: 000000000000000000000000000000000000000000000000000000037439dffc | Address (Compressed): 1PWAt7AjKjCHp4NhheRc3cR2YRwwrkbRNj Searched 39670 keys in 9.31 seconds | Private key: 00000000000000000000000000000000000000000000000000000003c0460191 | Address (Compressed): 1PWa47ZVP1pzgySaPtn9pMvCSdxNkjCCfM Searched 44105 keys in 10.34 seconds | Private key: 00000000000000000000000000000000000000000000000000000002ea112d43 | Address (Compressed): 1PwAGySRoG8XCn5EwHszxEG5Q4oMikeUgC Searched 86491 keys in 20.33 seconds | Private key: 00000000000000000000000000000000000000000000000000000002b55bda6d | Address (Compressed): 1PwaXp8YZUFk5hP7YivAieG7zEnaKVhwA6 Searched 102573 keys in 24.10 seconds | Private key: 00000000000000000000000000000000000000000000000000000002db48641a | Address (Compressed): 1Pwau8X2xjKieab9Xj6C7NjpMRQtZ5HhAz Searched 116748 keys in 27.40 seconds | Private key: 0000000000000000000000000000000000000000000000000000000316d12e4d | Address (Compressed): 1PwAPdUUayDEqaxDP3q9VJDWiAq7CHfQFJ Searched 123543 keys in 28.99 seconds | Private key: 00000000000000000000000000000000000000000000000000000003bf357910 | Address (Compressed): 1PwAUFihpnUudcAL5iioXPbUESMvYadCFW Searched 124873 keys in 29.28 seconds | Private key: 0000000000000000000000000000000000000000000000000000000288ac21dd | Address (Compressed): 1PWa4zB1YrjobsHM2K3PzugeXJdBUqQrdt Searched 154049 keys in 36.10 seconds | Private key: 00000000000000000000000000000000000000000000000000000002178fd357 | Address (Compressed): 1PwAk5hxgBBp79y9NP1Xv9Ez2tYcR5aiBJ Searched 159895 keys in 37.45 seconds | Private key: 00000000000000000000000000000000000000000000000000000002ff515a66 | Address (Compressed): 1PWAngTsfo7VfiJf5LtmWM66cvUhURg6uo Searched 173862 keys in 40.74 seconds | Private key: 0000000000000000000000000000000000000000000000000000000374830ffc | Address (Compressed): 1Pwab9zMnNd5aeM2KZX8itAncLxUzcZNwn
the search is using secret formula to make the rate of search not far away from actual range.
the real private key is 000000000000000000000000000000000000000000000000000000034a65911d
btw anyone have configuration code to make speed faster enough with cpu ?
Bitcoin address and hash160, has no meaning when searching for a private key. You can select absolutely any search range and get the same results.
|
|
|
For those solving puzzle 130... I have been able to reduce 026a0747b3229f32ce2f0f7bd77a7bd306f6c95d27e7c5bee22a417938d9988605 to a 110 bit search range and have the 1st 4 digits. I have worked on this daily for the past 2 months. and unfortunately do not have the hardware that would allow me to perform an optimal search in the range. I am willing to sell this info for the fair price of 1BTC. PM if interested. If you want a clue if what am offering is real...feel free to ask.
That public key is useless, why would we need it? Besides, if you have managed to reduce the size, you should continue reducing it further, unless your imaginary method doesn't actually work, but nice try asking 1 BTC for nothing. I will give you a public key and a range, if you can tell me it's first 3 characters, then I will ask you to reveal the 4 characters you claim to know to puzzle creator and receive your coin, deal? It actually is not useless. 026a0747b3229f32ce2f0f7bd77a7bd306f6c95d27e7c5bee22a417938d9988605 is the difference between the public key of puzzle 130 and the end range. Once you know it, you just need to subtract the private key of 026a...from the end range of puzzle 130 and then get the key of puzzle 130. Well, decide for yourself, why do you need to share money with someone? As for the equipment, there are no problems now. You can rent any server, even with huge RAM, or with powerful video cards.
|
|
|
How many keys are you generating in your DB? Are you using OPs github script versions? Or did you make any changes?
import secp256k1 as ice
def _point_subtraction(pubkey1_bytes, pubkey2_bytes): return ice.point_subtraction(pubkey1_bytes, pubkey2_bytes)
def point_subtraction(pubkey1_bytes, pubkey2_bytes): res = _point_subtraction(pubkey1_bytes, pubkey2_bytes) return bytes(bytearray(res))
target_public_key = "026ecabd2d22fdb737be21975ce9a694e108eb94f3649c586cc7461c8abf5da71a" target = ice.pub2upub(target_public_key)
num = 2**23 subtract= 2**10 subtract_pub= ice.scalar_multiplication(subtract)
with open('data-base.bin', 'wb') as binary_file: current_pubkey = target byte_accumulator = 0 bit_position = 0
for _ in range(num): current_pubkey = point_subtraction(current_pubkey, subtract_pub)
binary_data = int(current_pubkey.hex(), 16)
bit = 0 if str(binary_data).endswith(('0', '2', '4', '6', '8')) else 1
byte_accumulator = (byte_accumulator << 1) | bit bit_position += 1 if bit_position == 8: binary_file.write(byte_accumulator.to_bytes(1, byteorder='big')) byte_accumulator = 0 bit_position = 0
if bit_position > 0: byte_accumulator <<= (8 - bit_position) binary_file.write(byte_accumulator.to_bytes(1, byteorder='big')) import multiprocessing import random import secp256k1 as ice from bitstring import BitArray import psutil import mmap def kmp_prefix(pattern): prefix_table = [0] * len(pattern) j = 0 for i in range(1, len(pattern)): while j > 0 and pattern[i] != pattern[j]: j = prefix_table[j - 1] if pattern[i] == pattern[j]: j += 1 prefix_table[i] = j return prefix_table def kmp_search(text, pattern, prefix_table): j = 0 for i in range(len(text)): while j > 0 and text[i] != pattern[j]: j = prefix_table[j - 1] if text[i] == pattern[j]: j += 1 if j == len(pattern): return i - j + 1 return -1 def main_task(start, end, file_map): prefix_table = kmp_prefix(file_map) try: while True: pk = random.randint(start, end) target = ice.scalar_multiplication(pk) num = 64 # number of times sustract = 2**10 # amount to subtract each time sustract_pub = ice.scalar_multiplication(sustract) res = ice.point_loop_subtraction(num, target, sustract_pub) binary = '' for t in range(num): h = (res[t * 65:t * 65 + 65]).hex() hc = int(h[2:], 16) if str(hc).endswith(('0', '2', '4', '6', '8')): binary += "0" if str(hc).endswith(('1', '3', '5', '7', '9')): binary += "1" my_str = binary b = bytes(BitArray(bin=my_str)) match_position = kmp_search(file_map, b, prefix_table) if match_position != -1: inx = match_position * sustract Pk = (int(pk) + int(inx)) + int(inx) * 7 print(hex(Pk)) with open("win45.txt", "a") as data_file: data_file.write("Pk:" + " " + hex(Pk) + "\n") except KeyboardInterrupt: print("Процесс был прерван пользователем") return def worker(start, end, file_map): main_task(start, end, file_map) def split_range(start, end, num_splits): step = (end - start) // num_splits return [(start + i * step, start + (i + 1) * step) for i in range(num_splits)] if __name__ == '__main__': total_start = 2**44 total_end = 2**45 num_physical_cores = psutil.cpu_count(logical=False) with open("data-base.bin", "r+b") as f: file_map = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) range_splits = split_range(total_start, total_end, num_physical_cores) processes = [] try: for start, end in range_splits: p = multiprocessing.Process(target=worker, args=(start, end, file_map)) processes.append(p) p.start() for p in processes: p.join() except KeyboardInterrupt: print("Основной скрипт был прерван. Завершение всех процессов.") for p in processes: p.terminate() p.join() print("Все процессы успешно завершены.") file_map.close() The scripts have changed a little, but the general meaning is the same. Perhaps I made a mistake somewhere?
|
|
|
Another modified script using a modified version of your DB script. Incremental, BSGS, Meet in the Middle, lol. 48 Bit Range Results: This is the public key: 0291bee5cf4b14c291c650732faa166040e4c18a14731f9a930c1e87d3ec12debb
Building the Binary Database
Targeting PubKey: 0291bee5cf4b14c291c650732faa166040e4c18a14731f9a930c1e87d3ec12debb Number of PubKeys: 60,000,000 Writing to file every: 60,000,000 keys Subtract Value: 1 Space Covered: 60,000,000 / 0x3938700
DB Generation Time: 0:00:31.915161
Scanning Incrementally (BSGS?! Maybe Meet In The Middle?)
Current Key Position: 0x8000d693a3e2 Jumps Made: 30 PK Found: 191206974700443 PK Found: 0xade6d7ce3b9b
Search Time: 0:00:01.605224
Total Time: 0:00:01.606917
Not bad. Under 2 seconds to find the key in a 48 bit range. Less than 33 seconds combined with generating the DB. Testing different versions of the script, I can't get a result in puzzles higher than 42. How are you doing with your modified versions of the script?
|
|
|
updated 12/11/2023. #by mcdouglasx import secp256k1 as ice from bitstring import BitArray
print("creating Baby Step")
#create baby step
num = 2000000 # Keys number in Binary Babystep. same m in search script
Low_m= 20
lm= num // Low_m
Add = 1 Add_pub= ice.scalar_multiplication(Add)
res= ice.point_sequential_increment(lm, Add_pub)
binary = '' for t in range (lm):
h= (res[t*65:t*65+65]).hex() hc= int(h[2:], 16) if str(hc).endswith(('0','2','4','6','8')): A="0" binary+= ''.join(str(A)) if str(hc).endswith(('1','3','5','7','9')): A="1" binary+= ''.join(str(A))
my_str = (BitArray(bin=binary))#bin=binary
binary_file = open('baby_steps__binary.bin', 'ab') my_str.tofile(binary_file) binary_file.close()
for i in range (1,Low_m): print("stage: "+ str(i+1)+"/"+str(20)) lm_upub= ice.scalar_multiplication((lm*i))
res= ice.point_sequential_increment(lm, lm_upub)
binary = '' for t in range (lm):
h= (res[t*65:t*65+65]).hex() hc= int(h[2:], 16) if str(hc).endswith(('0','2','4','6','8')): A="0" binary+= ''.join(str(A)) if str(hc).endswith(('1','3','5','7','9')): A="1" binary+= ''.join(str(A))
my_str = (BitArray(bin=binary))#bin=binary
binary_file = open('baby_steps__binary.bin', 'ab') my_str.tofile(binary_file) binary_file.close()
Add = 1 Could this variable have a different meaning? Or is there an analogue in the second script? The fact is that when changing the value in this variable, the search script does not find matches.
|
|
|
This is the public key: f5c03157f4a489ed71c0df0f37799431b3f432654a9bd6efdbb79ba767b62e81 I need to find this private key: 821480591424854
Private key found!!! Collision! 258530638003543 604085cce892dbb8bf9e70959ef178bc78fb123caaa4e9b1f3521139542da57f For example, I got a collision, how to calculate the private key? The key 821480591424854 is in the range 2^49 - 2^50 Try with these parameters: start_key = 1 num_public_keys = 2**50 bits_to_store = 64 bytes_to_store = bits_to_store//8 rate_of_key_to_generate = 2**24
Did you use bits_to_store = 64? And the other parameters? start_key = 2**49 num_public_keys = 2**50 bits_to_store = 64 bytes_to_store = bits_to_store//8 rate_of_key_to_generate = 2**20 In general, I already figured it out, the difference is 2**49). By the way, how to calculate this parameter? Calculate the golden mean. When you set it above 2**26, the search script eats up all the RAM. If you decrease it, the size of the database increases. rate_of_key_to_generate = 2**20
|
|
|
The first version of the script worked, the second does not find matches. There may be an error in the code.
On my PC, 100 keys found out of 100, .... ![Huh](https://bitcointalk.org/Smileys/default/huh.gif) Did you set the same parameters in both scripts? About an hour and a half ago, I copied both scripts, created a database and launched the search script. I didn't change anything in the parameters. Ah, I uploaded a version of create_database that doesn't match with that version of the search_pk script Now it should work: To perform multiple search, for linux: time for i in {1..100}; do python3 search_pk_arulbero.py; done This is the public key: f5c03157f4a489ed71c0df0f37799431b3f432654a9bd6efdbb79ba767b62e81 I need to find this private key: 821480591424854
Private key found!!! Collision! 258530638003543 604085cce892dbb8bf9e70959ef178bc78fb123caaa4e9b1f3521139542da57f For example, I got a collision, how to calculate the private key?
|
|
|
The first version of the script worked, the second does not find matches. There may be an error in the code.
On my PC, 100 keys found out of 100, .... ![Huh](https://bitcointalk.org/Smileys/default/huh.gif) Did you set the same parameters in both scripts? About an hour and a half ago, I copied both scripts, created a database and launched the search script. I didn't change anything in the parameters.
|
|
|
4) my script finds the key every time? So far, yes. Ok, when I ran your original script, it was less than 20% of the time the key was found. Keep working on the database size. I know you will get it down! If you can get it down to 1 bit per key like the OPs, then you're onto something. His DB is unmatched so far. Less than 20%? Did you try with the last version? Maybe the first version was not correct, I fixed some stuff. I don't understand why: 1 bit for 2^32 key is better than 64bits for 2^32/2^20 = 2^12 keys. Less size, less search time, 100% keys found. The first version of the script worked, the second does not find matches. There may be an error in the code.
|
|
|
This script generates a database of 32 million keys (3.9 MB) in 3.5 seconds, it stores only 1 key each 64 keys, and only 8 bytes for each key #!/usr/bin/env python3 # 2023/Dec/03, arulbero_pub_key.py import secp256k1 as ice
############################################################################# # Set the number of public keys to generate and other parameters ############################################################################# start_key = 1 num_public_keys = 32000000 bits_to_store = 64 bytes_to_store = bits_to_store//8 rate_of_key_to_generate = 64 rate_of_key_to_store = rate_of_key_to_generate
interval_to_generate = range(start_key,num_public_keys+1, rate_of_key_to_store)
interval_to_store = range(start_key,num_public_keys+1,rate_of_key_to_store)
binary_mode = 1
#private_keys = list(interval_to_generate)
#############################################################################
if (binary_mode == 1):
f = open("public_keys_database.bin", "wb") #binary mode
###########generation################# public_keys=[] for i in interval_to_generate: #generate the other keys P = ice.scalar_multiplication(i) public_keys.append(P[33-bytes_to_store:33].hex())
###########writing the db############### for i in range(0,len(interval_to_store)): h = int(public_keys[i],16) f.write(h.to_bytes(bytes_to_store,byteorder='big')) f.close() else:
f = open("public_keys_database.txt", "w") ###########generation################# public_keys=[] for i in interval_to_generate: P = ice.scalar_multiplication(i) public_keys.append(P[33-bytes_to_store:33].hex())
###########writing the db############### for i in range(0,len(interval_to_store)): h = public_keys[i] f.write(h) f.close()
If you want to read the data, switch to "binary_mode = 0". With 2^32 keys (4 billions), it takes about 4 minutes to generates a db of 257 MB (1 key each 128 keys, 64 bits for key). This is quite interesting, but how can we use it, for example, to find puzzle 65?
|
|
|
How many keys are you trying to generate?! For me to make a 2^32 DB, it took over 5 hours. I used the low memory script and wrote to file 2^26 keys, roughly every 5 minutes. 64 (2^32 / 2^26) x 5 minutes = 320 minutes Also, just for info, a DB with 2^32 values = 524 MB (incredible!)
Can you share your script to create the database file? I want to create a file of size 2000000000 keys to test on puzzle 65. I have it prefilled out for you: #@mcdouglasx import secp256k1 as ice from bitstring import BitArray import bitcoin
print("Making Binary Data-Base")
target_public_key = "0230210c23b1a047bc9bdbb13448e67deddc108946de6de639bcc75d47c0216b1b"
target = ice.pub2upub(target_public_key)
num = 2000000000 # number of keys.
sustract = 1 #amount to subtract each time.
Low_m= 200
#2^28 / 2^ 26 = 4 #2^29 / 2^26 = 8 #2^30 / 2^26 = 16 #2^32 / 2^26 = 64
lm= num // Low_m
sustract_pub= ice.scalar_multiplication(sustract)
res= ice.point_loop_subtraction(lm, target, sustract_pub) binary = '' for t in range (lm):
h= (res[t*65:t*65+65]).hex() hc= int(h[2:], 16) if str(hc).endswith(('0','2','4','6','8')): A="0" binary+= ''.join(str(A)) if str(hc).endswith(('1','3','5','7','9')): A="1" binary+= ''.join(str(A))
my_str = bytes(BitArray(bin=binary))
binary_file = open('130Bit.bin', 'wb') binary_file.write(my_str) binary_file.close()
for i in range (1,Low_m): mem= ice.to_cpub(ice.scalar_multiplication(lm).hex()) Apk= bitcoin.multiply(mem, i) Apk_upu= ice.pub2upub(Apk)
A1= ice.point_addition(target, Apk_upu)
sustract_pub= ice.scalar_multiplication(sustract)
res= ice.point_loop_subtraction(lm, A1, sustract_pub) binary = '' for t in range (lm):
h= (res[t*65:t*65+65]).hex() hc= int(h[2:], 16) if str(hc).endswith(('0','2','4','6','8')): A="0" binary+= ''.join(str(A)) if str(hc).endswith(('1','3','5','7','9')): A="1" binary+= ''.join(str(A))
my_str = bytes(BitArray(bin=binary))
binary_file = open('65Bit.bin', 'ab') binary_file.write(my_str) binary_file.close()
It will write to file, every 10,000,000 keys. Let me know if it works for you. binary_file = open('130Bit.bin', 'wb') ---------------------------------------- binary_file = open('65Bit.bin', 'ab') I understand the meaning, only the names of the files need to be changed)
|
|
|
|