I just tested the script using Python 3.9 (with most recent version of fastecdsa and bit) and i experience same problem. Additionally, on line 45 you forget to add equal symbol.
ok, I will try upgrade by python to 3.9 and test again my WSL python is 3.8
Can you help to explain each value on shiftdown function for non-programmer understand?
pubkey in hex convert to pubkey point x and y is Q (Q.x,Q.y)
G is Gx,Gy of curve right
P is value after subtract value
What is k value?
i is how may time to dividing
I am hobby code not professional coder, try to understand (may be slowly understand)