Thank you!
What would be potential drawbacks / sideeffects of this fix?
There's something I don't quite get... If the attacks works roughly like you explained (quoted here:
https://bitcointalksearch.org/topic/m.5582049), then why would we see any effects (as BCX says: "increasingly uneven block times"). After all, BCX only publishes his secret chain at the end of the attack, not at this point, right?
I would appreciate others to comment on this: does it fix the problem? Does it have any unwanted side-effects? I have not found, but that does not mean there are no.
I'm wondering the same; there should ne no side effects before the secret attack chain is published.
Not sure if I should publish this or not. However, I think if someone is anyway doing it, then publishing this should be just good on the long run. And you cannot know if my fix works or not, if you don't know what it should fix.
This is one way of using the TW vulnerability, which that code prevents (but not the earlier fix):
1. Use isolated mining environment, as you need at this kind of attack
2. First generate blocks with long timestamps to get low diff on your own chain. This takes time, but gets easier after every block.
3. When you have a low difficulty, start generating blocks with time differences (hours:minutes) : +12:00, -11.51, +12.00 -11.51... This is for 5 minute target times
at step 3, you can generate 2 blocks every 9 minutes with a very low difficulty. Eventually, your chain is longer than the official, and you can publish it.
Every time you generate a block with +12:00, you get -10% difficulty. Every time you generate -11:51, you get +10%, ie you stay at the low difficulty. The problem is that KGW difficulty calculation counts from the latest block's time, not the latest blocktime
But note; this is also prevented with automatic checkpoints. And you have to start over after every published checkpoint.