Bitcoin Forum
May 01, 2024, 01:39:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Ckey to WIF  (Read 147 times)
pbies (OP)
Full Member
***
Offline Offline

Activity: 244
Merit: 126



View Profile
June 04, 2023, 11:16:00 PM
 #1

How to convert unencrypted ckey to Wallet Import Format?

I am looking for a Python or JavaScript solution.

Let's say I have ckey in bytes format or hex, need to convert it to WIF as bytes or string.

BTC: bc1qmrexlspd24kevspp42uvjg7sjwm8xcf9w86h5k
I have 9900K and 1080 Ti, gathering funds for new desktop PC for Bitcoin operations - 14900K and RTX 4090
1714527569
Hero Member
*
Offline Offline

Posts: 1714527569

View Profile Personal Message (Offline)

Ignore
1714527569
Reply with quote  #2

1714527569
Report to moderator
The block chain is the main innovation of Bitcoin. It is the first distributed timestamping system.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714527569
Hero Member
*
Offline Offline

Posts: 1714527569

View Profile Personal Message (Offline)

Ignore
1714527569
Reply with quote  #2

1714527569
Report to moderator
PowerGlove
Hero Member
*****
hacker
Offline Offline

Activity: 510
Merit: 3981



View Profile
June 05, 2023, 12:29:12 AM
Merited by seoincorporation (3), pbies (1)
 #2

How to convert unencrypted ckey to Wallet Import Format?
I wrote a Python script late last year that can convert raw scalars into addresses (and WIFs), here it is: [Code] Generating addresses from scratch (Python 3.6+).

If you have a raw scalar (e.g. 0xb46ed3fbb61ed98b2f8791fc9c79ba382e187140a7326ca03d7204d705a6586d), then you can supply it to the script, like this:

Code:
$ python3 make_address.py 0xb46ed3fbb61ed98b2f8791fc9c79ba382e187140a7326ca03d7204d705a6586d

That will output the following (WIFs highlighted):

       +------+--------------------+
       | Type | Legacy, Compressed |
    +--+------+--------------------+---------------+
    | Address | 1L5hbU5BnNC9PWdJLqQUdUTC1FqvCZG1go |
+---+---------+------------------------------------+-----------------------+
| Private Key | p2pkh:L3GSzNCJjj4z1UmSkPUxc8aUrnJ6VbGsKq3kxyVWkEdVXM8S1pnF |
+-------------+------------------------------------------------------------+
       +------+---------------+
       | Type | Native SegWit |
    +--+------+---------------+----------------------------+
    | Address | bc1q69xlp2mjka4w0nywe4eps97gk3ryu968p98amh |
+---+---------+--------------------------------------------+----------------+
| Private Key | p2wpkh:L3GSzNCJjj4z1UmSkPUxc8aUrnJ6VbGsKq3kxyVWkEdVXM8S1pnF |
+-------------+-------------------------------------------------------------+
pbies (OP)
Full Member
***
Offline Offline

Activity: 244
Merit: 126



View Profile
June 05, 2023, 02:20:08 AM
 #3

...

Thank you very much!

Works like a charm!

BTC: bc1qmrexlspd24kevspp42uvjg7sjwm8xcf9w86h5k
I have 9900K and 1080 Ti, gathering funds for new desktop PC for Bitcoin operations - 14900K and RTX 4090
Greg Tonoski
Member
**
Offline Offline

Activity: 115
Merit: 68


View Profile
October 05, 2023, 08:45:52 AM
 #4

For JavaScript: SeedTool -> Single Address Tool. https://github.com/BitcoinQnA/seedtool
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!