Bitcoin Forum
May 27, 2024, 06:47:25 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / Re: BTC address given, but BCH funds sent on: September 24, 2018, 09:41:20 AM
What BTC wallet are you using? That is the originating wallet?

WIF private keys contain information about whether the compressed address should be used or the uncompressed one. Most likely the problem is that you've encoded the WIF private key for the wrong type of address. So I suggest converting to the other type and importing that.

FYI uncompressed private keys begin with 5 and compressed ones begin with L or K.  You can convert between the two using bitaddress.org's wallet details tab (run offline).

Thank you for the explanation.
I don't use any BTC wallet. Whenever I need a new address, I just generate a random number in Python by:
Quote
priv = os.urandom(32)
then apply the necessary steps to generate the corresponding Public Key and Address.
I save that in a text file, encrypt it with gpg, then shred the original text file.
So normally I don't need to use the WIF at all. No mnemonic word lists either. Just good old private key.

I know it's a bit primitive but I like it that way :-)

I also wrote a python script to convert the Private Key to WIF:
Quote
import hashlib
import base58
import binascii

def privateKeyToWIF(key):
    versionByte = "80"
    extendedKey = versionByte + key
    extendedKey_bytes = binascii.unhexlify(extendedKey)

    doubleSHA256 = hashlib.sha256(hashlib.sha256(extendedKey_bytes).digest()).hexdigest()
   
    checksum = doubleSHA256[:8]
    finalKey = extendedKey + checksum
    WIF = base58.b58encode(binascii.unhexlify(finalKey))
   
    return WIF

I wasn't sure that's working properly, and following you message I verified it does, with bitaddress.org results.
2  Bitcoin / Bitcoin Technical Support / Re: BTC address given, but BCH funds sent on: September 24, 2018, 09:28:53 AM
Your steps should be right, so IMO there's an issue with BTC.com wallet.

Thanks. I tried it now with Electron Cash - successfully imported in seconds.
3  Bitcoin / Bitcoin Technical Support / Re: BTC address given, but BCH funds sent on: September 24, 2018, 05:16:01 AM
I didn't mention:
When I check the address in blockchair.com, and select the BCH one (the address shows both on BTC and BCH blockchains), it shows my address in "Legacy Address Format". Then there's also a "Cash address format".
4  Bitcoin / Bitcoin Technical Support / BTC address given, but BCH funds sent on: September 24, 2018, 04:57:12 AM
I gave someone a BTC address to receive a payment.
That person took my address, but mistakenly sent BCH (genius!)
Somehow the transaction went through. Now that BCH address shows the funds. I can see the transaction on the BCH blockchain.

Naturally I have the private key for the BTC address.
Trying to solve that, I set up a BCH wallet (using BTC.com), converted the private key to WIF format, then tried to use the wallet's import / recovery feature with the WIF key.
The wallet does indeed recognize the WIF key as valid but returns "No positive balances were found".

My questions:
- Do BTC and BCH private keys do indeed translate to the same Address?
- If so, is there a better way to swipe / import / recover the funds from a BCH private key?
- Am I getting it completely wrong, or is the above just an issue with the specific wallet(BTC.com)?

A bit more background: for BTC, I normally don't use any third party wallet. I generate the private key locally with a Python script, then do the necessary steps to move to Public Key and Address. I also used Python to move to WIF format.

It's not a huge sum but still irritating.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!