Non-obfuscated chainstate data

1

I'm wondering if there is a flag that allows running bitcoind without using an obfuscation key for the chainstate. I haven't been able to find it.

sr-gi

Posted 2017-11-14T19:56:44.330

Reputation: 2 382

Answers

2

To add on to eponymous's answer, to disable this, comment out this section of code:

https://github.com/bitcoin/bitcoin/blob/50fae68d416b4b8ec4ca192923dfd5ae9ea42773/src/dbwrapper.cpp#L129-L139

if (!key_exists && obfuscate && IsEmpty()) {
    // Initialize non-degenerate obfuscation if it won't upset
    // existing, non-obfuscated data.
    std::vector<unsigned char> new_key = CreateObfuscateKey();

    // Write `new_key` so we don't obfuscate the key with itself
    Write(OBFUSCATE_KEY_KEY, new_key);
    obfuscate_key = new_key;

    LogPrintf("Wrote new obfuscate key for %s: %s\n", path.string(), HexStr(obfuscate_key));
}

Then recompile, then delete your existing chainstate. (This change only causes it to stop generating an obfuscation key, it does not un-obfuscate the data.)

Nick ODell

Posted 2017-11-14T19:56:44.330

Reputation: 26 536

3

There’s no way of easily disabling obfuscation, but you could build a version that sets the keys to zero, resulting in no change when the XOR is used. Generally it has no impact on anything, so it’s left enabled even on non-windows systems where it’s generally not useful.

Anonymous

Posted 2017-11-14T19:56:44.330

Reputation: 10 054

That's what I was guessing. I'm trying to optimize my python's chainstate parser. It not a big of a deal when parsing a single output, but if you have to parse the whole chainstate it makes a difference in terms of running time. Seeing @NickODell answer seems to me that a config parameter that deals with this could have been easily set though.sr-gi 2017-11-15T03:26:56.223

1There’s probably going to be UTXO address indexes in the core client as an option at some point which might be of use to you as well.Anonymous 2017-11-15T03:59:02.290