Bitcoin Forum
May 05, 2024, 05:21:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 [3]
41  Bitcoin / Development & Technical Discussion / Re: python script compare lines in 2 text files and output matches on: September 10, 2019, 08:04:00 PM

can you correct this code:

Code:
from coinkit.keypair import BitcoinKeypair

with open("prvkey.txt","r") as f:
    in_prvkey = f.readlines()
in_prvkey = [x.strip() for x in in_prvkey]
f.close()
#print  in_prvkey

outfile = open("prvkey2add.txt","w")
for x in in_prvkey:
  k = BitcoinKeypair(x)
  print k
 
outfile.write(k.address(x)+"\n")
outfile.close()


the output file part Huh

(kindly also adding some library that up to date and support all prvtkys format )
- read private keys from a file
- output public address
42  Bitcoin / Development & Technical Discussion / Re: Python script for testing a bunch of bitcoin private keys on: September 10, 2019, 07:29:20 PM

Assuming that private key is valid, that means the library doesn't support WIF (with compressed key) format. You might want to convert it to WIF (uncompressed key) or use another library such as https://github.com/ofek/bit.

Besides, library mentioned by @seoincorporation is outdates (last commit in 2014)


yes my key valid and tested: 5JFJnRWLYgPV8vrhzmox8rHru42ACUnM8Y44eG7QtFqPUCyHdRP
this key not (5JFJnRWLYgPV8vrhzmox8rHru42ACUnM8Y44eG7QtFqPUCyHdRP)

i need to work offline  Undecided  this wint help https://github.com/ofek/bit.



could you please take a look and fix this Cry
Code:
from coinkit.keypair import BitcoinKeypair

with open("prvkey.txt","r") as f:
    in_prvkey = f.readlines()
in_prvkey = [x.strip() for x in in_prvkey]
f.close()
#print  in_prvkey

outfile = open("prvkey2add.txt","w")
for x in in_prvkey:
  k = BitcoinKeypair(x)
  print k
 
outfile.write(k.address(x)+"\n")
outfile.close()

-read private keys [and support all keys format] from a file
-give output public addresses all line by line [only addresses]
 Embarrassed
43  Bitcoin / Development & Technical Discussion / Re: python script compare lines in 2 text files and output matches on: September 10, 2019, 02:13:20 PM
make sure your indentations are correct... Tab =/= space

As for writing to a file...
file= open("outputfile.txt","a+")
file.write("key %s\r\n" % firstline)
file.close()

I'll be heading home for the day, if you have more questions... Don't hesitate to ask them, i'll be answering them tomorrow (or somebody else will probably help you out in my absence)

it print correct result
but in outputfile.txt file always containing the last line in file1 Undecided

have a good day


now i am using this batch for temporally solution
Code:
@echo off
comprs.py >> 3.txt
exit
44  Bitcoin / Development & Technical Discussion / Re: python script compare lines in 2 text files and output matches on: September 10, 2019, 01:50:07 PM
i tried to add a line to redirecting print output to a 3.txt  Undecided

i need the proper line
 
Code:
 print(firstline)	, file=open("3.txt", "a"))
errors 
>>IndentationError: unexpected indent
>>SyntaxError: invalid syntax
45  Bitcoin / Development & Technical Discussion / Re: python script compare lines in 2 text files and output matches on: September 10, 2019, 01:41:40 PM
in python, that's relatively easy...
I wrote this code from memory (and copy/pasted 2 lines from the source i mentioned below), it should work, but typos might happen

Code:
firstfile= [line.rstrip('\n') for line in open("textfile_containing_first_list.txt")]
secondfile= [line.rstrip('\n') for line in open("textfile_containing_second_list.txt")]
for firstline in firstfile:
  if firstline in secondfile:
    print(firstline)

part of the source : https://qiita.com/visualskyrim/items/1922429a07ca5f974467 (i was to lazy to write a loop over a filehandle from memory)

5 STARS Grin Grin Grin
thank you so much
46  Bitcoin / Development & Technical Discussion / Re: Python script for testing a bunch of bitcoin private keys on: September 10, 2019, 01:29:49 PM
i found the python script i used in the past for the same propose, it's called coinkit:

Code:
from coinkit.keypair import BitcoinKeypair
k = BitcoinKeypair('5Jx4txgXUCe1kP8mBLEZrLSsZm9WRin8xijWvVW8RACzHn2ZzBH')
d = k.address()
print (d)

For more information look at: https://github.com/mflaxman/coinkit

i made few changes
to read filess contain prvtkey
and give pubadd as output

can you please take a look and fix it Undecided
Code:
from coinkit.keypair import BitcoinKeypair

with open("prvkey.txt","r") as f:
    in_prvkey = f.readlines()
in_prvkey = [x.strip() for x in in_prvkey]
f.close()
#print  in_prvkey

outfile = open("prvkey2add.txt","w")
for x in in_prvkey:
  k = BitcoinKeypair(x)
  print k
 
outfile.write(k.address(x)+"\n")
outfile.close()
47  Bitcoin / Development & Technical Discussion / Re: Python script for testing a bunch of bitcoin private keys on: September 10, 2019, 01:23:42 PM
why do you have so many keys to check anyways?

many satoshi's bitcoin are missing out there for someone to take them Cool
i want to take my chances of getting one of this lost wallets Grin

Ridiculous. Why the hell did you even mention that "100k to 500k" range?
this number help me to estimate the time needed to treat for big files all i do after is *10 or *100
500k few sec...etc
48  Bitcoin / Development & Technical Discussion / Re: Python script for testing a bunch of bitcoin private keys on: September 10, 2019, 12:59:47 PM
why do you have so many keys to check anyways?

many satoshi's bitcoin are missing out there for someone to take them Cool
i want to take my chances of getting one of this lost wallets Grin
49  Bitcoin / Development & Technical Discussion / python script compare lines in 2 text files and output matches on: September 10, 2019, 12:42:29 PM
compare  every lines in file1 with lines in file2
string comparative not only first number

do this

file1
Code:
1FFYY4EGHTVBWHEQbPcceME9YA6BWnEJxK
1GYeVf48v55hWHwynqgpXSnP84A96K9JxJ
1Ji25E8DaLpsgekWhkQk4UG5L6pz468EKy
1K5MT7BbKvCj4YeALeoEQr5sK2bH2uZdWi
1KRQjx2T31HC5boSoj9h3eMxHPkTFVtcJX

file2
Code:
1C1wxy5pcFj9KBFDFFnVyUYr7puT8abHaW	
1K5MT7BbKvCj4YeALeoEQr5sK2bH2uZdWi
1Ly8X7xSoJdM6nfZSi1HDQuBjMjiuiev1r
12ux1FpMq5iJ14wycDV2DpBcqxHTTGPSjC
16jw8vgKjA8DThTwpBb3pfk6tGbMHWnz6x

output
Code:
1K5MT7BbKvCj4YeALeoEQr5sK2bH2uZdWi
50  Bitcoin / Development & Technical Discussion / Re: Python script for testing a bunch of bitcoin private keys on: September 10, 2019, 12:10:38 PM
I reply again because i found the python script i used in the past for the same propose, it's called coinkit:
Code:
from coinkit.keypair import BitcoinKeypair
k = BitcoinKeypair('5Jx4txgXUCe1kP8mBLEZrLSsZm9WRin8xijWvVW8RACzHn2ZzBH')
d = k.address()
print (d)

For more information look at: https://github.com/mflaxman/coinkit

thank you for the 4 linescode Kiss
but it not working for all keys

Code:
from coinkit.keypair import BitcoinKeypair
k = BitcoinKeypair('5JFJnRWLYgPV8vrhzmox8rHru42ACUnM8Y44eG7QtFqPUCyHdRP')
d = k.address()
print (d)

>getaddress.py
1crof2axcuUxNc6aBkNM9aoawoJxpf8vg

Code:
from coinkit.keypair import BitcoinKeypair
k = BitcoinKeypair('L3inaKfhAkUWJfDP3y7Cu26iAe7BsKPHu71NeZCXZzgVgdXMxrAR')
d = k.address()
print (d)

>getaddress.py
  File "getaddress.py", line 1

    >getaddress.py
    ^
SyntaxError: invalid syntax
51  Bitcoin / Development & Technical Discussion / Re: the relation with private keys and pubic keys? on: September 09, 2019, 10:05:57 PM
i am looking for some codes that only use a specific characters not all base58 ?
No, unfortunately this is not possible.
The only way to go is like this: private key -> public key -> address.

It is not possible because you are not generating public addresses , but privatekeys.

You are thinking that you need a public address of just a few characters, but that's not what you need. You need the private keys of that address. Understand the difference?

is it possible to get p2pkh bitcoin addresses throw a passphrase or seed?
52  Bitcoin / Development & Technical Discussion / Re: the relation with private keys and pubic keys? on: September 09, 2019, 09:58:59 PM
Also, finding such an address will take longer than you think.

you can't
your chance few trillions of trillions lighting years
53  Bitcoin / Development & Technical Discussion / Re: the relation with private keys and pubic keys? on: September 09, 2019, 09:51:19 PM
not bruteforce generating and comparing Grin totally offline no public database needed  Grin
there's no other way to do that, and you can do it offline
finding/generating specific public address can only be done
by randomly generating private key and checking the corresponding public address

i am looking for some codes that only use a specific characters not all base58 ?
by adding the -r regex (regular expression) option to the vanitygen
you can set it to find addresses contain only those 22 alphabets

I'm not sure this right but for example, regex ^1crof[0-9].*$
it will find addresses that start with 1crof and followed only by numbers

this is what i was looking for Wink
54  Bitcoin / Development & Technical Discussion / Re: the relation with private keys and pubic keys? on: September 09, 2019, 08:08:50 PM
You are looking for a vanity generator.

You want more 1crof addresses, right?
Those programs work like this.  You specify that you want 1crof in your address.

So this program will bruteforce thousands of privatekeys and see if any of them matches 1cfofs in their public addresses. It is a long a slow process. The longest is the phrase you want, the longest will be your waiting time until the program finds the privatekey for that address.

There is this guide dome by 1miau
https://bitcointalk.org/index.php?topic=5096373.0

vanity almost old like bitcoin Tongue

1crof2axcuUxNc6aBkNM9aoawoJxpf8vg
5JFJnRWLYgPV8vrhzmox8rHru42ACUnM8Y44eG7QtFqPUCyHdRP

not bruteforce generating and comparing Grin totally offline no public database needed  Grin

i am looking for some codes that only use a specific characters not all base58 ?
55  Bitcoin / Development & Technical Discussion / Re: Python script for testing a bunch of bitcoin private keys on: September 09, 2019, 07:59:36 PM
The problem about this is that you need two steps, the first one (and the easy one) is to get the address from the private key, for that you can use a tool like this:

https://github.com/blockstack/pybitcoin

And the second step is the complex one... Verify the address balance, for this, you can use an API from some block explorer to verify if the address has balance, or another way is to do it directly with bitcoin core.

But i think the best way to do it and to save time is to import all those private keys to bitcoin core, that way you will not waste time calling the API to verify if they have balance or not.

thank you for replying

i used electrum to extract public address but crashing

can i find this?

SOMECODES.py  file_contain_private_keys.txt output>> file_contain_public_keys.txt

56  Bitcoin / Development & Technical Discussion / the relation with private keys and pubic keys? on: September 09, 2019, 03:53:58 PM
for example

i have this address:

1crof2axcuUxNc6aBkNM9aoawoJxpf8vg

containing charterers : 1crof2axuUN6BkM9wJp8vg [22 charterers ]


is it possible to generate some addresses somehow using only this  [22 charterers ]

base22




 
57  Bitcoin / Development & Technical Discussion / Re: Python script for testing a bunch of bitcoin private keys on: September 09, 2019, 03:24:08 PM

do something like
- read public address from a file
- check for balance and tx
- print output

with more option:
- get the public key from the private key and test it with blockchain api
- check for balance and tx
- print output

58  Bitcoin / Development & Technical Discussion / Python script for testing a bunch of bitcoin private keys on: September 09, 2019, 03:07:28 PM
hello,

can anyone help or direct me where i can find it

it will better if the script test files with 100k to 500k bitcoin privates keys
Pages: « 1 2 [3]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!