Title: How safe is it to reuse existing blockchain files? Post by: cellard on March 26, 2018, 03:24:17 PM Let's say you have a very old Bitcoin folder and you want to get a new node in a new laptop which uses a different OS... am I safe by using existing blockchain files (not chainstate files) or should I just go through the hell of having a 100% clean download and re-sync of it all?
I have seem conflicting arguments on this. The purists argue that you should never reuse files, and the rest say that it's safe because these files cannot be manipulated in any way in which would put your new node in trouble... thoughts? Title: Re: How safe is it to reuse existing blockchain files? Post by: ranochigo on March 26, 2018, 03:39:36 PM You're pretty safe with it. If you've downloaded it, then you have probably verified it yourself.
The main thing with this is that, AFAIK, the client only verifies the blocks 6 block deep and not all. The problem with this is that all of the other blocks are to be assumed to be valid. Unless you delete the block index or set your client to validate everything, you are trusting that everything is correct. Edit: If you don't copy the chainstate and index, then your client would be verifying everything again so there wouldn't be any risks at all. Sorry for the confusion, I was under the impression that Core still validates all the blocks at start up. Title: Re: How safe is it to reuse existing blockchain files? Post by: achow101 on March 27, 2018, 04:26:02 AM I have seem conflicting arguments on this. The purists argue that you should never reuse files, and the rest say that it's safe because these files cannot be manipulated in any way in which would put your new node in trouble... thoughts? Without the chainstate, it doesn't matter because your node will validate the blocks anyways and fetch whatever it doesn't have.The argument only matters if you are copying over the chainstate too since then you have to trust that the chainstate you are copying has not been modified. Usually you can trust yourself and your computer so it really isn't an issue. It's only an issue if you have malware or someone has maliciously accessed your computer. Title: Re: How safe is it to reuse existing blockchain files? Post by: ranochigo on March 27, 2018, 08:34:40 AM Without the chainstate, it doesn't matter because your node will validate the blocks anyways and fetch whatever it doesn't have. Doesn't the client just rebuild using the blockchain index only? Blockchain index contains information about the blocks and they are verified and inserted there if I'm not wrong.The argument only matters if you are copying over the chainstate too since then you have to trust that the chainstate you are copying has not been modified. Usually you can trust yourself and your computer so it really isn't an issue. It's only an issue if you have malware or someone has maliciously accessed your computer. Does the client actually verify the validity of all the blocks again when remaking the chainstate? Title: Re: How safe is it to reuse existing blockchain files? Post by: wilwxk on March 27, 2018, 01:02:43 PM Anyway, if you downloaded a modified blockchain, there is no chance to lost your money with it, because if the transaction bradcast still works, the other nodes will verify if the transaction is valid and if you really have the sent amount, the worst case in this case is if the fake blockchain doesnt have your updated balance. (there is other problems too, but i think this is the biggest).
Title: Re: How safe is it to reuse existing blockchain files? Post by: ranochigo on March 27, 2018, 01:24:33 PM Anyway, if you downloaded a modified blockchain, there is no chance to lost your money with it, because if the transaction bradcast still works, the other nodes will verify if the transaction is valid and if you really have the sent amount, the worst case in this case is if the fake blockchain doesnt have your updated balance. (there is other problems too, but i think this is the biggest). If you somehow download a malicious blockchain that is modified, your blockchain data will be different from others. You could potentially be tricked to seeing transactions that are otherwise invalid (with non existent) inputs. This is the potentially a serious problem when you're downloading a pre-validated blockchain from others.If your client validates everything, then it isn't a problem. IIRC, there's a command that rebuilds the chain state only and I don't remember having to validate all the blocks again. I could be wrong, of course. |