I sent bitcoin to my bitcoin core app a few weeks ago, however the app wasn't synced so i tried to export the private key but it wouldn't work, it said it couldn't work for the address, so i changed address but the bitcoins remained in the previous address, i updated my hard drive so i could sync the app and now the app doesn't have my old address in my history but the coins are still in the old address, is there any way i can access the former address??
Where are bitcoins stored?
Some basic principles:
Bitcoins are not actually stored in wallets. Your private-key is stored in your wallet and from that the "bitcoin address" is derived.
The bitcoins are associated with the address.
Movements of bitcoin values are kept track of in an accounting ledger called "the blockchain". Bitcoins are not actually stored in the blockchain, the blockchain just keeps track of the movements of bitcoin values from one address to another.
There is no master copy of the blockchain but lots of people running bitcoin software have their own copies of it and can use it to check transactions.
So bitcoins are not stored anywhere and moving their value from one address to another involves a bitcoin transaction paid for using a mining fee. You cant just change the address of some bitcoins without making a transaction and having it published to everyone's copy of the blockchain.
Where are my bitcoins?
To see how many Bitcoin are associated with your "old address", you can type the address into a "blockchain explorer" website.
If the bitcoin value has been moved ("spent"), this will show you the bitcoin addresses it went to.
You don't say how you changed the address. Is it possible you mistakenly generated a change address - This is an address for change to be sent back to you when you buy something. Change in a similar sense to small coins returned when you buy something using a large banknote. If you did this, your original address is still usable and nothing is lost or broken.
Recovering from an unusable wallet
Using the private key
See How can I export the private key for an address from the satoshi client? and note that, if your wallet is protected by a passphrase (as it should be), you have to enter command
walletpassphrase correcthorsebatterystaple 600 before command
dumpprivkey 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 but replacing correcthorsebatterystaple with your wallet passphrase and replacing 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 with your old address.
One way to recover from a broken wallet requires the private key. It looks something like either of these two examples
- E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33262 or
If you have that written down somewhere (which you really should), you can download a lightweight wallet to a new clean computer and import your private key into that wallet. Use a lightweight wallet because it takes much less time to sync and be usable.
Once you have recovered, I would suggest using a paper wallet for long term storage or a hardware wallet for more security. Regularly practise recovering your wallet from backups, recovery-phrases and private keys.
Using an old backup copy of wallet.dat
See Import wallet.dat into a new Bitcoin-Qt client - essentially, make a copy of old wallet.dat install a new bitcoin-core wallet somewhere, stop the program, replace it's new wallet.dat with your copy of the old wallet.dat and restart the program. You may have to wait a few days while it synchronises with the network.