Contents
Introduction: What is Cryptocurrency?
Proposed Benefits of Cryptocurrency
Environmental Impact of Cryptocurrency
Consensus Algorithms
Consensus Algorithms are the basic underpinning of cryptocurrency. They allow users to agree on who owns the currency without a centralized authority or physical token dictating ownership.
The consensus algorithms used by the two largest cryptocurrencies (Bitcoin and Ethereum) are Proof of Work and Proof of Stake. Here we will detail how they work, why they ensure cryptocurrencies can be secure, and how they impact the environment.
Proof of Work
The essence of Proof of Work involves users, known as miners, competing to solve cryptographic puzzles in order to verify ledgers of transactions. The user who solves the puzzle first is awarded newly minted Bitcoin.
The puzzles themselves involve taking the ledgers with a number appended to the end and applying a hashing algorithm, such as SHA256, to it. For those who don't know, a hashing algorithm is one of the most fundamental tools in cryptology. It takes an input string of any length and outputs a fixed length binary string. Furthermore, hashing algorithms have the following properties: The same input will always map to the same output, small changes in the input will have drastic changes in the output, and the security of the operation comes from the fact that you can't compute the inverse efficiently. In other words, given an output, you can't compute the input without checking every possible input until you get a match.
Going back to the cryptographic puzzles of Proof of Work, a ledger and number are combined and hashed. If $ n $ leading numbers of the binary output is zero, then the number used is a winning candidate. The probability of finding the right input number is $ \frac{1}{2^{n}} $. Once a winning number is found, it's broadcasted to the network and verified by other users.
Mining Difficulty
As stated previously, the number of leading zeros for the winning hash is $ n $. The reasoning behind this is to prevent inflation of the currency. As more miners join the network, the difficulty of computing a correct hash should increase so the rate of coins entering circulation remains constant.
In the case of Bitcoin, adjustments are computed by comparing the time it should take to verify 2,016 blocks of transactions (20,160 minutes) to the time it took to find the last 2,016 blocks to create a difficulty modifier. In other words:
$ D=\frac{\text{current time}}{\text{target time}} $
Once a modifier is computed, a value indicating how many hash-functions are needed to be solved is computed as
$ \frac{D\cdot2^{48}}{0\text{xFFFF}} $
Environmental Impact
The "work" portion in proof of work is the billions of hashing operations that miners are computing to find the winning number. The most popular hardware used by miners to rapidly perform these hashing operations are known as Graphical Processing Units, or GPUs for short. While these specialized processors are intended for graphical computations, their significantly lower cost compared to Application Specific Integrated Circuits (ASICs) makes them the ideal choice for miners who want to quickly receive a return of investment. Unfortunately, compared to ASICs, GPUs consume substantially more energy to operate. The most popular mining GPU, the Nvidia RTX 3090, consumes 450W when pushed to its limits. <bold>TODO ADD STATISTICS ABOUT HOW MANY MINERS AND GPUS THERE ARE</bold>
Security of Proof of Work Algorithms
The largest threat to a decentralized network is malicious actors falisfying information to furthur their own interests. One of the benefits of Proof of Work is that in order to falsify information on the Blockchain, you'd need have control of 51% of the total computational power on the entire network. In the early days when the blockchain was small, this feat could potentially be achieved. Today, the sheer number of miners and the inconceivable size of the blockchain makes this an impossible feat to acomplish. Due to this mechanism, Proof of Work remains as the most secure consensus algorithm.
Proof of Stake
Proof of Stake is a relatively new algorithm designed to reduce the energy usage of mining cryptocurrency. It is currently used by Ethereum, the current second-biggest cryptocurrency. Whereas in a proof of work model, users expend energy to prove they have capital at risk, under proof of stake users just stake their capital directly in the form of the cryptocurrency that is being mined. This earns them the privilege of validating blocks of transactions propagated by other users and occasionally propagating their own block (and receiving the transaction fees for it). In order to encourage miners to post accurate transactions, the cryptocurrency they staked will be deleted if they behave dishonestly (by submitting false transactions) or lazily (by not posting or validating blocks when called upon to do so).
When a user mines Ethereum, they must first make a deposit (called "stake") of 32 ETH to join the validator pool.If a user doesn't have 32 ETH (currently valued at around $50,000), they can join a staking pool, which allows several users to combine their ETH to act as a single validator. Once a user is in the validator pool, they may recieve new proposed blocks of transactions from other validators on the network, and they are expected to validate these blocks as accurate or inaccurate. They may also be randomly selected to propose a block of transactions.
Now you might ask, what forces validators to actually submit accurate blocks of transactions? The answer is that validators must reach a 2/3 majority vote on a block of transactions being legitimate for it to be finalized. If a validator were to submit a false block, they would have no way to get other validators to agree to validate it. This turns the search for a valid block into a type of Keynesian beauty contest. The Keynesian beauty contest was a method for determining consensus first proposed by economist John Maynard Keynes. The idea is, in a traditional beauty contest, you tell the judges to vote for the most beautiful candidate, and they all vote their personal opinion. Keynes proposed instead asking the judges to vote for the candidate they believed the most other judges would select as most beautiful. This incentivizes the judges to vote for the candidate who best meets conventional standards of beauty (since, by definition, the conventional standards of beauty are those held by most people). In a similar way, validators in a proof of stake system are incentivized to vote for the truth instead of their personal desires (giving all the money to themselves), since the truth is the option everyone can agree on.
Environmental Impact
Security of Proof of Stake Algorithms
Proof of stake offers several mechanisms to protect from attacks. The most common methods involve penalizing validators who appear to be attacking the system. Validators are penalized (through the deletion of their staked ETH) if they are in the minority preventing a block from being finalized. This prevents would-be attackers from freezing transactions by refusing to validate legitimate blocks. The penalty also increases if multiple users are voting for the same minority block, which makes 51%-style attacks much riskier as the attacker has to risk deleting a lot of ETH if the attack doesn't succeed. It is also easier for the community of legitimate users to mount a defense against a coordinated attack by staking more ETH to validate themselves - it's easier to stake more ETH than it is to buy a new mining rig. Validators who refuse to vote for a significant period of time can also eventualy be ejected from the network, ensuring that attacks are difficult to coordinate with only a limited amount of time.
In an extreme case, an attacker might be able to overcome the above challenges and control over 51% of the mining power on the network. Notably, this is much easier than under a proof of work model (though still very difficult), since a prospective attacker merely needs to have as much ETH as all other miners combined (very hard) instead of needing as much computing power as all other miners combined (impossible). In that case, they would be able to vote to give all the ETH to themselves, and other users voting against that would be penalized (for being in the minority). But there is another defense against this type of attack. Users could simply fork the blockchain, essentially splitting ETH into 2 currencies - the "real" ETH, which would have the legitimate set of transactions and contain everyone (who got the memo to join) but the attacker, and the "compromised" ETH, which would be entirely controlled by the attacker. This would not cause any problems, as everyone who uses ETH could just refuse to accept transactions on the compromised blockchain. In effect, the attacker would control a near-limitless supply of worthless money, while the rest of the ETH community could carry on as if nothing had happened.
Tradeoffs of Proof of Work vs. Proof of Stake
Security Tradeoffs
Different Environmental Impacts
Be sure to have data here on Ethereum energy usage before and after the switch to proof of Stake.
Regulatory Issues
Conclusion
Sources
$ \sqrt{2} $ How to type math https://katex.org/docs/supported.html
Sources
https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/
Information on how proof of work works.
https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/mining/
Information on why mining is important for cryptocurrencies.
https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/
Information on how proof of stake works.
https://www.coinbase.com/learn/crypto-basics/what-is-proof-of-work-or-proof-of-stake
Information on the difference between PoW & PoS
https://bitcoin.org/bitcoin.pdf
Bitcoin whitepaper that started it all
https://time.com/nextadvisor/investing/cryptocurrency/proof-of-work-vs-proof-of-stake/