Bitcoin Forum
May 03, 2024, 11:47:15 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to transfer bitcoin from Bitcoin Core wallet.dat file to a hardware wallet  (Read 189 times)
rv79 (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 11


View Profile
January 24, 2021, 07:29:47 AM
Merited by Jet Cash (5), OmegaStarScream (3)
 #1

Hi guys

I've been trying to get the bitcoin off my wallet.dat file that's been saved on a USB stick and transfer it onto my Trezor hardware wallet that I recently bought, but so far I've been unsuccessful.
This is the chronology of what I've done so far:
- bought a bitcoin many years ago and left it on an old MacBook (that I didn't use) in a Bitcoin Core program
- when I realised this laptop is on it's last legs, I have managed to save the bitcoin by getting into the Bitcoin Core files by copying the wallet.dat file onto a USB stick
- to check I still had it, I have then downloaded the whole Bitcoin Core onto my desktop Mac last year, replaced the wallet.dat with the one on the USB and luckily seen on the screen that I do have a bitcoin available
- I wasn't worried about getting the private key then as I thought I'd just leave it on the USB for the years to come - I wanted to keep it offline and USB seemed fine for me, but husband persuaded me to save it on Trezor
- I have researched how to do it by avoiding to download the entire Bitcoin Core (it takes weeks to do) and did what I was meant to do, but I can't see my bitcoin
- I have replaced the wallet.dat file, then started to download the BC, then I went to the debug window and console part, put the phrase dumpprivkey and the public address of the bitcoin (when I check this address on blockchain.com, I can see that there is bitcoin on this address so I know for sure it's there), but all I'm getting is an error message that says: Private key for address .... is not known (code -4). What does it mean and what am I doing wrong? I have done this by going online and then did the same thing going offline too. In both cases, I got the same error.
- just to also say, when I initially saved the wallet.dat last year, I have encrypted it by creating a password on BC. But when I started downloading it again this year and even when I put the wallet.dat that was encrypted, BC was showing that there was no passphrase, so I'm a little confused. Did my wallet.dat not got encrypted properly? Do I need to put this passphrase when asking for the private key in the debug window?
- and my main question is, when trying to get the private key, can I do it completely offline? Can I close the wifi, start downloading Bitcoin Core and get everything I need by not going online at any stage? I just want to do it as safe as possible.

Sorry if this is a long reading, but hopefully someone could help me as to what I'm doing wrong and maybe tell me a step by step process.
Thank you
1714780035
Hero Member
*
Offline Offline

Posts: 1714780035

View Profile Personal Message (Offline)

Ignore
1714780035
Reply with quote  #2

1714780035
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
NeuroticFish
Legendary
*
Offline Offline

Activity: 3654
Merit: 6372


Looking for campaign manager? Contact icopress!


View Profile
January 24, 2021, 08:55:00 AM
Merited by Jet Cash (5)
 #2

Private key for address .... is not known (code -4). What does it mean and what am I doing wrong?

I think that you may have forgotten to provide first the password for the wallet (i.e. to unlock the wallet).

For example this is how you unlock for 600 seconds:
Code:
bitcoin-cli walletpassphrase "your_password" 600

And only then you should use dumpprivkey
Code:
bitcoin-cli dumpprivkey "your_address"


(Obviously, make sure you do this on a safe computer, since anyone getting access to your private key can spend your funds.)

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
rv79 (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 11


View Profile
January 24, 2021, 09:10:41 AM
 #3

Thank you, I will try that. But what do you mean by making sure it's done on a safe computer? I use my Mac frequently.. it should be safe.
But also, can I do all these steps if I go offline? Maybe that would be safer?
PhoenixZephyrus
Full Member
***
Offline Offline

Activity: 155
Merit: 102


View Profile
January 24, 2021, 01:13:40 PM
 #4

Quote
- I have researched how to do it by avoiding to download the entire Bitcoin Core (it takes weeks to do) and did what I was meant to do, but I can't see my bitcoin

Could I ask, how exactly? As far as I know, even if you download the blockchain in the "pruned" method, still it downloads the whole blockchain, but saves the disk space by keeping only ~8GB instead of the 350GB when keeping the full blockchain. That is my understanding, and if I am wrong, someone can correct me there...

Quote
- and my main question is, when trying to get the private key, can I do it completely offline? Can I close the wifi, start downloading Bitcoin Core and get everything I need by not going online at any stage? I just want to do it as safe as possible.

Downloading the blockchain ofcourse requires you to be online. That is just a requirement to get up to date and get synced with the bitcoin network. Then, you can take your computer offline and try to access your wallet/bitcoins, and try importing your private keys to get it into a more user friendly wallet (like Electrum) or a safer hardware cold-storage wallet.

Thank you, I will try that. But what do you mean by making sure it's done on a safe computer? I use my Mac frequently.. it should be safe.
But also, can I do all these steps if I go offline? Maybe that would be safer?

As long as you are completely sure (and I do mean completely), that you haven't visited any shady websites, and do not have any malware existing on your Mac, then its fine to do it on your Mac. There are ways you can check this (if you don't own any kind of antivirus), like checking for sudden slowdowns on your computer, and random toolbars getting added to your browsers and any behaviour in general that wasn't there when you were using it at first but suddenly appeared suspiciously, after you did a specific thing.

Though I suspect you are fine as the number of malware made for a Mac is less than that of Windows (due to windows having a higher market share and thus making finding a target far easier). You can do stuff like importing private keys offline, but when syncing, that means its downloading the blockchain from "nodes" in the network, thus you need to be online for that. Same goes for transactions, you can sign a transaction on an offline computer, but broadcasting them to the network requires you to be online, so there are some steps that need to be carried online. Also, I doubt doing these processes offline will really help your security that much, as they are mostly meant for computers that are completely offline from the start and you ofcourse use the Mac for daily usage and I don't think there's any use doing transactions offline. Thats just imho, and someone more experienced is welcome to correct my mistakes, if any.
rv79 (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 11


View Profile
January 25, 2021, 05:06:33 AM
 #5

Thank you for your response. Regarding your question:

Could I ask, how exactly? As far as I know, even if you download the blockchain in the "pruned" method, still it downloads the whole blockchain, but saves the disk space by keeping only ~8GB instead of the 350GB when keeping the full blockchain. That is my understanding, and if I am wrong, someone can correct me there...

Researched it online, this is an example: https://en.bitcoin.it/wiki/Transferring_coins_from_Bitcoin-Qt_to_Electrum#:~:text=down%20on%20paper.-,Obtain%20private%20key(s)%20from%20Bitcoin%2DQt,Qt%20click%20Window%20%2D%3E%20Console.&text=Use%20the%20dumpprivkey%20command%20to,as%20have%20money%20in%20them.&text=Do%20not%20send%20this%20private,to%20steal%20your%20bitcoins(!)
It specifically says: This guide is intended for users of Bitcoin-Qt who do not want to wait for their wallet to be synchronized with the network, which may take many hours or days depending on the hardware spec.
Or here: https://www.reddit.com/r/Bitcoin/comments/354tw5/i_need_help_deriving_a_private_key_from_bitcoin/
Again, it says: There's no need to have the blockchain synced to extract the balance.

joniboini
Legendary
*
Offline Offline

Activity: 2184
Merit: 1789



View Profile WWW
January 25, 2021, 07:30:41 AM
 #6

You're right, there's no need to go online and sync the blocks if you just need to extract the private key(s). But you still need to be synchronized to make transactions. I think it would be faster & easier if you use a light client like Electrum as mentioned above to import your keys and then sweep them to your Trezor address.

Have you managed to get the keys though?

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
PhoenixZephyrus
Full Member
***
Offline Offline

Activity: 155
Merit: 102


View Profile
January 28, 2021, 12:26:00 PM
 #7

~snip~

Okay, so yeah that's what I figured. You are basically just exporting the private keys into Electrum for that method. You aren't downloading the blockchain in any mode. For that you can just be offline and do that stuff without any problems. But you still need to remember your passphrase/seed and the address for that to work, if I understand that correctly. What errors are you getting currently?
rv79 (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 11


View Profile
February 09, 2021, 10:03:24 AM
 #8

There is no way to import the "extraneous" private key into Trezor. Its keys are subject to SEED you have chosen .  If you want to transfer bitcoins from wallet.dat to Trezor (and avoid downloading the whole blockchain), the only way to do that is to extract the priv key following what NeuroticFish said, import that key to another software wallet (SPV like Electrum is a good option) and send BTC from that wallet to Trezor.

Thank you for your reply xenon131. If I understood well, if I want to import the private keys from wallet.dat, I need to download another software?
But what if I just want to send the coins to Trezor in the easiest way possible with the least hassle possible? Can I do it just by downloading the whole blockchain, wait til it syncs up, load the wallet.dat file with the coin in it, restart BC and send the coin from BC to my Trezor wallet address plus the associated transaction fee? In which case I won't even need to get the private keys? Wouldn't that be the easiest way? Thank you.
NeuroticFish
Legendary
*
Offline Offline

Activity: 3654
Merit: 6372


Looking for campaign manager? Contact icopress!


View Profile
February 09, 2021, 02:34:59 PM
 #9

If I understood well, if I want to import the private keys from wallet.dat, I need to download another software?
But what if I just want to send the coins to Trezor in the easiest way possible with the least hassle possible? Can I do it just by downloading the whole blockchain, wait til it syncs up, load the wallet.dat file with the coin in it, restart BC and send the coin from BC to my Trezor wallet address plus the associated transaction fee? In which case I won't even need to get the private keys? Wouldn't that be the easiest way? Thank you.

Of course that you can sync Bitcoin Core. Just since the blockchain is very big, you'll need plenty of disk space (more than 300GB) and plenty of patience, since depending on the computer specs it may take a lot of time.
If that's OK for you, go for it.
Since you've started with dumprivkeys, then transfer, I guess that people (at least I did) have assumed at start that you want to use Electrum (or similar) afterwards, for transferring the funds and avoiding to downloading the blockchain.

Electrum (which is indeed another wallet software) needs seconds to sync and doesn't store the whole blockchain (it relies on other servers do that for you).
But Electrum needs to be verified, the transfer of private key is considered risky because malware can "see" that and steal your funds (especially on windows)... Well, you need to be careful.

So it's up to you after all what path you continue on.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
February 09, 2021, 03:37:56 PM
 #10

Thank you for your reply xenon131. If I understood well, if I want to import the private keys from wallet.dat, I need to download another software?
But what if I just want to send the coins to Trezor in the easiest way possible with the least hassle possible? Can I do it just by downloading the whole blockchain, wait til it syncs up, load the wallet.dat file with the coin in it, restart BC and send the coin from BC to my Trezor wallet address plus the associated transaction fee? In which case I won't even need to get the private keys? Wouldn't that be the easiest way? Thank you.
That is the recommended way. I don't recommend anyone trying to extract their private keys either, if they're inexperienced. Synchronizing the Bitcoin Core with your wallet.dat properly is the only way to ensure that you have transferred out all your funds from the wallet properly. You can prune your Bitcoin Core to reduce the disk space requirements as well.

Electrum (which is indeed another wallet software) needs seconds to sync and doesn't store the whole blockchain (it relies on other servers do that for you).
But Electrum needs to be verified, the transfer of private key is considered risky because malware can "see" that and steal your funds (especially on windows)... Well, you need to be careful.
Malwares can steal your private keys, even if you don't dump your private keys. It is more than common. The only risky part is the fact that it is often stored within the clipboard for an extended period of time and someone else uses your computer and view your clipboard history, then you'll expose your entire private key. That and some people don't know how to use it properly.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!