Author

Topic: Ckey to WIF (Read 148 times)

member
Activity: 115
Merit: 68
October 05, 2023, 04:45:52 AM
#4
For JavaScript: SeedTool -> Single Address Tool. https://github.com/BitcoinQnA/seedtool
full member
Activity: 244
Merit: 126
June 04, 2023, 10:20:08 PM
#3
...

Thank you very much!

Works like a charm!
hero member
Activity: 510
Merit: 4005
June 04, 2023, 08:29:12 PM
#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 |
+-------------+-------------------------------------------------------------+
full member
Activity: 244
Merit: 126
June 04, 2023, 07: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.
Jump to: