Why this ugly looking formula to calculate ‘target’ from ‘nBits’ in block header: target = coefficient * 256**(exponent-3).
Why not? : target = coefficient * 256**(exponent). What is the need of subtracting 3. All we need is to be able to generate 256 bit long number and enough precision (which we already have with 3 bytes dedicated for coefficient)
Even better, why not? : target = coefficient * 2**(exponent)