Author

Topic: How to avoid re-downloading full blockchain node? (Read 207 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
@littleinsect2018
This 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#
newbie
Activity: 7
Merit: 4
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!
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
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).
newbie
Activity: 7
Merit: 4
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.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
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.
newbie
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.
legendary
Activity: 2534
Merit: 6080
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.

Quote from: littleinsect2018
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
newbie
Activity: 7
Merit: 4
[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.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
  • 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.
newbie
Activity: 7
Merit: 4
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.
legendary
Activity: 2212
Merit: 7064
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.
newbie
Activity: 7
Merit: 4
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]
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
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.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
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.

legendary
Activity: 2534
Merit: 6080
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.
newbie
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?
Jump to: