Cryptocurrency and Blockchain
By Sarah Helmbrecht
Table of Contents
Introduction
Basics of Cryptography
History of Bitcoin
How Bitcoin Works
History of Ethereum
How Ethereum Works
History of Dogecoin
How Dogecoin Works
Non-Currency Applications of Blockchain
References
Introduction
Bitcoin was the first cryptocurrency, launched in 2009 by Satoshi Nakamoto. Nakamoto was the first to formulate the idea of a blockchain. At the time, all online commerce relied on banks to process online payments. These types of transactions require both the payer and payee to trust the third-party bank. Banks have to mediate disputes, which means that non-reversible transactions are not possible. The cost of mediating disputes also increases transaction costs. Some amount of fraud is simply accepted as unavoidable.
Nakamoto set out to create an online payment system that is based on cryptographic proof instead of trust. His goal was to allow parties to make direct, irreversible transactions without needing to trust a third party bank. He accomplished this using a blockchain and a proof-of-work system.
Many other cryptocurrencies have since been created. Ethereum is a blockchain that enables smart contracts and the Ethereum Virtual Machine in addition to a cryptocurrency called Ether. Dogecoin is a cryptocurrency that was created as a joke, but is now very well-known.
Blockchain has many non-currency applications, such as colored coins, NFTs, smart property, and Decentralized Autonomous Organizations (DAOs).
Basics of Cryptography
Each account on a blockchain is associated with a private key that the owner must keep secret. This key is used to create digital signatures that confirm the ownership of funds in a transaction. Most blockchain softwares generate private keys using SHA-256, meaning that the CPU’s random number generator is used to generate 256 random bits. This creates a number between 1 and 2 to the 256th power. The private key can be used by the account owner to decrypt transactions that are intented for them.
A public key is used for the encryption of messages, or in this case, transactions. Most blockchains use elliptic curve multiplication to generate a public key from a private key. This is an irreversible process, so that knowing a public key does not allow someone to figure out the associated private key. An elliptic curve public key is a set of coordinates on an elliptic curve that satisfy the elliptic curve equation.
History of Bitcoin
Bitcoin (BTC) was released as an open-source software in 2009. Satoshi Nakamoto mined the Genesis Block, the starting block of the blockchain, which contained the first 50 Bitcoins. In 2010, after mining 1.1 million Bitcoin, he gave up control to Gaven Andresen. Andresen wanted to decentralize the platform, removing the need for a central authority, server, storage, or administrator. Bitcoin was first used commercially in 2010 when a programmer named Laszlo Hanyecz used it to purchase two Papa John’s pizzas. This 25 dollar transaction cost him 10,000 Bitcoins, which is worth over $265 million as of 2023.
The Gartner Hype Cycle is a life cycle for innovative technologies. Its five stages are Innovation Trigger, Peak of Inflated Expectations, Trough of Disillusionment, Slope of Enlightenment, and Plateau of Productivity. This cycle has caused volatility in Bitcoin pricing. Although Bitcoin has crashed five times, it has always returned to its previous price. The U.S. Economy is also a factor in Bitcoin pricing; Bitcoin crashed rapidly in 2022 when the Federal Reserve increased interest rates to stave off inflation. Investors no longer wanted to take the risk of keeping assets in Bitcoin.
Bitcoin’s earliest major transactions occurred in black markets such as the Silk Road, a dark web marketplace for drugs. Additionally, the proof-of-work system used by Bitcoin requires a large amount of energy and is therefore bad for the environment. Many countries have banned Bitcoin in response. Nine countries have banned it outright, and 42 have implicitly banned it. The People’s Bank of China has caused the price of Bitcoin to drop by half on three separate occasions through their strict regulations.
Other countries have intentially adopted Bitcoin. In 2021, El Salvador adopted Bitcoin as its legal tender. This did not help them to get out of financial trouble as they intended, as the price of Bitcoin has dropped significantly since 2021.
At the beginning of the Russian invasion of Ukraine in 2022, Ukraine posted two crypto wallets for donations. They hope to rebuild their economy using blockchain technology. Iran uses Bitcoin to bypass U.S. financial sanctions.
How Bitcoin Works
In this section, we will explore Satoshi Nakamoto’s original Bitcoin white paper. This paper proposes the idea of a blockchain and explains the algorithm that makes Bitcoin work. All diagrams shown are from the original paper.
Transactions
A Bitcoin is simply a chain of digital signatures, known as a blockchain. A payer can transfer a coin to a payee by digitally signing a hash - a unique digital fingerprint - of the previous transaction and the public key of the next owner, and adding these to the end of the coin. The payer uses their own private key to create the digital signature. If the payee wishes to verify the chain of ownership, they just need to verify the signatures.
We also need a way for the payee to verify that one of the coin’s previous owners didn’t double-spend it. Bitcoin solves this problem by publicly announcing all transactions in the network. This allows the payee to verify that at the time of the transaction, the majority of network nodes (computers) agreed that the payee was the first to receive this transaction. It is able to do so using a timestamp server and proof-of-work.
Timestamp Server
Transactions are bundled into a block that contains an index, the timestamp, a list of the transactions, a proof, and the hash of the previous block. A timestamp server is a piece of software that takes a hash of a block of items to be timestamped and widely publishes the hash. It does so at the same time on computers across the network. The timestamp proves that the data must have existed at the time in order to get into the hash. Each timestamp includes previous timestamps in its hash, forming a chain that reinforces past timestamps.
Proof-of-Work (Bitcoin Mining)
The Bitcoin system needs to implement a distributed timestamp server on a peer-to-peer basis to make the timestamps public. Proof-of-work involves solving a cryptographic puzzle. This requires scanning for a value that when hashed, the hash begins with a certain number of zero bits. Bitcoin uses SHA-256 for hashing. Bitcoin implements proof-of-work by incrementing a nonce (a number that can only be used once) that is added to the block until a value is found that gives the block’s hash the required zero bits. Once a computer finds a sufficient value, it is broadcast to the network. This means that a new block has been added to the blockchain. Later blocks are chained after it, so changing a block would require redoing all of the blocks after it.
Proof-of-work gives each CPU one vote in decision making about which chain to accept. The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it. If a majority of CPU power is controlled by honest nodes, then the honest chain will grow faster than any competing chains. The more computers that are in the network, the more secure the system will be.
Network
To run the network, new transactions are broadcast to all nodes. Each node collects new transactions into a block, and works on finding a difficult proof-of-work for its block. When a node finds a proof-of-work, it broadcasts the block to all nodes. Nodes only accept the block if all transactions in it are valid and not already spent. Once nodes accept the new block, they start working on creating the next block in the chain, using the hash of the accepted block as the previous hash. Nodes always consider the longest chain to be the correct one.
Incentive
Nakamoto proposed that a reward be given to the first node to create a block. This creates an incentive for computers to support the network, and allows for the initial distribution of coins into circulation. This incentive is funded by the transaction fees paid by users. Computers essentially spend electricity to enter a lottery, where the prize is the Bitcoin reward for appending the next block. The incentive encourages computers to stay honest, as it is a more profitable use of computing power to mine for Bitcoin than to attempt to defraud the network.
Reclaiming Disk Space
The blockchain can never get shorter, only longer. This means that it could potentially take up a massive amount of memory. Therefore, once the latest transaction in a coin is buried under enough blocks, the transactions before it can be discarted. Bitcoin does this by hashing transactions in a Merkle Tree, with only the root included in the block’s hash. Branches of the tree can be pruned to make an old block take up less space.
Simplified Payment Verification
Payments can be verified by a user without running a full network node by keeping a copy of the block headers of the longest proof-of-work chain. The user can then obtain the Merkle branch linking the transaction to the block in which it’s timestamped. Once the user has linked the block to a place in the chain, they can be sure that it has been accepted by a network node. As long as honest nodes control the network, this type of verification is reliable.
If the network is overpowered by an attacker, then it can be a problem for verification purposes. The user can protect against this by accepting alerts from network nodes when they detect an invalid block, prompting the user to download the full block and its transactions to confirm the inconsistency. Businesses using Bitcoin frequently are wise to run their own nodes for the purposes of security and speed.
Combining and Splitting Value
A transaction will very rarely be exactly 1 Bitcoin. Transactions combine multiple inputs and outputs to allow value to be combined and split. Inputs can be one input from a larger previous transaction, or multiple inputs combining smaller amounts. The outputs include the payment and any change that must be returned to the sender.
Privacy
While all transactions are announced publicly, privacy can be maintained by keeping public keys anonymous. A new key pair should be used for each transaction to keep them from being linked to a common owner.
Calculations
Consider the scenario where an attacker is attempting to create an alternate chain faster than the honest chain. This could potentially allow them to change one of their own transactions to take back money they recently spent. The race between the honest chain and the attacker chain is a binomial random walk. Let p be the probability that an honest node finds the next block, and let q be the probability that the attacker finds the next block. The probability that the attacker catches up to the honest chain from z blocks behind is defined as follows:
Since p > q, the probability drops exponentially as z increases.
Now consider the scenario in which the payer of a transaction is an attacker who wants to make the payee believe that they have been paid, then switch it to pay back to themself. The payer hopes that by the time the payee is alerted, it’ll be too late. The payee waits until the transaction has been added to a block and z blocks have been added after it. If the honest blocks took the average expected time per block (10 minutes), then the potential progress of the attacker is a Poisson distribution with lambda = (zq/p). To get the probability that the attacker could still catch up, we multiply the Poisson density for each amount of progress that he could’ve made by the probability that he could catch up by that point:
We can rearrange this to get the following:
History of Ethereum
Etherium was launched in 2015 by Vitalik Buterin after the publication of its white paper in 2013. It is an open-source platform that involves several methods of exchange, including a cryptocurrency called Ether (ETH), smart contracts, and the Ethereum Virtual Machine (EVM). Smart contracts are “contract accounts,” which are deployed to the network instead of being controlled by a user, but they do have a balance and can be involved in transactions.
In 2016, a Decentralized Anonymous Organization (DAO) was exploited by an attacker who stole $50 million in Ether. The Ethereum Foundation used a hard fork to reverse the attack. A hard fork means deviating from the blockchain at a certain point in an attempt to upgrade it. The community broke off into two blockchains: Ethereum (ETH), the new blockchain that was created during the hard fork, and Ethereum Classic (ETC), the old blockchain.
Ethereum has laid the foundation for a new kind of internet called Web3. It is intended to put power in the hands of individuals rather than the large technology companies that monopolize the internet today. It is decentralized, permissionless, trustless, and has native payments. This is possible due to Ethereum’s permissionless design, allowing anyone to build on top of the protocol.
How Ethereum Works
The mechanics of the Ethereum blockchain itself are very similar to that of Bitcoin. Instead of rehashing the details, let’s look at the key differences between Ethereum and Bitcoin.
Non-Currency Applications
Unlike Bitcoin, the Ethereum blockchain provides the additional functionality of smart contracts and the Ethereum Virtual Machine (EVM).
Smart contracts are self-executing programs that run on the Ethereum blockchain. Each contract is a collection of code and data that outline the terms of a contract between two parties. The contract automatically executes when certain criteria are met. These criteria typically require a user account to submit a transaction to the contract account.
A virtual machine is a virtual environment that functions like a physical computer. The Ethereum Virtual Machine (EVM) is the environment in which all Ethereum user and contract accounts live. The EVM provides a run-time environment to run smart contracts on top of the Ethereum network.
Proof-of-Stake
Ethereum was originally launched using proof-of-work mining, but switched to a proof-of-stake consensus mechanism in 2022. This is more secure, uses less energy, and is more scaleable than proof-of-work. The primary reason that it wasn’t implemented sooner is that creating a proof-of-stake system is extremely difficult. Instead of miners entering a lottery to try to win cryptocurrency by mining the next new block, proof-of-stake employs vast numbers of “validators.” Becoming a validator requires a deposit, or “stake,” of at least 32 ETH. Validators are given a chance at the opportunity to check new blocks of transactions and add them to the blockchain so that they can earn transaction fees. The more coins a validator stakes, the better their odds. Ethereum has a significantly lower average block time than Bitcoin- 12 seconds instead of 10 minutes- allowing validators to complete more blocks and receive transaction fees more often than they would receive rewards as Bitcoin miners. This does mean that Ether is unlikely to ever rise to the price of Bitcoin.
The math behind staking is fairly simple. Let S be the amout a user stakes per second, let R be the reward rate per second, and let T_i be the total balance of token staked at time i. Then the rewards earned by user u from k to n seconds are represented by the following function:
Infinite Supply
There is a hard limit to the number of Bitcoin that will ever be mined. There will never be more than 21 million Bitcoin. Ethereum, however, has an infinite supply. This makes Ether highly inflatiatory.
Permissioned Transactions
Bitcoin only allows permissionless, public transactions. Ethereum allows these as well, but introduces another option: permissioned blockchains. A permissioned transaction is not publicly announced. Users are not anonymous, but must identify themselves to the ledger administrators in order to be granted certain permissions. These permissioned blockchains are useful for managing supply chains, creating contracts, and verifying payment between parties.
History of Dogecoin
In 2013, an internet meme called Doge became popular on social media websites. The meme shows a Shiba Inu with an overlay of colorful text.
In December of 2013, Billy Marcus and Jackson Palmer created Dogecoin (DOGE) in a lighthearted attempt to make fun of Bitcoin. They accidentally created a well-known cryptocurrency in the process. In its early days, Dogecoin gained attention for publicity stunts such as sponsoring the Jamaican Bobsleigh team in the 2014 Olympics. WallStreetBets is the Reddit group that instigated the skyrocketing GameStop stock price in 2021. That same year, the group resolved to do the same for Dogecoin. Dogecoin’s prices reached their peak in May of 2021 after Elon Musk announced on Twitter that it was his favorite cryptocurrency.
How Dogecoin Works
On a basic level, Dogecoin works very similarly to Bitcoin. Like with Ethereum, however, there is no limit to the number of Dogecoin that can be mined.
Dogecoin’s average block time is 1 minute, which is lower than Bitcoin but higher than Ethereum. This keeps prices low, but also makes the cryptocurrency highly inflatiatory.
Dogecoin has far fewer miners than Bitcoin does, so while it is much easier to mine a Dogecoin, the Dogecoin network is more susceptible to attacks.
Bitcoin and Ether have a fairly even distribution of wallet holdings. Dogecoin, however, does not. 0.002% of Dogecoin wallets hold about two-thirds of the DOGE that is currently in circulation. This means that a small number of people have a lot of control over price fluctuations.
Non-Currency Applications of Blockchain
Colored coins are on-blockchain digital assets that represent custom currencies and financial instruments. These assets are encoded with distinct information (called metadata) to identify them with real-world assets or purchases. They were a precursor to non-fungible tokens (NFTs), which are on-blockchain unique identifiers that are used to certify ownership. NFTs are most commonly on the Ethereum blockchain.
Smart property represents a person’s ownership over a property or object that the Ethereum blockchain network manages and controls. A smart property is an extension of a smart contract. Making property smart can reduce fraud.
Decentralized Autonomous Organizations (DAOs) are legal structures with no governing body that work towards a shared mission. They involve smart contracts that define how the organization works and how funds are spent. This means that members don’t have to trust each other, but only have to trust the DAO’s code. Members can only change the rules of a DAO’s smart contract by vote.
References
- https://bitcoin.org/bitcoin.pdf
- https://www.bitpanda.com/academy/en/lessons/the-bitcoin-whitepaper-simply-explained/
- https://www.jmco.com/articles/tax/brief-history-bitcoin/#:~:text=Bitcoin%20was%20first%20introduced%20in,and%20recorded%20on%20a%20blockchain
- https://money.usnews.com/investing/articles/the-history-of-bitcoin
- https://www.gartner.com/en/research/methodologies/gartner-hype-cycle
- https://www.forbes.com/sites/bernardmarr/2018/02/02/blockchain-a-very-short-history-of-ethereum-everyone-should-read/?sh=3df866041e89
- https://cointelegraph.com/learn/history-of-ethereum-blockchain
- https://ethereum.org/en/whitepaper/
- https://ethereum.org/en/developers/docs/smart-contracts/#:~:text=A%20%22smart%20contract%22%20is%20simply,be%20the%20target%20of%20transactions
- https://ethereum.org/en/developers/docs/evm/
- https://coinrivet.com/guides/altcoins/a-brief-history-of-ethereum/
- https://ethereum.org/en/web3/
- https://www.etoro.com/crypto/what-are-colored-coins/
- https://blockchain.oodles.io/blog/blockchain-enabled-smart-property/
- https://www.investopedia.com/terms/p/permissioned-blockchains.asp
- https://en.wikipedia.org/wiki/Doge_%28meme%29
- https://www.forbes.com/advisor/investing/cryptocurrency/what-is-dogecoin/
- https://corporatefinanceinstitute.com/resources/cryptocurrency/dogecoin/
- https://ethereum.org/en/dao/
- https://betterprogramming.pub/understanding-ethereum-cryptography-3ef7429eddce
- https://medium.com/coinmonks/the-incredible-math-in-ethereum-staking-contract-and-how-to-implement-it-in-solidity-e8f8d973ea1f