Bitcoin Forum
May 02, 2024, 12:02:23 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Mass Private Key to Bitcoin Address Converter  (Read 1859 times)
Patrick349 (OP)
Member
**
Offline Offline

Activity: 117
Merit: 250


View Profile
August 09, 2016, 10:01:56 AM
Last edit: March 27, 2018, 08:06:55 PM by Patrick349
 #1

I search a Mass Private Key to Bitcoin Address Converter.
1714608143
Hero Member
*
Offline Offline

Posts: 1714608143

View Profile Personal Message (Offline)

Ignore
1714608143
Reply with quote  #2

1714608143
Report to moderator
1714608143
Hero Member
*
Offline Offline

Posts: 1714608143

View Profile Personal Message (Offline)

Ignore
1714608143
Reply with quote  #2

1714608143
Report to moderator
1714608143
Hero Member
*
Offline Offline

Posts: 1714608143

View Profile Personal Message (Offline)

Ignore
1714608143
Reply with quote  #2

1714608143
Report to moderator
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714608143
Hero Member
*
Offline Offline

Posts: 1714608143

View Profile Personal Message (Offline)

Ignore
1714608143
Reply with quote  #2

1714608143
Report to moderator
1714608143
Hero Member
*
Offline Offline

Posts: 1714608143

View Profile Personal Message (Offline)

Ignore
1714608143
Reply with quote  #2

1714608143
Report to moderator
xcbtrader
Hero Member
*****
Offline Offline

Activity: 865
Merit: 1006


View Profile
August 09, 2016, 10:59:58 AM
 #2

Hey Guys,

I have a list of private keys and I want translate them to their Bitcoin Addresses. Is their any tool (with GUI) that can easily transform a textfile with private keys inside it to a list of their addresses?

I hope somebody can help me. Smiley

Best regards,

Patrick Smiley

easy in python

Code:
__author__ = 'xcbtrader'
# -*- coding: utf-8 -*-

from bitcoin import *

f = open('file with private.txt', "r")
privates = []
linia = f.readline()

while linia != "":
    linia = linia[0 :-1]
    privates.append (linia)
    linia = f.readline()

f.close()

for priv in privates:
    pub = privtopub(priv)
    addr = pubtoaddr(pub)
    wif = encode_privkey(priv, 'wif')
    print addr
    print wif


fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 266


View Profile
August 09, 2016, 12:07:11 PM
 #3

Find someone to google it for you!

Bitwasp Developer.
chrisvl
Legendary
*
Offline Offline

Activity: 1274
Merit: 1006

Trainman


View Profile WWW
August 09, 2016, 01:17:36 PM
 #4

Hey Guys,

I have a list of private keys and I want translate them to their Bitcoin Addresses. Is their any tool (with GUI) that can easily transform a textfile with private keys inside it to a list of their addresses?

I hope somebody can help me. Smiley

Best regards,

Patrick Smiley

easy in python

Code:
__author__ = 'xcbtrader'
# -*- coding: utf-8 -*-

from bitcoin import *

f = open('file with private.txt', "r")
privates = []
linia = f.readline()

while linia != "":
    linia = linia[0 :-1]
    privates.append (linia)
    linia = f.readline()

f.close()

for priv in privates:
    pub = privtopub(priv)
    addr = pubtoaddr(pub)
    wif = encode_privkey(priv, 'wif')
    print addr
    print wif


Sorry, I istalled python but I don't really know how to use it... could you just say me how to use your code? Smiley
open your favorite text editor / notepad paste in the code and save it as .py e.g converter.py

xcbtrader
Hero Member
*****
Offline Offline

Activity: 865
Merit: 1006


View Profile
August 09, 2016, 02:26:09 PM
 #5

Hey Guys,

I have a list of private keys and I want translate them to their Bitcoin Addresses. Is their any tool (with GUI) that can easily transform a textfile with private keys inside it to a list of their addresses?

I hope somebody can help me. Smiley

Best regards,

Patrick Smiley

easy in python

Code:
__author__ = 'xcbtrader'
# -*- coding: utf-8 -*-

from bitcoin import *

f = open('file with private.txt', "r")
privates = []
linia = f.readline()

while linia != "":
    linia = linia[0 :-1]
    privates.append (linia)
    linia = f.readline()

f.close()

for priv in privates:
    pub = privtopub(priv)
    addr = pubtoaddr(pub)
    wif = encode_privkey(priv, 'wif')
    print addr
    print wif


Sorry, I istalled python but I don't really know how to use it... could you just say me how to use your code? Smiley
open your favorite text editor / notepad paste in the code and save it as .py e.g converter.py

Only you need a text editor. Copy this code, and save to address.py (or other name)
You need the bitcoin library for run the program.
If you have pip installed  open comand window and type:

pip install bitcoin

Please, this library and program works fine in python 2.7, but not in python 3.4

The link of the library is:

https://github.com/vbuterin/pybitcointools


hhanh00
Sr. Member
****
Offline Offline

Activity: 467
Merit: 266


View Profile
August 10, 2016, 01:38:19 PM
Merited by Evillo (1)
 #6

Somewhat shorter

Code:
from bitcoin import *

with open("privkeys.txt") as f:
for line in f:
print(pubtoaddr(privtopub(line.strip())))

gsciservices
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
March 28, 2021, 08:12:21 AM
 #7

Somewhat shorter

Code:
from bitcoin import *

with open("privkeys.txt") as f:
for line in f:
print(pubtoaddr(privtopub(line.strip())))





Hi,
Any possibilities to making addrtopub as above:

from bitcoin import *

with open("addr.txt") as f:
   for line in f:
      print(addrtopub(addrtopub(line.strip())))
plexasm
Jr. Member
*
Offline Offline

Activity: 95
Merit: 4


View Profile
April 03, 2021, 10:34:28 PM
 #8

Electrum supports this, just use Electrum
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10521



View Profile
April 04, 2021, 02:37:44 AM
 #9

Electrum supports this, just use Electrum
Electrum, as a wallet, has the option to import private keys and will add those keys with their corresponding addresses to its wallet file. The file that is a plain JSON and slows down the application significantly when the size of this wallet file grows big.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
gsciservices
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
April 04, 2021, 08:46:08 PM
 #10

Electrum supports this, just use Electrum


Already tried it Electrum; output is not public key. Only tx hash avaiable....
I have addr to pubkey python script:
python2.2.18

import time
import requests

addresses = open('addr.txt', 'r').read().split('\n')

for address in addresses:
    if address == '':
        continue

    response = requests.get('https://blockchain.info/q/pubkeyaddr/' + address)
    if response.status_code == 200:
        if response.text != '':
            open('pubkeys.txt', 'a').write(address + ' : ' + response.text+"\n")


It was published pub key only spent from address; unfortunately 16jY7qLJnxb7CHZyqBP8qca9d51gAjyXQN not find pub key. Could you please modified it which output any wallet address to pub key.
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10521



View Profile
April 05, 2021, 02:16:10 AM
 #11

It was published pub key only spent from address; unfortunately 16jY7qLJnxb7CHZyqBP8qca9d51gAjyXQN not find pub key. Could you please modified it which output any wallet address to pub key.
Block explorers can not perform magic, they simply look up the history involving that address and if any coin has ever been spent from that address they simply extract its public key. In this case this address has never been used (spent from) which means the public key is not yet revealed.
To be more specific, if any of its coins were spent then it is too late for you because it means someone already solved the puzzle involving this address Wink

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
fxsniper
Member
**
Offline Offline

Activity: 406
Merit: 45


View Profile
April 07, 2021, 12:56:37 PM
 #12

Can possible update code to write file output

may be good for export to file is better print out if it is massive may be 1 million or billion key it need to save to file
marissia
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
April 08, 2021, 10:42:12 AM
 #13

 Cry still no answer!! people please update code to output file!!
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
April 15, 2021, 11:06:10 PM
 #14

Can possible update code to write file output

may be good for export to file is better print out if it is massive may be 1 million or billion key it need to save to file
Cry still no answer!! people please update code to output file!!

Are you wanting the code to be updated for the private key to address converter that this thread was originally about... or for the "address to pubkey" converter that gsciservices was looking for?

For the former... You don't need to bother with opening a file and writing the output in the Python script itself. Simply redirect the output of the script to a file from the commandline... ie. for linux:
Code:
python your_script.py > your_outfile_name.txt

Windows supports something similar.


If you're wanting the address to public key... well as pooya87 noted, it's asking the impossible if the address has not been "spent" from... you cannot go from address -> public key as public key -> address uses one way hash functions.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
btc-room101
Member
**
Offline Offline

Activity: 182
Merit: 30


View Profile WWW
April 19, 2021, 02:26:29 AM
 #15

I search a Mass Private Key to Bitcoin Address Converter.

There is a tool called 'KU' in the pycoin python library, it gets installed in your bin when you install the lib

Here using private-key '1' as an example

DOS-Prompt: "ku 1"

input                        : 1
network                      : Bitcoin mainnet
symbol                       : BTC
secret exponent              : 1
 hex                         : 1
wif                          : KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn
 uncompressed                : 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
public pair x                : 55066263022277343669578718895168534326250603453777594175500187360389116729240
public pair y                : 32670510020758816978083085130507043184471273380659243275938904335757337482424
 x as hex                    : 79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
 y as hex                    : 483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
y parity                     : even
key pair as sec              : 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
 uncompressed                : 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\
                                 483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
hash160                      : 751e76e8199196d454941c45d1b3a323f1433bd6
 uncompressed                : 91b24bf9f5288532960ac687abb035127b1d28a5
Bitcoin address              : 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH
Bitcoin address uncompressed : 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm
Bitcoin segwit address       : bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
p2sh segwit                  : 3JvL6Ymt8MVWiCNHC7oWU6nLeHNJKLZGLN
 corresponding p2sh script   : 0014751e76e8199196d454941c45d1b3a323f1433bd6

Note that you get all this info, you pick what you want, 'bitcoin address' is there, then use awk/sed to strip which line/data u want, write a batch file to convert all your private keys to addresses, if you want fast, then study 'ku' source, and write your own python script

Most people use the h160 format as it requires the least storage, and is easy to map to any address format.

If you have say 100M private keys, then you want to use h160, and you'll need 4TB disk-storage on your desktop.

Study the output of KU, learn what all this stuff is, the source can show you which call's in python do the transformation of format
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!