adapation of andreas antonopolous python proof-of-work