littleinsect2018 (OP)
Newbie
Offline
Activity: 7
Merit: 4
|
I am trying to create cold wallet by bitcoin core, here are my steps: 1) in the hot machine which is connected to the internet, download the full blockchain to a USB disc. 2) in the cold machine not connected to the internet, plug in the USB disc with data, launch bitcoin core, it requests to rescan, after rescan, I create a wallet, and add new address, dump the private key, and get the private key written. Then, remove the wallet directory under btc data. 3) in the hot machine, I plug the USB disc again, when launching bitcoin core, it requests to re-index the blockchain, and also need to redownload the full blockchain. Here why does it request the full chain download again? is there anyway to avoid blockchain re-download when switching between two machines?
|
|
|
|
nc50lc
Legendary
Offline
Activity: 2534
Merit: 6055
Self-proclaimed Genius
|
It shouldn't do that if the datadir has the same path and files as before. Have you properly closed Bitcoin Core in the Cold machine before unplugging the USB Disk? Because it should be. Some questions: - Are you using a bitcoin.conf file? If so, What did you set?
- Are you using any additional start parameters?
- If you're using Bitcoin-qt (GUI), what are the options that are ticked in the Settings?
Then, remove the wallet directory under btc data.
If you do that, remove " settings.json" file as well so you wont get the " wallet path doesn't exist" error.
|
|
|
|
NeuroticFish
Legendary
Offline
Activity: 3794
Merit: 6489
Looking for campaign manager? Contact icopress!
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 04, 2022, 07:55:59 AM |
|
1) in the hot machine which is connected to the internet, download the full blockchain to a USB disc.
Just to be sure: is the USB stick indeed so big to fit the whole blockchain, or you're in pruned mode? Also, did you try to start with the cold wallet without any initial sync at all? I didn't use Bitcoin Core as cold wallet, but the blockchain should not be needed for only signing transactions. This may be somewhat off-topic, but configuring Electrum for cold storage should be much easier. It worth a though.
|
|
|
|
LoyceV
Legendary
Offline
Activity: 3430
Merit: 17348
Thick-Skinned Gang Leader and Golden Feather 2021
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 04, 2022, 08:44:16 AM |
|
Then, remove the wallet directory under btc data. 3) in the hot machine, I plug the USB disc again If your wallet.dat has been on the USB disk, just "deleting" it isn't enough to plug it into a hot machine again. File recovery software can probably find it back. If you go through all the hassle of working with offline wallets, you should make sure there's no possible way for your wallet to reach the internet.
|
|
|
|
littleinsect2018 (OP)
Newbie
Offline
Activity: 7
Merit: 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 04, 2022, 02:05:48 PM Last edit: March 04, 2022, 09:26:12 PM by Mr. Big |
|
Then, remove the wallet directory under btc data. 3) in the hot machine, I plug the USB disc again If your wallet.dat has been on the USB disk, just "deleting" it isn't enough to plug it into a hot machine again. File recovery software can probably find it back. If you go through all the hassle of working with offline wallets, you should make sure there's no possible way for your wallet to reach the internet. If on the cold machine, to sign the transaction doesn't need to use blockchain data, I don't need to plug the usb disk to cold machine at all. I will try this.
1) in the hot machine which is connected to the internet, download the full blockchain to a USB disc.
Just to be sure: is the USB stick indeed so big to fit the whole blockchain, or you're in pruned mode? Also, did you try to start with the cold wallet without any initial sync at all? I didn't use Bitcoin Core as cold wallet, but the blockchain should not be needed for only signing transactions. This may be somewhat off-topic, but configuring Electrum for cold storage should be much easier. It worth a though. The USB is 1T, big enough. I am not in pruned mode. Yes, I will try not to plug the USB disc to sign the transaction from the cold machine.[/size]
|
|
|
|
dkbit98
Legendary
Offline
Activity: 2352
Merit: 7429
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 04, 2022, 03:34:47 PM |
|
Here why does it request the full chain download again? is there anyway to avoid blockchain re-download when switching between two machines?
I don't know what kind of drive you are using with USB connection, but if it's regular USB stick drive this is not a good option for keeping all bitcoin blockchain. Unless you are using some external SSD drive or USB SSD stick that has much higher speed than regular usb drives, something like Sandisk Extreme pro or similar. Even regular HDD mechanical drives are much faster than most USB drives and they can work for bitcoin blockchain. Easy option would be to use some hardware wallet to avoid all this hustle.
|
|
|
|
littleinsect2018 (OP)
Newbie
Offline
Activity: 7
Merit: 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 05, 2022, 12:19:09 AM |
|
It shouldn't do that if the datadir has the same path and files as before. Have you properly closed Bitcoin Core in the Cold machine before unplugging the USB Disk? Because it should be. Some questions: - Are you using a bitcoin.conf file? If so, What did you set?
NO - Are you using any additional start parameters?
NO - If you're using Bitcoin-qt (GUI), what are the options that are ticked in the Settings?
All the settings are default. [/list] Then, remove the wallet directory under btc data.
If you do that, remove " settings.json" file as well so you wont get the " wallet path doesn't exist" error. Thanks, yes, this file also saves wallet information. I think I will try the process, and also try to sign the transaction without connecting the USB disc with blockchain data. BTW, my USB disc is SSD, and the speed is good, generally it just took two days to download all the blockchain node.
|
|
|
|
nc50lc
Legendary
Offline
Activity: 2534
Merit: 6055
Self-proclaimed Genius
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 05, 2022, 03:05:28 AM Last edit: March 06, 2022, 07:13:02 AM by nc50lc |
|
- Are you using a bitcoin.conf file? If so, What did you set?
NO - Are you using any additional start parameters?
NO - If you're using Bitcoin-qt (GUI), what are the options that are ticked in the Settings?
All the settings are default.
So the custom data directory was set in the GUI's " welcome screen" and no other settings are set. Removing the wallet file shouldn't cause your node to re-download the blockchain, so I think something is corrupted in the process of unplugging/transferring/plugging of the external SSD. IDK what Cold-storage setup you are using that requires the blockchain in the cold-wallet, but I'd also recommend you to just use the "cold machine" for signing purposes only, it doesn't need to sync to the network.
|
|
|
|
littleinsect2018 (OP)
Newbie
Offline
Activity: 7
Merit: 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 06, 2022, 02:28:02 AM |
|
[Suspicious link removed] 1) from the machine connected to internet, get the full chain node 2) on the cold machine, plug the disc, install bitcoin core, change the data dir in the registry to the usb disc 3) launch bitcoin core without any parameters, it is doing: loading block index... verifying blocks... pruning blockstore
the key is that it has done the "pruning blockstore", the data size on the disc is changed to several giga bytes from >400 giga.
4) plug the disc to hot machine, it will prompt to re download the full node.
in the cold machine, how to avoid this "pruning blockstore" when launching bitcoin core ?
And also, I tried to sign the transaction without blockchain data, just after installing bitcoin core to the cold machine, launch bitcoin core and go to the console window, run: signrawtransactionwithkey 0200000001540e466ccd38e1b501ff68a6955e62ec6ebc28a99a32cad45ae99ad4b21e19f600000 00000ffffffff0250c30000000000001976a9141ed2825114aa8f7e4888976ddbc69de934b279ed 88ace0930400000000001976a914c37ac538ce62d824438c1cc28403d24434e600e988ac0000000 0 [\"***********K6XcFXSqjWYaM*********\"]
it will return errors: { "hex": "0200000001540e466ccd38e1b501ff68a6955e62ec6ebc28a99a32cad45ae99ad4b21e19f600000 00000ffffffff0250c30000000000001976a9141ed2825114aa8f7e4888976ddbc69de934b279ed 88ace0930400000000001976a914c37ac538ce62d824438c1cc28403d24434e600e988ac0000000 0", "complete": false, "errors": [ { "txid": "f6191eb2d49ae95ad4ca329aa928bc6eec625e95a668ff01b5e138cd6c460e54", "vout": 0, "witness": [ ], "scriptSig": "", "sequence": 4294967295, "error": "Input not found or already spent" } ] }
After I plug in the USB disc with blockchain data, launch bitcoin core, and run the command above, it can be successful.
|
|
|
|
nc50lc
Legendary
Offline
Activity: 2534
Merit: 6055
Self-proclaimed Genius
|
in the cold machine, how to avoid this "pruning blockstore" when launching bitcoin core ? You found the reason why it needed to re-download the blockchain. Forgot to mention that prune setting is on by default and you said that you are in default settings, so if you haven't unchecked it in the welcome screen/settings, it must be on. That setting will delete the older blocks until the set size has reached to save disk space. And also, I tried to sign the transaction without blockchain data, just after installing bitcoin core to the cold machine, launch bitcoin core and go to the console window, run: signrawtransactionwithkey 0200000001540e466ccd38e1b501ff68a6955e62ec6ebc28a99a32cad45ae99ad4b21e19f600000 00000ffffffff0250c30000000000001976a9141ed2825114aa8f7e4888976ddbc69de934b279ed 88ace0930400000000001976a914c37ac538ce62d824438c1cc28403d24434e600e988ac0000000 0 [\"***********K6XcFXSqjWYaM*********\"]
it will return errors: "txid": "f6191eb2d49ae95ad4ca329aa928bc6eec625e95a668ff01b5e138cd6c460e54", "vout": 0,
The coin that you're trying to spend was already spent ( just a few minutes ago): f6191eb2d49ae95ad4ca329aa928bc6eec625e95a668ff01b5e138cd6c460e54:0
|
|
|
|
littleinsect2018 (OP)
Newbie
Offline
Activity: 7
Merit: 4
|
Actually, I found that when I change the registry item "bPrune" to "true" on the hot machine, launch bitcoin core, it will not request to redownload the full chain node, and just works in the prune mode. it can work well to create transaction and sync to latest blockchain.
|
|
|
|
nc50lc
Legendary
Offline
Activity: 2534
Merit: 6055
Self-proclaimed Genius
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 06, 2022, 03:29:29 AM |
|
Actually, I found that when I change the registry item "bPrune" to "true" on the hot machine, launch bitcoin core, it will not request to redownload the full chain node, and just works in the prune mode. it can work well to create transaction and sync to latest blockchain.
So the cold machine is set to prune the blockchain in the first place. Then since you set the hot machine to prune too, both machine work since nothing's different in the settings and contents of the datadir. The downside is you'll never be able to load other wallet, otherwise you'll have to re-download the blockchain. After I plug in the USB disc with blockchain data, launch bitcoin core, and run the command above, it can be successful.
Ah, so it's you who spent it and it's successful in your last attempt. Congrats.
|
|
|
|
littleinsect2018 (OP)
Newbie
Offline
Activity: 7
Merit: 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 06, 2022, 04:40:39 AM |
|
The coin that you're trying to spend was already spent ( just a few minutes ago): f6191eb2d49ae95ad4ca329aa928bc6eec625e95a668ff01b5e138cd6c460e54:0[/quote] No , it is not spent. This is the returned error: "error": "Input not found or already spent", since the cold machine isn't connected to the USB disc blockchain data yet, the actual error is "Input not found". After I connect the USB disc blockchain data, it can sign successfully. So it means to use this sign function, blockchain data must be available, the function will validate the data before signing.
|
|
|
|
nc50lc
Legendary
Offline
Activity: 2534
Merit: 6055
Self-proclaimed Genius
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 06, 2022, 06:35:05 AM |
|
No , it is not spent. This is the returned error: "error": "Input not found or already spent", since the cold machine isn't connected to the USB disc blockchain data yet, the actual error is "Input not found". After I connect the USB disc blockchain data, it can sign successfully.
Yeah, I've noted in my previous reply that you're the one who spent it ( in your successful attempt).
|
|
|
|
littleinsect2018 (OP)
Newbie
Offline
Activity: 7
Merit: 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 06, 2022, 07:22:15 AM |
|
No , it is not spent. This is the returned error: "error": "Input not found or already spent", since the cold machine isn't connected to the USB disc blockchain data yet, the actual error is "Input not found". After I connect the USB disc blockchain data, it can sign successfully.
Yeah, I've noted in my previous reply that you're the one who spent it ( in your successful attempt). Thanks!
|
|
|
|
nc50lc
Legendary
Offline
Activity: 2534
Merit: 6055
Self-proclaimed Genius
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
March 18, 2022, 03:52:00 AM |
|
@ littleinsect2018This link is worth mentioning here since we're doing Bitcoin Core Cold-storage set-up wrong ( or at least outdated) I confirmed that it works without exporting the blockchain to the offline machine: /index.php?topic=5390009.msg59557548#
|
|
|
|
|