Bitcoin Forum
June 22, 2018, 02:18:15 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: I want to convert a .txt file of 998,000 sha-256 hexadecimal addresses  (Read 96 times)
Elysium Miner
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
March 06, 2018, 10:40:15 AM
 #1

I have been looking all over the web for a simple program that will scrape the sha2 hex addresses from the file and provide me with both compressed/uncompressed WIF private keys.  Can anyone help me?
1529633895
Hero Member
*
Offline Offline

Posts: 1529633895

View Profile Personal Message (Offline)

Ignore
1529633895
Reply with quote  #2

1529633895
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
RGBKey
Hero Member
*****
Offline Offline

Activity: 756
Merit: 615


rgbkey.github.io/pgp.txt


View Profile WWW
March 06, 2018, 11:26:50 PM
 #2

Are these hex addresses raw private keys? Or are they something else? If you just have a hash of something, I don't see how that could correspond to a Bitcoin private key.

DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1357



View Profile
March 07, 2018, 01:07:39 AM
 #3

. . . scrape . . . addresses from the file and provide me with . . . WIF private keys.  Can anyone help me?

It is NOT possible to generate a private key from an address.

Perhaps you have hex private keys in the file?

Perhaps you have SHA256 hashes in the file in hex format and you want to convert those hashes into WIF format so that you can use them as private keys?

Elysium Miner
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
March 07, 2018, 02:24:30 AM
 #4

http://<img src='https://i.imgur.com/zxzQ7g8.png' />

I know you are trying to helpful but it does say exactly what I mean in the title.
A SHA-256 hash is HEXADECIMAL & Yes it can represent a WIF bitcoin address, 2,  in fact....
RGBKey
Hero Member
*****
Offline Offline

Activity: 756
Merit: 615


rgbkey.github.io/pgp.txt


View Profile WWW
March 07, 2018, 02:44:36 AM
 #5




I know you are trying to helpful but it does say exactly what I mean in the title.
A SHA-256 hash is HEXADECIMAL & Yes it represents a bitcoin address, 2,  in fact....

What you show in that picture is a private key in hexadecimal format, but it has nothing to do with SHA256 or any hash function. (Hash function output is usually represented as hex, but just because something is in hex does not mean it is the output of a hash function). What you want to do is take a private key encoded in hex, and re-encode it in WIF in both compressed and non-compressed mode. I'm not sure why you would want 1,996,000 Bitcoin addresses, half made from compressed keys and half not, but it's unlikely that anybody has made a script to do this. It could be done though.

I should stress that if for whatever reason wherever you got this data from was public, or you could believe that there's even a small chance that someone else would have access to the same list of hex data you have, that using that data as Bitcoin private keys would be a very, very bad idea because somebody else could use that data to generate the same private keys and take any money you would have sent to those addresses.

Even still, there are much better ways to generate large numbers of addresses with Hierarchical Deterministic wallets. I highly suggest you look into those.

DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1357



View Profile
March 07, 2018, 02:56:27 AM
 #6

I know you are trying to helpful but it does say exactly what I mean in the title.

No.  It does not.

Words have meaning.  Use the right words, and you can convey your thoughts.  Use the wrong words, and people won't understand you.

A SHA-256 hash is HEXADECIMAL

A SHA256 hash is an integer.  It can be represented as a decimal, a hexadecimal, a binary, an octal, or any other radix you like.

Hexadecimal is one common method of displaying the integer results of a SHA256 hash.

& Yes it represents a bitcoin address, 2,  in fact....

No.

A SHA256 hash is a 256 bit digest that represents the input data.

A bitcoin private key is also a 256 bit integer.  It also can be represented as a decimal, a hexadecimal, a binary, an octal, or even WIF.

However:
the maximum SHA256 value is:  0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
the maximum valid Bitcoin Private key is: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140

So, not all SHA256 hash values are valid Bitcoin private keys.

Also note.  Your posted image states "Private Key Hexadecimal Format", you are mistaken to call it a "SHA256 hash".

Finally, it is NOT an address at all.  The addresses in your pasted image are:
1Cy7oiyrGzHaz9JVinnMe6UXZApR4nw5et  (Uncompressed)
1KaDXeEAMEnm3nEpDzd88DmaxKApxUFZQx (Compressed)

If you only have either of those addresses, then it is not possible to generate the private key.

So, what you appear to have (based on your image, and what I can make of your misunderstanding of how to use your words) is a set of PRIVATE KEYS in Hexadecimal format, and what you want to do is represent that private key in both compressed WIF and uncompressed WIF?

If that is so, then you can probably pay someone to create such a program for you.  It would be pretty easy to create, but there aren't many that will do it for free.

EDIT: It looks like such an open source tool exists. See LoyceV post below.


LoyceV
Legendary
*
Offline Offline

Activity: 1162
Merit: 1513


Howdy


View Profile WWW
March 07, 2018, 08:27:47 AM
 #7

Bitcoin tool may be what you're looking for.

Elysium Miner
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
March 07, 2018, 12:24:52 PM
 #8

I can advance $150 USD to whoever wants to make this program and post it on Github as opensource.  You must already have a reputable repository with something of value listed in it.
You can private message me for more info if you are interested.
Elysium Miner
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
March 07, 2018, 04:18:47 PM
 #9

I can advance $150 USD to whoever wants to make this program and post it on Github as opensource.  You must already have a reputable repository with something of value listed in it.
You can private message me for more info if you are interested.

Did you see the post above from LoyceV?

It looks like such a tool already exists.

It appears that usage in linux would likely be:

Code:
cat FILENAME_OF_YOUR_FILE_FULL_OF_HEX_KEYS_HERE | bitcoin-tool --input-type private key --input-format hex --output-type --private-key-wif --output-format base58check --input-file - --batch --network bitcoin

I tried this command and about 10 other variations;  nothing happens.


DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1357



View Profile
March 07, 2018, 05:04:59 PM
 #10

I tried this command and about 10 other variations;  nothing happens.

Hmm.

I just went with what was written in the usage information on the github page.

I don't have time to look at the code and figure out the actual usage right now.  If nobody else explains the proper usage in the next few days, I'll see if I can find the time to look it up.

HCP
Hero Member
*****
Offline Offline

Activity: 644
Merit: 814

<insert witty quote here>


View Profile
March 07, 2018, 09:00:08 PM
 #11

Seems you would need to include the --public-key-compression argument... As per the readme:
--public-key-compression : Can be one of :
      auto         : determine compression from base58 private key (default)
      compressed   : force compressed public key
      uncompressed : force uncompressed public key
    (must be specified for raw/hex keys, should be auto for base58)

...
Specifying --public-key-compression is mandatory because the WIF output is different depending on which public key compression type you choose, and there is no way to guess from a raw private key.

Also, you need to change the "output-type" as the private-key-wif should not have the leading "--" and the input-type was missing a '-', should be "private-key"

So you'd probably want:
Code:
bitcoin-tool --input-type private-key --input-format hex --output-type private-key-wif --output-format base58check --input-file FILENAME_OF_YOUR_FILE_FULL_OF_HEX_KEYS_HERE --batch --network bitcoin --public-key-compression compressed


Tested using Input File:
Code: (hex.txt)
C0D39382668560A3477537D176D16E11DDBA95C15C9F1A2AF145CC791E059ACC
5BD497C3AB798BBACF58B67387AA147356E0DD2BD37D5EA363C2A95712708038
F5FD159DA47B33F325A7944D154C155198F5747E7009294A28258CD8F1E31301
Command line:
Code:
bitcoin-tool --input-type private-key --input-format hex --output-type private-key-wif --output-format base58check --input-file hex.txt --batch --network bitcoin --public-key-compression compressed
Output:
Code:
L3gYHxbnWWYk1cojMcRf1sZi5FkmsEHJgxLjmuTcJT5sWd79ZAou
KzJDZ7LY5xVHPa2cyaZjqLRPRpqiEBJcxbBy13NjHJYcne6uzfLC
L5Tt2afWZCZuiZYXocQPzbyRHFTwaP4Rza9Gp5zSE6JFjX9DnDja

Then just change to --public-key-compression uncompressed for your uncompressed keys


NOTE: it would appear that the input file MUST be formatted with Unix "End of Line" character (LF) only... it choked on (CR LF):
Quote
Invalid character (ASCII=13) at offset 64
Failed to decode hex input (invalid format).

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!