Monday, February 12, 2024
HomeBitcoinelectrum - Retrieving a WIF bits non-public key

electrum – Retrieving a WIF bits non-public key


Suppose I’ve a Wif non-public key from Electrum 4.0.9:

L2pt3eVopnxfBBvMwrJV2saZeAyQfF77UQSH5WGj5q9LBS6WWBmN ( this one or the opposite generated from the seed is non used in fact )

with a corresponding public key:

14k8mYFC1LBWiBN8WSxpJN48jQYX1FZ6kz

I’m utilizing the code from the e-book “programming bitcoin” and the best way we create non-public secret’s by changing the bits of a secret phrase like this:

secret = little_endian_to_int(hash256(b'dat_test_private_key'))

So I used to be pondering I simply needed to put the non-public key derived from L2pt3eVopnxfBBvMwrJV2saZeAyQfF77UQSH5WGj5q9LBS6WWBmN as a substitute of “dat_test_private_key”

then we do extra step to get our non-public key right here:

https://github.com/jimmysong/programmingbitcoin/blob/grasp/code-ch13/ecc.py

Then to get our public key:

public_key = print(private_key.level.tackle(testnet=False))

However no mater what I attempted I dont have the identical public key as electrum, so I suppose I should be off one thing or they use a special WIF format or the best way they derive public key

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments