Proof of Stake vs Proof of Work: Which Resists 51% Attacks Better?