Comparing proof-of-work and proof-of-stake