Blockchains are a disruptive technology into domains where market barriers rather than technical limitations limit innovation, including healthcare, supply chain, finance, and e-commerce. Bitcoin, the first blockchain application, for the most part, has been successful and secure, achieving a valuation of over $1 trillion in 2021. However, Bitcoin relies on a proof-of-work consensus mechanism and cannot process more than seven transactions per second. Additionally, Bitcoin's security relies on the consensus mechanism being energy-inefficient. In 2021, the Cambridge Bitcoin Electricity Consumption Index estimated that if Bitcoin was a country, it would consume more energy than all but 30 countries. Here, we study proof-of-stake blockchains, an energy-friendly alternative to proof-of-work blockchain. Unlike proof-of-work, proof-of-stake does not require blockchain miners to solve energy-intensive tasks but really on an external source of randomness. We show that given a trusted source of randomness, proof-of-stake blockchains are almost as secure as existing proof-of-work blockchains.