Solving the Byzantine Generals Problem with Proof of Work