Categories
Blockchain Cryptocurrencies & NFTs Financial talks at dinner table

Some Stablecoins Are Already Digital Money

The family digs deeper today into stablecoins, focusing on reserve and collateral and how some fiat backed stablecoins like Tether is on its way to qualify for being a digital money.

Kimberly: Last time we were talking about depositing $2,000 worth of Ethereum before anyone can claim $1,000 worth of stablecoin. The ETH collateral is twice the value in stablecoin. I wonder if that is true in general.

Greg: Not really. The key question to ask is what are being used for collateral and how stable they are. For stable assets like many fiat currencies are, a stablecoin can get away without over-depositing or over-collateralization like in the ETH case.

Joy: In other words, to claim you have a stablecoin valued at $1 million, you only need to have $1 million in reserve if the asset is stable. That’s 100% backup or 1:1 reserve. But for unstable assets like cryptocurrencies it’s common to see $1.5 million or even $2 million worth of crypto deposited for $1 million worth of stablecoin.

Kimberly: This prepares for the scenario when the unstable asset suddenly decreases value, right?

Joy: Right. It provides an extra layer of protection to investors, just like insurance company will charge you a higher premium if you have a record of drunk driving or other risky behaviors.  

Greg: That’s a good analogy. I want to add that even with over-collateralization those stablecoins are not error-proof. In case a cryptocurrency is completely busted, over-collateralization won’t save the stablecoin.

Lily: How about backing up a stablecoin by a basket of cryptocurrencies, would that help?

Greg: Theoretically it would, except the history of crypto has shown a high correlation among the price movements of most if not all cryptocurrencies. This differs from the mature market of stocks and bonds, where diversification helps reduce non-systematic risk in the traditional financial market. Diversified collateralization by a basket of cryptocurrencies may or may not do the trick.

Lily: Why are the prices of cryptocurrencies closely related?

Greg: One reason is that the crypto market is heavily dominated by two big guys Bitcoin and Ethereum, followed by thousands of small guys. If you check out the site https://coinmarketcap.com you will see that except for Bitcoin, which is more than 40% of the market share, and Ethereum, which is around 15%, plus a few stablecoins, the market share for the others quickly drops to 1-2%.

Lily: So the small guys will have a price movement heavily influenced by Bitcoin and Ethereum, right?

Greg: Right. Another reason is that speculators have low royalty to individual crypto. They are constantly searching for the “next big one.” This makes all cryptocurrencies exposed to the same speculative risk.

Joy: I think future cryptocurrencies should specialize in industries or lines of business to reduce the correlation among them and also to grow quickly. Today’s innovations have focused on different features of the same cryptocurrency, but the future lies in “application specific crypto” or ASCs. Even a decentralized financial market has no space for nearly 20,000 cryptocurrencies. Integration will have to happen for the market to settle down, where many small crypto will be bought off by a few big guys.

Greg: I agree. Another thing to bear in mind is that despite its bad reputation of dramatic price shifting, cryptocurrencies may still be better than some fiat. Crypto price can go down but also go up. This is not the case with some fiat. The Argentina money, where the inflation rate hits 58%, is worse because it’s all inflation, unlikely to have deflation. A Bloomberg report says it right that in Argentina, nobody knows the price of anything.

Emily: What’s deflation?

Joy: That’s when prices of many things go down instead of going up. Deflation is good news for consumers as it offers higher purchasing power. Economists used to worry about deflation a lot as a sign for a weaker economy but not as much today, because lower prices can also mean higher productivity or economy of scale.

Lily: Oh yeah. I’ve read an article that lists 10 things that are cheaper now than 10 years ago, like smart phones, calculators, flat screen TVs, domestic flights.

Greg: In addition to what are used as reserves and how stable they are, it also matters a lot how a stablecoin makes its claims. Regulators will always come after you if they believe you’ve made misleading claims. Sometimes firms make their job easier. Tether, the largest fiat-backed stablecoin, used to claim its value has 100% backup “by the dollar.”

Joy: Yeah, they paid a big price for saying that. A Wikipedia page says Tether is to pay $41 million fine to the Commodity Futures Trading Commission, or CFTC. Now Tether only says its token is fully backed by its “reserves,” not dollars.

Greg: That’s true. Looking at Tether’s transparency page, you will see that “All Tether tokens are pegged at 1-to-1 with a matching fiat currency and are backed 100% by Tether’s reserves.”

Kimberly: Is the new claim accurate? Does Tether now have sufficient reserves to cover its ground?

Greg: Let’s find out. Jason, please go to this webpage https://tether.to/en/transparency/ and we can check the numbers to see if the total assets and liabilities of Tether on USD match.

Jason: Total assets $72,657,372,695.04 or more than $72.6 billion on June 10, 2022, total liabilities $72,494,981,446.98 or $72.5 billion. Looks like they have more assets than liabilities.

Greg: That’s Tether’s account balance for the dollar. Let’s look at the Euro as well.

Jason: Okay… Oh, same story here, total assets are more than total liabilities.

Greg: They do that to have extra room of cushion, which is called “shareholder capital cushion,” and also to impress investors and regulators.

Joy: There is a report by Quartz that tells us more details. Tether defends itself by saying that the findings were from more than two and a half years ago, that they always had enough money in reserve, that the fine only meant the reserves were not all in cash and all in a bank account titled in Tether’s name, at all times.

Lily: Do you think Tether was wrongly charged? I mean stablecoins have been unregulated and suddenly Tether was thrown a huge fine.

Joy: I’m pretty sure the CFTC has a solid legal ground for imposing the fine. If you read the Wikipedia page on Tether, you’ll see many problems associated with Tether, including the misleading statement of dollar reserves, having $31 million token stolen, and price manipulations and lack of auditing.

Greg: At a deeper level, let’s take one step back and ask ourselves why holding sufficient reserve is so crucial for stablecoins. The answer is in two words: “stability” and “liquidity.”

Kimberly: Could you elaborate?

Greg: “Stability” is easy because that’s what all stablecoins are named after, none of them calls itself “unstablecoin,” right? The whole reason for stablecoin to exist is to provide stability of value, which other cryptocurrencies do not have. Liquidity on the other hand means taking precautions to pass a “stress test” under extreme scenarios.  

Kimberly: Can we have an example what an extreme scenario looks like in a stress test?

Greg: Say all owners of Tether tokens were to cash out for dollars, will Tether still have enough cash or cash equivalent to allow investors to get their money out in dollars? Having liquidity means Tether can say “Yes” for sure, otherwise it will fail the test.

Lily: I see it now: When it comes to stablecoins, there is no shortcut and no need for getting creative. You just have to keep enough cash or cash equivalent in reserve. That’s the only way for Tether to possess stability and liquidity.

Greg: That’s right. That’s also why I believe Tether’s self-defense is weak. All reserves must be in cash or cash equivalent, and all must belong to Tether, not shared with anyone else.

Joy: It’s interesting that I’ve read an opinion piece that says the future of payment is not in stablecoins. One of the key arguments is that stablecoins tie up liquidity unnecessarily, making those dollars in reserve unavailable to other uses.

Greg: I see their points but ultimately it all comes down to the issue of trust, which does not fall from the sky — you must earn it over time. For now keeping 100% reserve with stable assets is a price stablecoins must pay, given its currently low public and regulators’ trust. Like Lily says there is no other way around that. I would not however rule out future payment possibility for stablecoins. To say stablecoins are not the future of payment is to deny the possibility for stablecoins to establish trust. That goes too far.

Joy: I agree. Commercial banks are not required to keep 100% reserve for issuing loans. In fact, since March 26, 2020, the Fed reduced the reserve requirement ratio to zero. Of course, that is in the traditional or centralized financial world but who is to say in the decentralized financial world things will never change and stablecoins will always be required to keep 100% reserve?

Emily: What’s the reserve requirement ratio?

Joy: That’s the amount of deposits a bank is asked to hold for customers’ withdraw. Let’s say a bank has $100 million in deposits from its customers. Banks make money by lending the deposited money out to earn a higher interest. But can the bank lend out all $100 million to businesses? Normally not, because the central bank will ask it to keep a part of deposited money, and that part is reserve ratio. Say the ratio is 10%, then the bank must keep $10 million and only lend out $90 million. Sometimes however the central bank may allow banks to lend out all the money to stimulate the economy.

Lily: I think the risk for a stablecoin is higher than for a commercial bank. The latter is a part of centralized system. It has less freedom than a stablecoin but also lower risk because the central bank will come to its rescue in case of a major crisis. A decentralized stablecoin has more freedom but higher risk as the central bank may or may not save it from its own trouble.

Greg: That’s true and we should keep the higher risk of stablecoins in mind. The future relationship between central bank and decentralized financial institutions is a very interesting topic. One possibility is that the Fed will keep its direct reign over all membership banks but will make suggestions or recommendations to decentralized finance entities to implement its monetary policies.

Joy: Maybe the Fed will tell future stablecoins that if you follow or coordinate with our monetary policies we’ll add you to our list of “associated members” to offer partial bailout in case of crisis. It’s unlikely for the Fed to order stablecoins to do anything, though — unless the law says otherwise.

Greg: Meanwhile, without central bank rescue stablecoins will have a higher risk of “bank run” unless they keep 100% reserve all the time. Future regulations may ask them to maintain a higher reserve ratio than that for the centrally controlled banks, other things equal.

Emily: What’s bank run?

Joy: A bank run happens when a large group of bank customers all want to withdraw cash from their bank accounts, either because of the bad news in the market or about the bank. You know banks make money by lending money out and they are only required to keep some cash. When many customers all want to get cash at the same time, banks quickly run out of cash and must close the door.

Lily: Let’s go back to Tether. I think it’s good for Tether now to keep more assets than liabilities.

Greg: If you think of it, having extra assets above and beyond liabilities is for Tether’s own good because it relies heavily on money market instruments, which are either unsecured, like commercial papers, or have penalty for early withdrawal, like certificates of deposit. They are cash equivalent but not exactly cash. Those extra assets help mitigate money market risk.

Emily: I meant to ask it before: What’s cash equivalent?

Joy: Let’s use Tether as a handy example. On Tether’s transparency page there is a reserve breakdown. We can see that more than 55% is US Treasury Bills, about 28% is in corporate commercial papers & Certificate of Deposits or CDs. The rest is money market funds and others. Treasury Bills, commercial papers, CDs are all cash equivalent, meaning they can turn into cash quickly if they must.

Emily: I remember commercial papers are short term debts of companies. What are money market funds?

Joy: Those are mutual funds that invest in cash and securities that are due within one year. These assets can all be converted to cash quickly. Again, they can all be converted to cash quickly.

Lily: Back to your comment, dad, on having extra reserve is good for Tether, did you mean some commercial papers may default, but Tether can use the extra reserve to pay investors? Say Tether has a total of $10 million commercial papers and $1 million defaulted. if Tether only had $10 million assets to meet $10 liabilities, it would be $1 million short after the default. But if Tether has additional $1 million extra reserve, it will cover all payments. Am I right?

Greg: Either that or let’s say they must withdraw CDs before the maturity dates, which will incur early withdraw penalty. Let’s say that’s $1 million. In that case Tether can still use its extra reserve to pay all investors in full.

Lily: That’s pretty impressive for Tether to do what it’s doing now.

Greg: That’s not enough, though. Tether also must constantly add cash or cash equivalent to its pool of reserve whenever it issues more tokens to investors. Let’s say Tether has issued another $500,000 tokens to old or new customers last quarter, Tether must add $500,000 to its pool of reserve to cover the new tokens.

Joy: Let’s not forget the dark side of Tether. If you look at Tether’s fee schedule, you’ll see that Tether requires a minimum of $100,000 per transaction of fiat deposit or fiat withdrawal. In other words, you can’t deposit or withdraw $10, $100, $1,000 or even $10,000. Tether also charges for withdrawing the dollar either $1,000 or 0.1%, whichever is greater. If you withdraw exactly $100,000 from Tether, it will charge $1,000 each time. Besides, it also charges $150 for verification of Tether token.

Greg: Tether also has a central control system, not exactly decentralized. I’m sure critics will say something about that. Finally, it does not serve any US residents, only entities established or organized outside of the United States or its territorial or insular possessions; and those having eligible Contract Participants pursuant to U.S. law.

Lily: That’s strange. Who are “eligible contract participants?”

Greg: Its webpage defines a participant as “a corporation that has total assets exceeding $10,000,000 and is incorporated in a jurisdiction outside of the United States or its territories or insular possessions.” Frankly, many if not most entities with more than $10 million total assets tend to have an overseas base outside the US.

Joy: Now the positive news for stablecoins. In January 2021, the Office of the Comptroller of the Currency, or OCC, has told federally controlled banks to treat stablecoins the same as SWIFT or ACH. Furthermore, these banks can participate in the Independent Node Verification Network or INVN, which is nothing but blockchain.

Lily: If that’s the case, how do we explain the recent crash of Terra/Luna stablecoin?

Joy: The OCC acknowledges the value of blockchain, and the role played by stablecoins. But not all stablecoins were born equal and OCC doesn’t or should not endorse everything about stablecoins. There are always bad apples, and the sad thing is that bad news travels fast.

Greg: All in all, I believe stablecoins — not including crypto backed and algorithmic stablecoins — are designed to be digital money because they meet the three money requirements: Store of value, medium of exchange and unit of account.

Emily: Could you tell us more?

Joy: There is a paper written by Federal Reserve Bank of St. Louis that does a good job explaining what money is. Let’s consider the three requirements one by one. A store of value is all about stability of value, meaning the value of money is stable enough for you to keep it for a reasonable period of time without worrying about losing that value significantly or even completely. Stablecoins meet that requirement because their value is stable, as the name suggests — except for algorithmic stablecoins as we have learned.

Kimberly: How long is that “reasonable period of time?”

Joy: It depends on which currency you are talking about. The key point, as the above Fed paper points out, is that money does not have to be perfect store of value because we do have to watch out for inflation, which lowers the value of money from the value before inflation.

Lily: So the now crashed “stablecoin” Terra Luna can’t pass this test.

Joy: No it can’t. The second requirement of money is a “unit of account,” which basically says money can be used to measure value of different things. Without money we’d have to resort to bartering, meaning we trade one thing for another, like one airplane for one million T-shirts. Fiat backed stablecoin meet that requirement.

Greg: We can break the “unit of account” concept down to three features: divisible, fungible and countable. Divisible means one dollar is always equal to four quarters, 20 nickels, 10 dimes and 100 pennies. Fungible means a dollar is a dollar, whether you get it from the bank or receive from your customer. They are always perfectly exchangeable. Countable means you can add, subtract, multiply and divide money anyway you want and still get the same result. Multiplying $1 10 times gets you $10, dividing $1 million by 4 gives you $250,000, and so on and so forth.

Joy: And that brings us to the last requirement of money as “the medium of exchange.” It essentially says money must be accepted as a way of payment. If you look at a dollar bill you will see a tiny note that reads: “This note is legal tender for all debts, public and private.”

Kimberly: But crypto is not legal tender.

Greg: True, but being a legal tender is not a required criterion of money. In other words, not being a legal tender does not eliminate stablecoins’ function as a medium of exchange for those backed by fiat, which are all legal tenders. The true test is market acceptance. The more a currency is accepted, the higher value it has as a medium of exchange.

Lily: Are you saying not all currencies are equally accepted? I would imagine being a government issued legal tender guarantees its acceptance.  

Greg: That’s right. In the near future cryptocurrencies, including stablecoins, are unlikely to compete with fiat in terms of market acceptance but the important thing is to have some and increasingly larger acceptance among some parties in the market. Stablecoins fit that requirement.

Lily: What’s the unique things a stablecoin provides but not by the dollar?

Greg: There is an article in Investopedia that summarizes the advantage of stablecoins well: “Stablecoins promise cryptocurrency adherents the best of both worlds: stable value without the centralized control attributed to fiat.” It also lists a few unique use cases that only stablecoins can do, like “using stablecoins to trade goods and services over blockchain networks, in decentralized insurance solutions, derivatives contracts, financial applications like consumer loans, and prediction markets.”

Lily: I don’t understand why these things cannot be done with dollar.

Joy: All decentralized transactions happen on blockchain, but the dollar is an off-chain asset, not an intrinsic part of blockchain. As far as blockchain is concerned the dollar does not exist. Trading with stablecoins allows investors to stay onchain all the time, not on- and off-chain.

Greg: I won’t say the dollar does not exist on blockchain because the value of all cryptocurrencies is still measured by the dollar. In fact, the link between crypto and fiat is like the “umbilical cord” we all carried on when we came to this world. It explains a great deal why the crypto price movement has so much to do with the fiat, just like decentralized finance or DeFi has so much to do with traditional finance TradFi.

Joy: You are right. I think the notion that Bitcoin is a hedge against inflation also makes little sense, even though its supply is set by algorithm at 21 million. An article by the economist Eswar Prasad said it right, scarcity alone is not enough to create value, there must be demand.

Greg: I won’t use the term “scarcity” for Bitcoin because by the time you call something “scarce” you already implicitly imply a short supply relative to demand. Bitcoin is simply a story of “limited supply,” not scarcity, because Satoshi’s algorithm only governs the supply side. It had no idea how much demand there would be when the algorithm was written. Supply side was all Satoshi could control.  

Joy: Okay I’ll buy that. There is a recent report by Bank of America that shows the correlation between Bitcoin and S&P 500 has been very high, while its correlation remain near zero with gold. This defeats another myth that Bitcoin is like digital gold.

Greg: The other “umbilical cord” for Bitcoin, or all cryptocurrencies for that matter, is financial regulations. Satoshi envisioned Bitcoin to be unregulated and disintermediate, meaning banks and existing financial institutions will be cut off from playing any role related to Bitcoin. But that’s utopian as it’s impossible for Bitcoin and all cryptocurrencies to be unregulated completely. If I were Satoshi, I would try my best to gain all the regulatory supports I can get for my innovation.

Joy: I agree. It is also dangerous without regulation. This explains why the price of cryptocurrency is so sensitive to the monetary policy of the Fed. I would change the famous saying: There are three certainties in life: death, regulations and taxes.

Categories
Blockchain Cryptocurrencies & NFTs Financial talks at dinner table

Proof of Resources & the “Quantum Attack”

The family has largely shifted into non-technical topics this time.

Emily: I think we should talk more about the difference between Proof of Work and Proof of Stake.

Lily: I agree. I’ve read a report about some a billionaire named Bill Miller claiming that if Ethereum does accomplish its upgrade to Proof of Stake, it will give Bitcoin a huge advantage.  

Emily: Why’s that?

Lily: Apparently Bitcoin has no plan to walk away from its tradition of Proof of Work to Proof of Stake, so this billionaire believes Proof of Stake is in favor of miners with rich resources. Switching from Proof of Work to Proof of Stake will make the inequality problem much worse.

Joy: Yeah, I’ve heard about that. The billionaire says Proof of Stake is “the most unequal thing you can imagine, because the rich people make all the decisions.” On the other hand, he believes Bitcoin’s Proof of Work is democratic. One reason he says that is because, as the report reveals, he himself owns a lot of Bitcoin, not Ethereum.

Emily: Okay, this is a good time to talk about the difference between Proof of Work and Proof of Stake. Looks like the two top cryptocurrencies, Bitcoin and Ethereum, are moving toward different directions, making it even more relevant and interesting for us to get a good handle on the two approaches.

Joy: That’s true. The good news is that we already talked about Proof of Work, like the level of difficulty, the fierce competition among all miners, the guessed number of nonce, the decreasing or halving of Bitcoin reward, the single winning miner. Now we only need to add Proof of Stake to that.

Emily: It’s good to know we are halfway done. But how is Proof of Stake different?

Joy: Let’s introduce some acronyms first. PoS is short for Proof of Stake, and PoW is for Proof of Work. One easy way to think of PoS is that it adds an extra “qualifying” layer to PoW, meaning before you become a PoS miner, who are called “validators,” you must prove you have sufficient ownership stake of cryptocurrency, such as owning at least 32 Ethereum coins. This is how PoS gets its name from.

Greg: Staking is pledging, promising or depositing. Say you own 32 units of Ethereum or ETH, you can pledge them to make yourself a validator. All you need to do is to deposit those coins, or to lock them up, not to use them for anything else.

Lily: That sounds like collateral.

Emily: What’s collateral?

Lily: It’s any asset a bank accepts before it lends you money. Say our family wanted to buy a new house, banks will use our current house as a collateral before they give us new mortgage. In case we were unable to pay back the mortgage, banks have the right to sell our current house to cover the loan.

Joy: The deposited coins are collateral because if the validator messes up things, acts dishonestly or lazily in verification, she’ll lose at least a part of their stake. The other way to lose or decrease stake is to fail to participate when she’s called upon. One thing that makes deposited coins different from collateral is that its purpose is not for bank loans but for the right to validate transactions and to get reward from doing that.

Emily: How do you define dishonest behaviors?

Joy: I assume there are different ways to define dishonesty, but I’ll quote an article from Ethereum that says one either proposed multiple blocks in a single slot (equivocating) or submitted contradictory voting for verification.

Emily: If a validator acts honesty she would not be in danger of losing her deposited coins, right?

Joy: No, she retains the full ownership of the coin unless she’s penalized for malicious behavior. Furthermore, she can change her mind and un-stake the coins.

Kimberly: Back to the criticism of the billionaire about PoS promotes inequality, are all validators equal in power?

Joy: Good question. The answer is no, those with more coins in stake have more power. Part of it is that if you only have a few coins to stake, you will have a lower chance to be selected as the validator. As the Motley Fool article points out, if your stake is only 0.0001% of the total stake, you only have 0.0001% of chance to be selected. I guess that’s why that billionaire with heavy investments in Bitcoin was saying that PoS is unfair and biased in favor of rich people.

Greg: Let’s have a look at the big picture first. I’ve seen a fairly recent report from the Forbes that says about 64% of the total market capitalization of all cryptocurrencies use PoW. Bitcoin is the biggest one of course. Since we only have two major consensus mechanisms, either PoW or PoS, it’s probably safe to say that about 36% use PoS.

Emily: What’s market capitalization?

Greg: “Market cap” is short for market capitalization and is very intuitive and simple; it refers to a company’s total market value in dollar. You multiply a company’s total number of shares in the market by its price per share. Say Google has a total of 1 million shares in the stock market and each share is priced at $100, then Google has $100 million in market cap.

Emily: So 64% of market cap is not saying 64% of cryptocurrency companies use PoW, right?

Greg: That’s right. A few large crypto companies can easily make up 80% of the market, while many smaller ones can barely add up to 20%. I bet after Ethereum completes its upgrade to PoS, its position will be much stronger. That’s why so many people are talking about it now.

Lily: Once we have validators, how exactly does PoS work?

Joy: First thing first, while PoW is fairly standard, when it comes to PoS, there are many protocols, and they tend to work differently from each other, sometimes significantly. Bear in mind there are well over 10,000 cryptocurrencies.

Greg: That’s right. That Motley Fool article tells us that Cardanoprotocol selects only one validator, who then determines whether the block of transactions is valid or not. But check the Ethereum Wiki and its Proof of Stake FAQ page, it says not just one validator, but all current validators can participate in the process and their consensus takes control. On the other hand, another cryptocurrency exchange called Binance Coin uses the “Proof-of-Authority” consensus, which uses just 21 validators and each of these validators must be approved by Binance itself. 

Joy: For some crypto coins the number of PoS validators is much smaller than PoW miners. This report from TheStreet.com published in last October says Cardano has 2,924 validators that are responsible for finding or verifying cryptocurrency transactions in blocks, while Ethereum has nearly 3,500. Once the transition to PoS is done, however, Ethereum will have 243,000 validators in the network.

Greg: Yeah, that article also separates PoW and PoS in terminology. For example, it tells us that mining and hashrate are specific for PoW, while stake pools and validatorsonly for PoS. Both systems have nodes. To respect their differences, we should follow those guidelines.

Joy: It’s not hard to follow. For example stake pools are obviously only for Proof of Stake, and mining is for PoW. I have a picture that provides intuitive sense: PoW has a miner holding a pickaxe, while PoS has a validator holding a key to a safe box.  

PoW vs PoS

Emily: A couple of questions: What is a “node” again and what is “hashrate?”

Joy: There is an article from Blockchain Council that explains a node well. A node is “any system or physical equipment that is connected to a network and capable of performing specific duties such as creating, receiving, or sending data across a communication channel.”

Lily: So a node is basically a computer connected to a network of other computers. I believe nodes and network must co-exist. You can’t have a network without nodes, and a node is useless unless connected to a network.

Greg: You would be right for all other nodes and networks. But for Bitcoin it’s different. Here a node can exist independently of other nodes in the same network, because a Bitcoin node contains a complete copy of all the blocks and transactions, just like any other nodes. This is due to decentralization, meaning maintaining duplicated copies all over the world for exactly the same blockchain, so we won’t have a single point of failure like in a centralized control system.

Lily: Oh yeah! Thank you for reminding me of that.

Emily: It’s funny that I’ve been thinking all along that nodes and miners as the same thing.

Greg: You are not alone. The truth is they are closely related but not the same. First, a node is not just any computer but one equipped with cryptocurrency software in it. Also, nodes and miners work together to get verification of transactions done. I have this picture from River financial website that does a good job illustrating how miners and nodes work.

Miners & Nodes of Blockchain

Lily: In the end it is miners’ job to grow the blockchain because they are the ones verifying transactions.

Greg: Right. A node or a blockchain can’t grow itself. Remember a blockchain is just a decentralized and distributed digital ledger. If you read the article by River financial, you will see two types of nodes, one is full, and another light weighted but nowadays the latter are rarely seen.

Joy: Sometimes I can’t help thinking that Bitcoin really did it with a “security overkill.” It’s virtually impossible for Bitcoin to be hacked, although the cost is also extremely high, both in energy consumption and in human inputs. Basically, the Bitcoin algorithm makes it extremely hard to attack because miners work extremely hard.

Greg: I agree. Look at the hashrate now to get back to Emily’s question what is hashrate: It’s a measure of computing capacity for the network. An article from Robinhood.com explains it well: “A hashrate measures how many calculations can be performed per second and can be measured in billions, trillions, quadrillions, and quintillions. For example, a hashrate of 1TH/s means one trillion calculations can be performed every second.”

Emily: One trillion calculations in one second? That’s incredible.

Greg: Computers or nodes can do much better than one trillion calculations per second. An article from Robinhood.com says the Bitcoin hashrate has been as high as 179 exahashes per second (1 exahash = 1 quintillion). In case you don’t know, one quintillion is one million trillion or one trillion times one million, and yet miners are still working on it, apparently the reward is bigger than the cost.

Joy: Hashrate is not just about computing resources but also is used as an indicator of decentralization.

Lily: Really, how so?

Greg: Your mom said it right. Generally, the more miners participating in a network, the higher that network’s hashrate will be. Meanwhile, the fewer miners, the lower the hashrate. So let’s say the hashrate becomes lower this week, it means fewer miners are participating in mining. But with fewer miners, hackers or the bad guys will need less computing power to mess up the verification. The opposite holds for higher hashrate.

Lily: Wow, mining is a democratic game. This is not much different from an election: The more voters showing up, the better election results.

Kimberly: Enough for the details, what do you think of the two approaches, PoW and PoS?

Joy: The story is more complicated than simply claiming one is definitely better than others. Like I said earlier, both approaches end up being proof of resources more than anything else, they rely on different resources, though.

Emily: What do you mean?

Joy: Well, for PoS it’s about financial resources, meaning how many coins you have in stake matters the most. For PoW it’s about computing resources, meaning how powerful your hardware is matters the most.

Kimberly: I guess we haven’t talked much about computing resources until this point. I heard that in PoW, miners compete to have the fastest hardware in order to win the reward. One thing they all want is called ASIC or Application Specific Integrated Circuit. If you only have a laptop, you are doomed to lose the competition.

Greg: That’s right. The sad thing is that ASICs are designed only for Bitcoin mining, uncapable of doing anything else. This is a bad news to hackers because they would have to buy ASIC equipment, otherwise it’s impossible to become a winner.

Joy: In other words, investing in ASIC equipment increases cost for everyone, including hackers, which is a good thing for the security of Bitcoin.

Lily: But all hardware can be purchased with money. In the end, it’s all about financial resource, don’t you think?

Joy: I see your point, but it’s more complicated than that as subtle differences exist. For example, PoS critics are saying allowing current big owners of cryptocurrency to confirm transactions makes little sense because owners are biased. It’s better to let professional miners in a peer-to-peer network do the job of transaction verification. They would disagree with you that everything is about money but would rather argue that money should stay out of the mining process.

Greg: Yeah, that’s a good point. Unfortunately, whether it’s financial or technical, resources tend to be concentrated quickly to the hands of a few people rather than evenly spread out among everyone. That Forbes advisor article I was talking about earlier correctly points out that in PoW the power can become concentrated to those with fancy hardware. There is no easy solution because that’s how market works.

Joy: Having a few miners winning reward all the time in PoW is just as bad as having a few owners of cryptocurrencies to verify transactions in PoS.

Lily: I would prefer finding a balance between efficiency and equality. Isn’t that true that we should seek tradeoff between efficiency and equality? Can we find a way so that we can have “democracy” in mining but also efficiency in getting transactions confirmed?

Kimberly: By “democracy” you mean to get more people involved in the mining process?

Lily: Yeah! Remember that billionaire criticizing PoS for letting a few rich people validate all the transactions? That doesn’t sound good, and we don’t want that to happen.

Joy: Things can be more complicated than just efficiency and equality. We also must pay attention to the environment. One major weakness of PoW is its huge energy consumption from hundreds of thousands miners all the world busy mining. PoS reduces the number of validators involved and therefore significantly reduces energy consumption from mining.

Greg: Although one may argue that energy consumption is one dimension of efficiency. So the challenge is still about finding the best tradeoff between efficiency and equality.

Joy: You are right on that. The good news is that there are ways to overcome financial or computing constraints and still allow sufficient number people to participate in the mining process for both PoW and PoS. For example, people without Ethers can join a “staking pool” to get qualified for validation. Similarly, people without advanced hardware like ASIC can join a “mining pool” for faster mining.

Greg: That’s true. Those pools may be called social solution to the better tradeoff. I’m also optimistic that someday we will find a more efficient way to mine so that even though a million people are mining at the same time, the energy cost is still controllable.

Joy: In a sense the technology is already born with quantum computers. We just need to make it better and more accessible. From what I’ve read, like this one by Coinshares.com, the energy use of quantum computers is far lower than digital computers, even with much faster computing speed.

Emily: What is quantum computing and why are digital computers using so much energy?

Joy: From what I can understand, and from an article I read from livescience.com, quantum computing is a new generation of technology that is 158 million times faster than a digital computer. I remember two numbers well: What it takes four minutes to finish by a quantum computer can take a digital supercomputer 10,000 years to accomplish.

Greg: To answer your second question: Most energy in mining is used on the cooling system, not exactly on computing. Once again, quantum machines are more efficient on energy. It’s reported that the Google Quantum computer was about a trillion times more energy efficient than a summit supercomputer, the fastest digital computer in the world today.

Joy: I heard that quantum computing poses extra risk for cryptocurrencies.

Greg: Yeah, it is called “quantum attack” these days. But I wonder how much we should “cry wolf” before determining if the danger is real. I mean we can take precaution without exaggerating the risk.

Joy: From what I’ve read, the current cryptography is vulnerable to quantum attack. I read a report on a website called “investmentmonitor.ai” that says some four million Bitcoin addresses could in theory be hacked by a quantum computer. And that’s not the only problem. Quantum attack can happen to Bitcoin transactions in transit.

Greg: I’ve also heard about that but still, we must keep in mind that PoW is vulnerable to 51% attack, not to a single hacker standing alone by himself. My sense is that in one or two decades quantum computing will enter the mainstream but that will be a good news because it is unlikely for a single quantum equipped “bad” guy to dominate the network.

Emily: What’s a 51% attack?

Joy: That’s when some bad guys were able to work together either by themselves or by convincing at least 51% of miners that a transaction is true, which is required consensus for a transaction to be verified in PoW.

Greg: Looking at the positive side, we’ve already seen some “post-quantum” cryptography algorithm being developed. Hopefully this helps speed up the race against time and against risk of quantum computing.

Lily: What’s your closing argument on PoW versus PoS?

Greg: I think both have pros and cons, strengths and weaknesses. In the end, it is likely that both will exist and serve different audiences. Some people care less about decentralization and more about fees, while others are all about getting the highest yields. For those who really care about safety of large amount transactions, PoW is likely to be the choice. On the other hand, if someone does not possess many coins, and cares about environmental impact, she would prefer PoS.

Joy: I agree. For the society in general, keeping both PoW and PoS is the best idea. We are still early in the game and with so many cryptocurrencies competing with each other, it’s hard and unwise to claim or even to aim a single winner. While PoW has been proven working well and Bitcoin has some first mover advantage, PoS still has some way to go but Ethereum is unlikely to sink.  

Categories
Blockchain Cryptocurrencies & NFTs Financial talks at dinner table

Digging Deeper into Crypto Mining

The Kingstons continues their intellectual journey on blockchain in relation to cryptocurrency. The previous days were on foundational topics like the cryptocurrency algorithms, decreasing reward to miners, and most importantly the cryptography that sits behind all cryptocurrencies. Today they are ready to talk about details of mining itself, finally addressing Emily’s question from days ago.

Greg: So does everyone have the chance to watch the video I recommended? Don’t mean to put pressure on you guys.

Jason: I did. You are right and I was able to understand the show most of the time. Now I have something to brag about in my school to other kids.

Emily: It looks like the thing called “nonce” plays a crucial role in mining, Am I right?

Joy: That’s right. To mine is to play with numerous nonces. Similarly, to win in the mining game is to find the “Golden Nonce” that leads to a hash that fits the criterion or the standard hash.  

Emily: But what exactly is “nonce?” The video did not tell us, it just shows up like a magic number.

Greg: Nonce stands for “number used once,” where the first letter “n” is for “number,” and “once” for “one time.” It’s 32-bits — or 4 bytes because one byte is 8 bits and 32 divided by 8 is 4. This is a good size because it’s much smaller than SHA-256 that’s 32 bytes, again 256 divided by 8 is 32, yet big to generate a large number of combinations. Anyone wants to guess how many possible combinations there will be for nonce?

Jason: Let’s see: 32 bits and each bit has two values “0” and “1,” the possible combination will be, let me get it from my phone. “Hey Google, what is 2 to the power of 32?” Wow! It’s 4,294,967,296 or more than 4 billion different values.

Greg: Great! We need that many nonces because each one can be used only once. I hope we can get to the point later that even these many nonces sometimes may not be enough.

Joy: Now we can finally answer Emily’s questions what mining is: It is a process in which miners enter different nonces into the SHA-256 the digital “fingerprint machine” to produce different hashes and one of them may be a or acceptable for validating the entire block of transactions.

Greg: More accurately SHA-256 does not work just with nonce but with the whole block header.

Emily: What is that? I’ve heard block in a blockchain but never block header.

Greg: A block header is a “headshot” of the block with 80 bytes of 6 fields. Sometimes you see people writing down fewer than 6 fields, but they should really have listed all as all are useful. These fields are “software version” that has 4 bytes, “previous block hash” of 32 bytes, “Merkle root” of 32 bytes, “Timestamp” of 4 bytes, “Difficulty target” of 4 bytes, and finally “nonce” of 4 bytes.

Emily: Wow, lots of information here. Do fields with more bytes more important than others?

Greg: Not necessarily. Nonce for example only has 4 bytes but as the video shows it plays a crucial role in mining. The 6 fields in a block header are divided into three types. Nonce is the only one that miners have control. Others are either predetermined like previous block hash or controlled by the system like software version, difficulty target and the Merkle root, or controlled by nature like timestamp. I have a table from the book “Mastering Bitcoin,” 2nd edition by O’Reilly Media Inc in 2017. But we don’t have to understand all the details for each field, just focus on difficulty target and Merkle root and Nonce.

SizeFieldDescription
4 bytesVersionA version number to track software/protocol upgrades
32 bytesPrevious Block HashA reference to the hash of the previous (parent) block in the chain
32 bytesMerkle RootA hash of the root of the Merkle tree of this block’s transactions
4 bytesTimestampThe approximate creation time of this block (seconds from Unix Epoch)
4 bytesDifficulty TargetThe Proof-of-Work algorithm difficulty target for this block
4 bytesNonceA counter used for the Proof-of-Work algorithm
Block Header the Headshot of the Block

Jason: Just a curiosity: what exactly is Timestamp? The description says seconds from Unix Epoch.

Greg: The Unix “epoch” timestamp is based on the number of seconds elapsed from January 1, 1970, midnight UTC/GMT.

Emily: After watching the video I think I have an idea of what mining is. You click a button and computer quickly runs through different nonce until it finds one that fits the target of difficulty. What I still don’t understand is how the target hash is set.

Greg: The target is set by the algorithm. Remember we talked about how the level of difficulty is set every two weeks? The reason behind the difficulty target is also simple: We just want to keep the pace of releasing new Bitcoin at ten minutes per block. The Mastering Bitcoin book said it very well: That ten minutes per block is the “heartbeat” of Bitcoin.

Joy: That is a good expression.

Greg: The fun comes when we put nonce and target together to get a complete picture. I find this article by Kirill Eremenko in 2018 that does a fairly very good job explaining how. Another article by Blockchain Council also explains nonce well. I specifically like the simple math classroom analogy it uses.

Jason: I like math. Sowhat is the analogy?

Greg: Very simple and yet very interesting, it says in a math class the teacher gave the following problem for students to solve, and whoever gets the answer first win some award: 315 + ? = 319.

Jason: That’s it? That number is 4! 315 + 4 = 319. I bet even Cleo can solve it.

Greg: Theproblemiseasy, but it offers hints to several important concepts in mining. Turns out that “4” is nonce, “319” is the target of difficulty, and “315” is previous block hash or anything that nonce is added to for mining. Mining is to find the piece of the cryptographic puzzle — the nonce and hash value — to meet the level of target difficulty. Take a look at this picture I draw to see how nonce and target work together to produce acceptable hashes for Proof of Work. This is inspired by a similar drawing in this article but with changes.

How Level of Difficulty Controls Proof of Work

Kimberly: What changes have you made from the original?

Greg: The biggest one is to make the target hash an area rather than a single line. This reflects the changing level of target difficulty, called “retargeting,” because a higher level of difficulty means a smaller target hash. So of the two yellow broken lines the one below is harder than the one above.

Emily: It’s never clear to me how to control target hash or level of difficulty. I heard someone saying the other day that it is controlled by the leading zeros in the target hash. Why’s that?

Greg: Because with any number of a fixed length, more leading zeroes always make it smaller. Let’s compare two 5 digit numbers, one is 01234 and the other 00123, which is smaller? Of course the second one with two leading zeroes. I can even change the second number to 00987 and it won’t make a difference. This is why the number of leading zeroes controls level of difficulty. If the algorithm needs to raise the level of difficulty, just add more leading zeroes. Do the opposite and drop at least one leading zero to lower the level of difficulty.

Emily: Oh, that’s it? It sounds so easy.

Joy: It is easy. You often read people saying that mining involves solving complicated math problems. Not true. The math is easy and simple, the solution however requires more computing resources. That’s why I said that both Proof of Work and Proof of Stake are Proof of Resources.

Emily: But I still don’t see how a smaller target hash will make mining more difficult than a larger target?

Greg: Because a smaller target squeezes the space for finding acceptable hashes. Look at the picture again and if the target hash was the yellow broken line above, not below, there would be more acceptable hashes to be found, mining is easier.

Joy: Think of a room with a high ceiling versus another room with a very low ceiling, which room can hold more stuff? The one with high ceiling, right? A larger target hash is like a larger room to accept more hash values.

Greg: Chapter 10 of the book Mastering Bitcoin I mentioned earlier has an excellent analogy I believe would help us all. It tells a dice rolling story. Someone rolls two dice, and the goal is to show a number of dots below a target, just like our proof of work problem. Now, one dice has six sides with 1 to 6 dots on each side. Jason, if I roll two dice at the same time, how many possibilities of dots there will be?

Jason: Well, each dice has 6 possibilities, and two independent dice will have 6 x 6 = 36 possibilities.

Greg: Right. Now let’s say the target is to show 12 dots on two dice rolling together. Is it easy to get a “Golden Nonce,” meaning the right nonce to solve the mining problem of finding acceptable hash value?

Jason: Very easy! The only time one would loss is when she has (6,6), meaning both dice have “6” dots. All other combinations are winning.

Greg: Right! Now let’s lower the target to 11 dots. That would still be easy, as long as they show up anything below 11 dots. Keep lowering down the target until it’s 5 dots, then it’s harder, because most rolls will show up above or equal to 5 dots. Jason, how many rolls would meet the target?

Jason: Let’s see: (1,1) for both dice showing one dot; (1,2) for one dice 1 and the other 2 dots, (1,3) for one with 3 dots and another 1 dot and finally (2,2) for both showing 2 dots. I guess only 4 out of 36 possibilities qualify. 4 divided by 36 is roughly 11%, so nearly 90% of the time one loses.  

Greg: How about a target of 4 dots? Only (1,1) + (1,2) = 2 possibilities to win. For target 3 it drops down to (1,1) = 1 winning possibility.

Emily: I see your point: The smaller the target the harder to get the required nonce to produce satisfied hash values.

Greg: I’m not done yet. Let’s go down to a target of 2 dots on the same pair of dice, then we will see a really tough game, because nobody can win no matter how many times she rolls the dice.

Emily: Interesting! Are you sure about that?

Greg: I’m positive. The book I am citing from claims one possibility of (1,1) will win but that’s not true. Remember the challenge is to go below — not equal to — the target of 2 dots. The only “chances” to win are (1,0) + (0,0) = 2 possibilities but those are impossible since no dice has 0 dot as the minimum dot is 1. That’s why for two dice to show dots below 2 is impossible. Game over and nobody win.

Lily: So does it mean sometimes we will have no winner and no new Bitcoin will be released?

Greg: Of course there will be winner and a new block of transactions will be verified and added to the blockchain. It just means sometimes we will run through all the 4+ billion nonces and still find no acceptable hash below the target.

Lily: It’s amazing that even 4 billion nonces are not enough to solve the mining problem.

Greg: It’s understandable if you know how powerful computers are today. The article by Kirill Eremenko tells us that “even an average mining device can calculate up to 100 million hashes per second, and therefore will go through the Nonce range in 40 seconds. And that’s an average miner. Mining pools and industrial scale mines are able to go through the Nonce range in fractions of a second.

Lily: Okey, I can see that 4 billion nonce is not that much in the eyes of modern computers. But what we do to make sure we find the right hash to verify the new block of transactions?

Greg: That’s why Proof of Work is not just a game of nonce, we must utilize other things in the block header I was talking about earlier and then use the SHA-256 fingerprinting machine to make sure we get Proof of Work done.

Kimberly: The block header contains a total of 6 fields, we’ve used nonce and previous block hash, what else would we use?

Greg: The first extra field to be utilized is Timestamp. As Eremenko points out, “all we have to do is wait until the timestamp increases. A change in the timestamp will mean that the combination is now different and if we try all 4 billion Nonce values again, every time we will get a brand new hash value.

Kimberly: Sounds like we solved the problem once and for all.

Greg: Not really. Turned out that even the timestamp, which increases by second, is not updated fast enough. The mining pools, where miners form a club to mine together, can finish running through 4 billion nonce in a fraction of one second. We need other ways to help find the Golden Nonce.

Emily: Wow! Now what?

Greg: If there is a will, there is a way. Turns out that we can use Coinbase transaction to solve the problem.

Emily: What’s that?

Greg: Let’s first find out what Coinbase is. According to this Wikipedia page, Coinbase is “an American company that operates a cryptocurrency exchange platform.” “It is the largest cryptocurrency exchange in the United States by trading volume.” What makes Coinbase transaction special is that it is always the first transaction in each block, and it is created by miners who use it to collect the block reward and other transaction fees.

Emily: How does it work for solving our problems here?

Greg: It may sound complicated, but the idea is simple: We use the Coinbase transaction data as extra space to hold extra nonce.

Lily: How much space can we get from the Coinbase transaction?

Greg: Quite big, it can hold anywhere between 2 and 100 bytes of data. That space is called “extra-nonce space,” which provide an extra nonce mining solution. Say we use 8 bytes of the Coinbase data space, plus 4 bytes of “standard” nonce space, there would be 12×8=96 bits, or “2 to the power of 96” instead of “2 to the power of 32” as previously with the standard nonce.

Lily: Wow, with this much space we don’t have to use the Timestamp.

Greg: That’s right. The other good thing is that Coinbase transaction always enters Merkle Tree, so anytime there is a change in Coinbase transaction, it will change the block hash.

Emily: What’s a Merkle Tree?

Greg: That’s the question for another day. We will also talk about encryption and compare Proof of Work and Proof of Stake.

Categories
Blockchain Financial talks at dinner table

All About Cryptography

The Kingstons agreed to dig into more details of cryptocurrency mining asked by Emily. Although the issues are more technical than all the previous conversations the family has had, the conversation style keeps the text short and pointed because anyone can ask any questions along the way. At the end of day, however, they did not go any further than talking about hash, hash function and cryptography.

Greg: Let’s consider the mining question Emily raised at the very beginning. Remember we were talking about a decreasing reward for miners? Turns out that the Bitcoin algorithm also has a changing level of difficulty for mining, which can either go up or down, depending on the number of miners in the game and how active they are mining.

Joy: That’s right. Please don’t feel overwhelmed Emily because this issue is directly related to what mining is. We’ll get there to answer your questions.

Emily: Thank you for telling me that. Meanwhile, I’ll keep asking questions along the way if you don’t mind.

Greg: Of course not! Let me begin from one concept called “difficulty epoch” as discussed by a CoinDesk article. Each epoch corresponds to 2,016 blocks of transactions, which in turn correspond to roughly two weeks. After the current difficulty epoch is reached, the difficulty level will be updated either up or down, based on the number of miners and their activities in the last two weeks.

Joy: Yeah, the goal in the algorithm is to finish verifying a block in ten minutes. If last two weeks have seen less than ten minutes the difficulty level will be up, otherwise down.

Lily: So it looks like not only the entire supply of Bitcoin will reach 21 million coins in 2140 but the pace of releasing new bitcoins is also determined by the algorithms at 10 minutes per block.

Joy: Yeah, the whole process is transparent. You can prove it with the numbers. 10 minutes per block means 6 blocks in one hour, 144 blocks in one day of 24 hours, and 2,016 blocks in two weeks or 14 days because 2,016=144 x 14.

Greg: Not meant to confuse you, but there is another milestone related to the decreasing coin reward to miners. Remember we learned yesterday that four every four years the reward will decrease by half. That four years correspond to 210,000 blocks created or confirmed.

Emily: How do the algorithms control levels of difficulty?

Greg: The key is to change the number of leading zeros in the target hash function.

Emily: Wow, what’s a hash function?

Joy: We talked about hash function before when we were discussing NFTs. A hash function is best to be called a “fingerprint machine.” In math terms, hash function is nothing but algorithm that accepts different inputs or data or messages and then produces uniform sized “fingerprints” that can be called “hashes,” “hash values,” “hash sums” or “message digests.” I can show you a static picture here, but the guy named Haseeb Qureshi does a better job in a blog showing a really neat dynamic cartoon picture.

Hash input, hash function and hash digest

Greg: Haseeb Qureshi did a good job but this video is by far the best I’ve ever seen after reading, searching and watching many other pieces and sources. It explains a whole bunch of concepts like block, blockchain, hash, hash function, nonce, distributed network, tokens and Coinbase and nicely put them together with a little demonstration that clearly and visually get the ideas crossed. It’s so intuitive that people as young as Jason can understand because everything is right there in front of your eyes. It’s about 18 minutes long but I guarantee that it won’t waste a single minute of your time.

Emily: Wow! I’ve never seen you so excited before. We sure will watch it later.

Greg: Just a bit background information for the video. At the beginning of the video you will see the term “SHA-256,” that means “Secure Hash Algorithm” that produce hashes that are 256 bits long. Bear in mind that when it comes to computer terminologies, we don’t count “words” but only “bits” and “bytes.” One byte is 8 bits. So 256 bits is just 32 bytes.

Emily: Why should we care about these details?

Greg: You don’t have to. We could sit here talking about bits, bytes and hexadecimal numbers all day. But the important thing to keep in mind is that the SHA-256 is a hash function, or more accurately a cryptographic hash function — the machine that makes hashes or “fingerprints.” There are other hash functions but SHA-256 is the most popular one. If you must know one hash function, SHA-256 would be it. Bitcoin uses SHA-256, for example. I learned from this article by n-able.com that “The US government requires its agencies to protect certain sensitive information using SHA-256.”

Kimberly: What make SHA-256 so much liked?

Greg: That article by n-able.com again offers a good summary: (1) one way function from input data to hash and almost impossible to figure out what the input data is even if you know its hash because “A brute-force attack would need to make 2256 attempts to generate the initial data.” (2) Uniqueness of hash, once again because the “2256 possible hash values (more than the number of atoms in the known universe), the likelihood of two being the same is infinitesimally, unimaginably small.” (3) the avalanche effect that “a minor change to the original data alters the hash value so much that it’s not apparent the new hash value is derived from similar data; this is known as the avalanche effect.” These are the major ones; I will add more later when we compare hash function with encryption.

Joy: Now that you mention encryption, I remember reading somewhere that cryptocurrency needs both hashing and encryption.

Greg: That’s true. The nice thing though is that encryption and decryption, hash functions, and digital signature algorithms are all parts of cryptography. This is why Bitcoin and others are all called “cryptocurrencies” because they all use the same foundational technologies of cryptography.

Emily: What does the word “cryptography” mean?

Greg: Good question. This article from Investopedia offers a good explanation. I have it downloaded to my phone. Here it is: “The word ‘crypto’ literally means concealed or secret. ‘Cryptography’ means ‘secret writing’ — the ability to exchange messages that can only be read by the intended recipient.”

Emily: Sounds like cryptography is all about security and confidentiality of information or data.

Greg: More accurately it’s a decentralized way of keeping information, data and transactions secure, a way that does not require a third party or a central authority. Furthermore, the technologies not only provide security but also efficiency. If you watch the video I recommended, you will see that we can put in all the stuff from the Library of Congress and the hash function still produce one hash digest that is only 256 bit long!

Lily: What about encryption and decryption? What are they and why we need them?

Greg: They serve different functions for cryptocurrency. So far we have been talking about cryptocurrency mining, which relies on the hash functions. But when we get to the transactions between digital wallets, encryption and decryption become the key tool.

Kimberly: How do hash function and encryption differ?

Greg: That’s a hot topic and much discussion surrounding it. The first key difference is that encryption is a two way process, meaning you first encrypt the plaintext data to make it secret or unreadable, which is called “ciphertext”, and then you need to decrypt to make it readable.

Joy: This is like sending and receiving a telegraph in the old days.

Greg: Exactly. Say someone’s grandma is seriously sick, she’d rush to the post office and writes down the words “Grandma sick, come home!” to be sent to her brother. The post office worker would first translate, encrypt that is, the words into a bunch of codes, and then send to her brother. Once the telegraph arrives at the receiving post office near where her brother lives, someone else in that post office will translate, decrypt this time, the codes into plain English.

Kimberly: How is the hash function different?

Greg: Hash function always works one way, meaning there is no decryption. Once the input data, messages or transactions were hashed, we don’t want them to be decrypted or to make the hash readable by a human. For a hashing function, such a reverse process — if succeeded — would be a disaster because it means the hash function failed to do its job.

Kimberly: But why is that a good thing? It’s like sending a telegraph out that no one can read and understand, right?

Greg: I thought about that for several days by asking myself the same question as you just did: What if someone needs to read and understand the original input, not just the hash? I searched online using that question and could not find any answer.

Kimberly: So do you have an answer now?

Greg: Suddenly it came to me yesterday that it’s not the right question to ask, because it failed to take the purpose of blockchain data into consideration. When people put transaction records in a blockchain, they want two things: One, keeping those records in the chain permanently and remain unchanged forever. Two, making the authenticity of all the records in each block easily and quickly proven. For those purposes a one way hash function works out perfectly.  

Kimberly: Could you elaborate on that?

Greg: It is directly related to a very nice property of the hash function. Not only is it a fingerprints machine, but the machine is extremely efficient. Remember I talked about earlier that even if we put all the books and journals from the Library of Congress into one block — I know that’s impossible given the 1 MB per block data limit set by Satoshi — the SHA-256 hash function would still produce just one hash that is 256 bit long?

Kimberly: Yeah, why is that relevant here?

Greg: Well, keep using the Library of Congress example, and still assume the entire collections were fit into one block, with the hash function working properly, even if I changed one comma in one book — and there are 167 million items when I checked it last night — to a period, the hash will be completely different.

Joy: Yeah, even a tiny change in the input will certainly lead to a completely different hash. This is called “Avalanche Effect.”

Kimberly: Those are impressive, but I still don’t see their relevance with our discussion here.

Greg: Think of it: How would you make sure that none of the records in a block has been tempted? Checking all the records one by one, or just look at the hash function to see if it has been different?

Kimberly: Oh, I see! A hash function makes it very easy to find out any changes made to any record in a block. I can buy that, but what about encryption? Does it do the same thing as a hash function?

Greg: Smart question! If I say “yes,” then we can use encryption to still get what we want. Unfortunately, the answer is “no.” You see, the output from encryption varies, depending on the size of the input. That means longer inputs or “plaintexts” will have longer outputs or “ciphertexts.” This is just like telegraph, the more words you send, the longer the telegraph and more money it costs you.

Joy: Very interesting. The other reason we can use hash function for blockchain is that all hash functions are deterministic, meaning that given the same input, only one hash digest will be produced. Therefore, while it is virtually impossible for anyone else to reproduce the input from hash, whoever owns the input record knows perfectly well what the input is. She does not have to do the “reverse engineering” like a hacker would have to.

Emily: You say, “virtually impossible,” is it still possible to find the input once you have the hash?

Joy: It is possible but highly unlikely. The way to do it is through the so called “brute force attack,” meaning to run through all the possible combinations until hitting the target. This requires great resource with very low chance of success. Remember the reason we were told earlier: A hackers would have to make 2256 attempts to generate the initial data.

Lily: I am thinking of passwords that we use every day. They are usually not very long, so which function is best for protecting passwords, hash function or encryption?

Greg: Good question. The answer is still hash function but for a different reason. Can you guess what it is? It’s because decryption — the process that makes an unreadable text readable — is a bad idea that is asking for trouble. This article correctly points out that “it’s more secure to store the hash values of passwords instead. When a user enters a password, the hash value is calculated and then compared with the table. If it matches one of the saved hashes, it’s a valid password and the user can be permitted access.”

Joy: Speaking of passwords, I’ve read an interesting story that is almost funny: Turns out if you limit the passwords to a four-digit number, the choices made by many people are highly predictable. I still remember that the top choice is “1234,” followed by “1111” and “0000.” Those made the “top three” list.

Lily: So is encryption any good at all for cryptocurrency? It sounds like hash function is all we talk about.

Greg: That’s a question for another day.

Categories
Blockchain Cryptocurrencies & NFTs Financial talks at dinner table

Blockchain & Cryptocurrency

After yesterday’s talk on editable blockchains, the family comes back today to continue their conversation on blockchain and cryptocurrency mining. The conversation is mostly between Emily, who believes she is not good at technical details, and her parents.  

Greg: I hope you all had the time to find something related to blockchain. Yesterday we talked about philosophical issues of absolute or relative immutabilities, today I think the issues may be more detailed and more technical.

Emily: I guess I’m not good at technical stuff. Can you help me with “Proof of Work?” versus “Proof of Stake?” I know one of the top cryptocurrencies, Ethereum I think its name is, is moving toward “Proof of Stake” while Bitcoin stays with “Proof of Work.”

Kimberly: That’s right. I read a report from the Fortune magazine that Ethereum is currently running both “Proof-of-Work” and “Proof-of-Stake.” But when they finish the highly expected upgrade, which we don’t have a set date yet, it will be “Proof of Stake” only.

Lily: And I read an article published by Bitcoin magazine that says Bitcoin will not, and could not, switch to “Proof of Stake” because Bitcoin code is immutable.

Joy: It’s important to remember that first of all, “Proof of Work” and “Proof of Stake” are different ways of doing cryptocurrency mining. Perhaps even more importantly they are both “Proofs of Resources” in the sense anyone possessing more resources has a better chance to become a winner in crypto mining.

Emily: You said “a winner” so there is just one winner? Also what is cryptocurrency mining? Why are so many people interested in mining?

Joy: Let’s begin from the last question, which is the easiest: People want to mine crypto for the same reason today as people came to California during the “gold rush” in the 19th century. They want to win something big.

Emily: How big is “big?” I mean the size of miner reward.

Joy: Let’s find out. Jason, could you Google today’s Bitcoin price for us please?

Jason: Sure. “Hey Google, what’s the price for Bitcoin today?” Here it is: $31,119.80 for one bitcoin on May 15, 2022.

Joy: Thank you! Just to be clear, a winning miner will get far more than $31,000 because she receives more than one bitcoin, 6.25 coins to be accurate for now, every time she successfully mined one block of crypto transactions. We multiply the unit Bitcoin price of $31,119.8 Jason just found for us by the number 6.25, which is $194,498.75.

Emily: You said, “for now.” So 6.25 coins are not constant all the time?

Joy: No, how many coins the winner gets are not constant but keep decreasing by half roughly every four years, until it goes to zero in 2140 when there will be 21 million Bitcoin in total.

Emily: How does the decreasing reward work?

Joy: It’s called “block halving event” and let’s show it with numbers. I will quote this website called bitcoinblockhalf.com that does a good teaching job. I have it downloaded to my phone. Here it is: “When Bitcoin first started, 50 Bitcoins per block were given as a reward to miners. After every 210,000 blocks are mined (approximately every 4 years), the block reward halves and will keep on halving until the block reward per block becomes 0 (approximately by year 2140). As of now, the block reward is 6.25 coins per block and will decrease to 3.125 coins per block post halving.”

Emily: I understand these numbers but why the decreasing rewards. That’s not fair to later miners don’t you think?

Joy: This is a good time to tell the entire crypto rewarding story, or why miners get rewarded in the first place. Let me ask a question first: Who do you think is authorized to issue the paper money?

Lily: The central banks. In the US that’s the Federal Reserve.

Joy: That’s right. Now, who has the authority to issue Bitcoin, Ethereum and other cryptocurrencies?

Lily: No one. They are decentralized currencies I believe.

Emily: Wait, what are “decentralized currencies” versus “centralized currencies?”

Lily: The dollar bills we use every day are centralized money because every dollar bill is issued and controlled by the Federal Reserve, nobody else can do that. That monopolistic and central control makes the dollar centralized currency.

Greg: Now that we are on the topic, centralized versus decentralized is not the same as distributed. I read an article talking about how the three systems differ. Briefly, centralization or decentralization refers to mode of control, while distribution is about location.

Joy: Yeah I heard about that, too. Bitcoin, or more accurately its blockchain, is decentralized but also distributed: “Decentralized” because decisions are made not by a central authority but by consensus; “distributed” because the nodes in a peer-to-peer computer network are all over the world.

Nodes in a peer-to-peer network

Greg: Here is a picture of the three systems I found online. Centralized has all links pointing to a single center, kind of like the Chinese political system where everything is eventually determined by Beijing. Decentralized does not do that, although it may contain hubs of links, kind of like the federation system this country has, where hubs are different states. Distributed has neither a center nor hubs. It is like “direct” or “pure” democracy if you will, getting rid of the representatives altogether.

Lily: I don’t know you guys but if we were treating all three systems as modes of control for decision making, I will pick the one in the middle, the decentralized mode, although I understand the “distributed” system is for locations, not exactly for controlling.

Kimberly: I feel the same! Decentralized has advantages from both sides, just like “representative democracy” is better than centralized dictatorship and distributed “direct democracy.”

Three Systems of Decision Making & Location

Greg: Going back to cryptocurrencies, they are all issued and controlled by algorithms, not by government agencies.

Emily: What are algorithms?

Greg: An algorithm is a predetermined set of rules for computing. In this country we have rule of law for governing human behaviors. Algorithms are the rule of law for governing computer behaviors.

Emily: Interesting. I did not realize how important algorithms are in our lives.

Greg: Bear in mind though algorithms are initially designed by humans. Once started, an algorithm can obtain its own life, or works by the designed logic until we decide to change the rules later.

Joy: I really want to comment on the algorithms in cryptocurrency, more specifically Bitcoin, has been well thought of. Let’s ask ourselves this question: Why was the algorithm designed to reward miners? This is highly relevant to Emily’s question of why the miner rewards are reduced by half every four years.

Lily: From what I have read, it’s all economics. When Bitcoin first started, it must compete with the monopoly power of central banks. The way it competes is through mobilizing as many people as possible, to get them involved in creating and owning cryptocurrencies. Offering reward in Bitcoin — not in dollars — is the best way to go, because miners would have their personal interests lined up with increased value of Bitcoin, or all cryptocurrencies for that matter.

Joy: That’s right! Decentralized power comes from having a large number of people all working for the same goal with shared interest. The economic reasoning behind cryptocurrency rewarding is to give higher reward at the beginning, when Bitcoin was a brand new “startup money” and not many people knew about it.

Lily: It also reflected the lower value of Bitcoin in terms of dollars back when it started in 2009.

Joy: Exactly! The priority back then was to attract more miners to join the digital “gold rush,” to make some “cryptocurrency noise,” to increase decentralized power, which all add up to benefit the value of Bitcoin or other cryptocurrencies.

Kimberly: I see the logic now: The algorithm assumes the value of Bitcoin will get higher and higher as time goes on, so there is no point in keeping the same number of rewarding Bitcoin for the winners.

Emily: I see it, too. Even though the number of Bitcoin rewarded goes down from 50 in 2009 to 6.25 today, the dollar value is perhaps higher than 2009 given the current Bitcoin price. The miners today can take home much more than earlier miners.

Greg: That’s exactly what happened. One thing I love about this country is that you can always find the information you want. I was searching for the price history of Bitcoin and came across this article from Investopedia called Bitcoin’s Price History. We can see Bitcoin had a price of zero when it was introduced in 2009. That changed on July 17, 2010, when its price jumped to $0.09. So indeed the 50 bitcoins received by the first miner meant nothing in 2009, while 6.25 bitcoins are enough to bring six digit income now, even with the recent cryptocurrency price crash.

Joy: This is why I had a hard time believing Warren Buffett actually said that he would not buy all the Bitcoin in the world for even $25, because he said he could not find any use of Bitcoin. He seems to have forgotten what he has been doing for all his life: investing in something for better returns. That’s exactly what one can do with Bitcoin. Let’s say someone sold Buffett 50 bitcoins back in 2010 at the historical price of $0.09 per coin, and he kept those until today, he would have gained how much? Jason, could you do the calculation for me?

Jason: No problem. 50 bitcoins times the unit price of bitcoin today at $31,119.8, that’s $1,555,990, more than $1.5 million! Let’s take out his historical cost of $4.5 in 2010, his net profit would still be $1,555,985.5!

Greg: Let’s calculate his rate of returns. Divide his gain of $1,555.985.5 by his cost of $4.5 and then multiply 100 to make it a percentage figure. What do we have, Jason?

Jason: Wow! That comes out to be 34,577,456%!

Greg: That was phenomenal, and I doubt if Buffett’s other investment records can beat that.

Emily: I still have a concern for miners after 2140, when the algorithms will stop paying reward as there won’t be new Bitcoin released once the algorithm reaches its goal of 21 million Bitcoins.

Joy: I won’t worry too much about that. Miners are still capable of charging fees against Bitcoin users because transactions will still need to be audited by miners. Miners have other privileges like voting for Bitcoin rule changes as well.

Greg: I think we’ve had an interesting discussion on things like decreasing mining reward, centralized versus decentralized currencies, distributed nodes and the value of cryptocurrencies as “investible assets.” But we have yet to answer Emily’s questions about what mining is in any details, about “Proof of Work” versus “Proof of Stake.” We’ll have to stop here as it gets late. Do I have everyone’s consensus to continue the talk tomorrow?

The answer is “yes” and that marks the end of conversation for today.

Categories
Blockchain Financial talks at dinner table

Blockchain & Relative Immutability

It has been weeks since the Kingstons had a conversation on NFTs, Bitcoin and Blockchain based on the blog post written by Devin Finzer, co-founder of OpenSea the largest NFT marketplace in the world. Greg has been busy writing a research paper, and the rest of family had to mind their own business. But today is a good day as everyone feels the need to catch up where they left off last time.

Kimberly: I feel like we should talk more about blockchain. Last time we briefly touched on it, like how a blockchain keeps ownership of NFTs or transactions unique or “non-fungible.” But there must be more to blockchain, right?

Jason: Wait, what is a transaction that you guys keep talking about? Is it buying or selling something, like I paid my friend Lee $1 yesterday to buy two sweetest apples from his family trees?

Joy: Yeah, business transactions are the most obvious that involve at least two people and usually money changing hands. But not all transactions involve two people nor money. If your friend simply gave you an apple for free, that could still be called a transaction.

Emily: Some transactions do not involve different people, either. If I change my weekly budget to cut down food spending and increase book spending, those changes are recorded as transactions, too.   

Greg: To answer Kimberly’s question, of course there are more, much more to blockchain. Last time we were mostly talking about NFTs, the stuff that Devin Finzer and OpenSea focus on. We can go deeper into blockchain today if you guys want.

Joy: Let’s do that. To start, I remember reading this interesting article from Investopedia with a flashy title of “Forget about Bitcoin: Blockchain is the future.” It basically calls Bitcoin a small side show and the blockchain the big drama.  

Lily: I’ve seen that, too. Somehow I feel the article is exaggerating the case. Some people are only interested in Bitcoin and know little about blockchain, while others believe blockchain represents the future technology, or the greatest invention since the Internet.

Joy: I agree. we don’t have to forget about Bitcoin in order to remember blockchain. Historically, blockchain came to us much earlier than Bitcoin did, so in that sense blockchain is the “chicken” and Bitcoin the “egg.”

Kimberly: It is also true though that many people discovered or became aware of blockchain only because of Bitcoin. It’s almost like they ate the “egg” first to then realize the value of the “chicken.”

Emily: Yeah, like I did not know much about the Titanic ship tragedy until the other day when I watched the movie Titanic with Kate Winslet and Leonardo DiCaprio in it.

Jason: So you are saying the Titanic movie is your “chicken,” the real Titanic ship is your “egg?”

Emily: I’m saying it can go both ways. A “chicken” for someone can be the “egg” for someone else. We don’t have to settle down on one order and put that in stone.

Joy: You have a good point. If I were to write that Investopedia article, I would use a title like “Appreciate Bitcoin but Understand Blockchain.” People use flashy titles all the time to catch more eyes and ears, and I get that. But everything has a limit, we should not go too far on that.

Greg: I like the way Emily said it: putting something in stone. That old expression now may have a new way of saying it. Some people may stop saying “set in stone.” They’ll probably say, “set in blockchain!”

Kimberly: Interesting. I assume it is because blockchain makes everything in it immutable or, to put it in plain English, permanently unchangeable. But how exactly does blockchain do that?

Greg: First thing first, I don’t want you guys to think blockchains are absolutely immutable. Everything is immutable with the right amount of resources, like money and time.

Lily: Are you saying the stuff inside a blockchain is changeable? I have never heard anyone saying that before, everyone seems to be saying a blockchain is immutable database.

Greg: There are two kinds of thinkers in the world. Some just see further than the rest of us, not necessarily because they are smarter — they usually are — but more because they ask the right questions, assign themselves more challenging jobs and do not blindly follow others’ thinking trail just because it’s popular.

Joy: You are talking abstract. Any example please?

Greg: I’ll cite this article by Dr. Gideon Greenspan who works on private blockchains, and I believe it raises some excellent points. I’ve downloaded it to my phone.

Emily: Wait! What is a “private blockchain?” Are you talking about different ownerships of blockchain? So a private blockchain is privately owned by someone?

Joy: Public or private blockchains are not exactly about ownership. A private blockchain for example can be owned by governments just as likely as by private firms. I think it is better to call them “permissioned” or “membership” blockchains, meaning you need permission or membership to get into them, much like you need a valid username and password to enter your email accounts.

Greg: That’s right. Since Bitcoin started on a “permissionless” blockchain, most blockchains are in that category, meaning they are open for any strangers to see all the transactions inside. They are “open to public” but not necessarily owned by public.

Jason: Unlike the public library we visited last weekend that is open to public and is owned by the city government.

Joy: Correct. Speaking of “permissioned” blockchain, I’ve read something from Investopedia that says some banks claim they build blockchain but they’re not, because their blockchain is private or requires permission, which according to the author, has little to do with the innovation behind Bitcoin.

Greg: The voices against private blockchain are louder than that because, like Greenspan puts it: “immutability has become a quasi-religious doctrine – a core belief that must not be shaken or questioned.” Imagine the response when someone’s religious belief was challenged.  

Lily: Interesting. I did not see immutability as a religious doctrine for blockchain but did take it for granted. So what does Greenspan say about blockchain immutability?

Greg: He challenges the common wisdom and calls the blockchain immutability a “myth.”

Joy: Is he trying to use a flashy title to make news?

Greg: I can’t read what’s on his mind, but he does make several convincing points. First and foremost, he answers the fundamental question by critics of private blockchain: What is the point of developing a blockchain if its contents can be changed or edited? Would anyone guess what his answer is?

Joy: I don’t know what he would say but I would argue that we humans want different things. Sometimes information security or immutability is the top priority, for that blockchain immutability serves us the best; but other times controllability is the king, meaning we want to keep the capability to change things as we see fit. At the end of day, no matter how powerful our computers are, we still want control them, not they control us.

Kimberly: I agree. For financial transactions it makes perfect sense to keep all the records straight and not to be modified or edited once they enter a blockchain. We also don’t want our passports, our driver’s licenses or our tax returns to be changed, especially not by anyone else.

Emily: I see what you mean. But mom is right, some records or transactions we do want to make changes from time to time to fix human errors, frauds. The law changes, too, which means legal contracts sometimes need to be updated.

Joy: That’s right, even smart contracts may need updates.

Lily: I think part of the problem is that blockchain was made popular by Bitcoin. Some people only see the Bitcoin side of the blockchain story. I don’t know if this is a good analogy but to me blockchain is like the gunpowder: We can use it to make fireworks for the Fourth of July, but the same gunpowder can be used to make weapons. A kid only knows the former, but a terrorist is only interested in the latter.

Emily: So to ask why anybody wants an “editable blockchain” is like a kid asking why anybody wants to use gunpowder for anything other than fireworks.

Lily: Something like that. But dad, you haven’t told us what the answer from Greenspan is.

Greg: Well, his answer is long and although I like the points he makes, he does sidetrack himself a bit and spends much time telling us why no immutability is perfect even with “permissionless” blockchain. His point is well taken there because it is true immutability depends on the tradeoff between what we want and what resource we have. So immutability is a relative thing, not an absolute one.

Lily: So he did not tell us why an “editable blockchain” is needed.

Greg: Not really. Your mom actually does a better job in answering that “why” question. There is also this webpage by Accenture called “Editing the Uneditable: Blockchain Needs to Adapt to an Imperfect World,” which essentially says the same thing as your mom did. Let me see if I can find the page.

Kimberly: The title seems to offer a clue to the answer: We need editable blockchain because the world is not perfect and static.

Greg: Yeah. I’ve found the page and here it says: “In most instances, immutability is an obvious benefit. But it’s also increasingly apparent that instances will arise where absolute immutability is a hurdle standing in the way of blockchain’s adoption.” Then it goes on to list areas where editability or mutability is good and needed, like in data storage, illegal actions, operational errors, permanent mischief and regulatory concerns.

Kimberly: I can understand why relative immutability is good and necessary, but I have a more basic question: Relative or absolute, how does blockchain ensure immutability?

Emily: I want to ask that question, too. How about you, Lily?

Lily: Same here.

Greg: I think this is a good place to stop for today. Why don’t we all do some homework on that and come back tomorrow to share our findings?

Everyone agrees and the talk comes to an end.