You do not want ECDSA for the WIF non-public key.
For the WIF non-public key all you wish to have is binascii, hashlib, and base58.
Get started with some kind of entropy after which sha256 hash it that shall be your
pkeyhash. Then upload
80 model bytes to the entrance for mainnet. Hash it. Hash it once more. Use 2nd hash so as to add the checksum. Convert to base58.
Beneath is an easy instance the usage of a recognized non-public key 0x000001 Uncompressed non-public key (DO NOT TRY TO GENERATE SEGWIT ADDRESSES WITH UNCOMPRESSED KEYS)
import hashlib, binascii, base58 pkeyhash = "0000000000000000000000000000000000000000000000000000000000000001" pkeyvbytes = "80"+pkeyhash firsthash = hashlib.sha256(binascii.unhexlify(pkeyvbytes)).hexdigest() secondhash = hashlib.sha256(binascii.unhexlify(firsthash)).hexdigest() createkey = pkeyvbytes+secondhash[:8] WIF = base58.b58encode(binascii.unhexlify(createkey)) print(WIF) # 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf