Post
Topic
Board Bitcoin Technical Support
Re: transfer bitcoin to another address with a private key
by
NotATether
on 09/05/2024, 06:29:42 UTC
I still have a private key from an old Bitcoin wallet (circa 2012), and I have a private key. I downloaded the bitWallet app for iOS, entered my private key there and my wallet with balance and all transactions was displayed. I wanted to transfer bitcoins to my new wallet, but I get the error mandatory-script-verify-flag-failed (Public key is neither compressed or uncompressed)

my secret key is 52 characters long, starts with 5HpH

I am ready to very generously thank anyone who can help me!

This is an uncompressed private key. So it should be making uncompressed legacy addresses.

Try to manually create a transaction that sweeps its outputs to another address, using the bit Python package:

1. Install Python if you don't have it already
2. Open a terminal and type

Code:
pip install bit
Now according to the README you are supposed to create and broadcast a transaction by opening Python and doing something like this:

Code:
from bit import Key

my_key = Key(<place your private key in here as a string, so '5HpH....'>)

output = [
    # Replace the dots with your new address here
    # BE CAREFUL. You need to leave some balance out to use as a transaction fee.
    # So you're not going to send the entire balance, otherwise there will be nothing left to send as the fee.
    ('..........', 0.0035, 'btc')
]

my_key.send(output)
# should show you the transaction ID