Problem: Nodes that synced before v28 may store block and undo files effectively unobfuscated with a zero XOR key. There is no built-in way to obfuscate those existing files, rotate their key, or deliberately replace it with a zero key without resyncing.
Fix: Add -reobfuscate-blocks[=<value>] to rewrite existing blk*.dat and rev*.dat files before chainstate loading.
With no value or =1, the option generates a random 8-byte key.
A 16-character hexadecimal value selects an exact key, including all zeros to remove obfuscation, while malformed values fail during startup.
If the selected key is already active, block and undo files are left unchanged.
Files are rewritten in fixed-size chunks, staged with a .reobfuscated suffix, committed before the originals are removed, and renamed to their original names after all rewrites finish.
The target key is staged as xor.dat.reobfuscated, which is also used to resume an interrupted migration.
File timestamps are preserved, and progress is reported in the log and through Kernel notifications marked as resumable.
Benchmark: The migration is single-threaded and processes one file at a time.
| CPU | Storage | Block count | Size | Files | Time (min) | Blocks/min |
|---|---|---|---|---|---|---|
| Apple M4 Max laptop | SSD | ~955k | ~854 GB | 11,232 | 10.18 | 93,804 |
| Intel Core i9 | SSD | ~909k | ~725 GB | 10,238 | 23.1 | 39,351 |
| Raspberry Pi 5 | SSD | ~914k | ~728 GB | 10,276 | 72.78 | 12,558 |
| Intel Core i7 | HDD | ~909k | ~720 GB | 10,156 | 208.7 | 4,356 |
| Raspberry Pi 4B | HDD | ~915k | ~730 GB | 10,304 | 1467 | 624 |
Similar work: