“B” is for Blockchain By William Lama, Ph.D.

“B” is for Blockchain

By William Lama, Ph.D..

Nearly everyone enjoys Sue Grafton’s Alphabet mysteries.

Although business has been slow lately for P.I. Kinsey Millhone, she's reluctant to take on the case of locating Beverly Danziger's sister Elaine Boldt. Beverly claims she needs Elaine's signature on some documents so that she can collect a small inheritance.

If Beverly had used a “smart contract” on Ethereum’s Blockchain, the mystery would be solved in a flash. But I’m getting ahead of the narrative begun in my last essay “B” is for Bitcoin. “B” is for Bitcoin by William Lama, Ph.D. — Palos Verdes Pulse      

By now it’s clear that much has changed in the nature of banking and credit since the decline of the Savings and Loans and the rise of plastic money. The life-cycle of a credit card transaction illustrates the details. If it looks complicated that’s because it is. Introduction to Credit Card Transactions (thebalance.com)

3DS Payment Gateway-International High Risk 3DS Payment Gateway

The credit card information you provide to the merchant is sent to the merchant’s bank which sends the request to the credit network, which contacts the credit card issuer to make sure the card is valid and that there's available credit for the transaction. Then the credit card issuer sends back an authorization for the transaction, the merchant’s bank sends an approval message for your credit card purchase and the credit card network sends payment to the merchant bank. Whew! The credit card issuer sends you a bill for the charges made during the month. You must pay on time or see your FICO score decline.

The Bitcoin Transaction

Compare that to a Bitcoin transaction. To illustrate, let’s return to the transaction used in my last essay. That involved sending a bit of bitcoin (BTC) to Linda. Here is a summary of all the steps.

To begin, Linda and I need "addresses" on the Bitcoin network. When you sign onto the network you receive a "private key." It is just a very long random number that is yours alone, similar to the password for your bank account.

 sign on bitcoin network >>>> private key

Then your private key is run through a math algorithm that transforms it into your "public key" - analogous to your bank account number that is not private. Your public key is then passed through a cryptographic process called "hashing" that produces your bitcoin "address."

 private key >>>> public key >>>> address

To complete the bitcoin transaction, one also needs a "digital signature" that is unique for each transaction since it cryptographically joins your private key with your address and the data inside the "transaction message." (For example, "Send 0.001 BTC from Bill's address to Linda’s address.")

private key + message + address >>>> digital signature

Finally, the transaction is "validated" when the bitcoin network uses Bill’s public key to verify that he is the owner of the BTC that he wants to transfer.

digital signature + public key >>>> validation

The valid transaction is then filed in a pool of transactions (the memory pool or mempool) waiting to be put into a block on the blockchain via the "mining" process.

message + mining >>>> transaction complete

Eventually a miner picks the transaction among others from the mempool and begins the process of creating a new block on the Bitcoin blockchain.

How does Blockchain Work? - Blockchain Transaction - Intellipaat

Bitcoin Mining

Contrary to the common view, Bitcoin miners are not “digging through the dark corners of the internet searching for shiny new bitcoins hidden in computer code.” The mining process does involve compute-intensive work and lots of electrical energy. Here’s how it goes.

The miner selects transactions from the mempool and creates a candidate block. She then begins a proof of work. The block header contains a time stamp, the hash of the previous block and a target, a large random number (potentially 68 digits long) that is known to the entire network. The header also contains a counter called a nonce which is initially set to zero.

Then the miner hashes the block header (using SHA256). If the hash output is less than the target, congratulations, you’ve got a valid proof of work. However, success is nearly impossible on the first try. So, the miner increments the nonce (set = 1) and hashes again. No cigar. The miner repeats this process billions and billions of times. The chance of a computer producing a hash below the target is roughly 1 in 16 trillion. Basically, the miner's computer spits out hashes of the block at different rates up to terahashes per second, depending on the hardware. Eventually the miner obtains a hash that is less than the target, the block is added to the blockchain and the transactions contained within the block are consummated. Linda receives her 0.001 BTC. On average this mining process takes 10 minutes, adding 144 new blocks per day. Currently the Bitcoin blockchain contains about 700,000 blocks.

Crypto-Miners: What Are They and What Steps You Can Take to Protect Yourself | AT&T Cybersecurity (att.com)

Successful miners are rewarded with newly minted BTC. The first miners in 2009 earned 50 BTC for each new block. Since then, the block reward has been halved every 210,000 new blocks and the current block subsidy is 6.25 BTC. At $54,000 per BTC (the price on 11/28/21) the block reward works out to $337,500. Since new blocks adds 6.25 BTC, 900 new BTC are created per day.

New bitcoins are released to the miners at a fixed but periodically declining rate. By design there is a hard limit of just 21 million bitcoins that can be mined in total. There are about 18.9 million bitcoins in existence and 2.1 million bitcoins left to be mined. This will continue until 2140.

To summarize, the Blockchain is a distributed ledger each block of which is a collection of valid transactions. All of the computers (nodes) running the blockchain code and acting as bookkeepers have the same list of blocks and can see new blocks filled with new transactions.                                                                                                                                                                                                                     

Although anyone who joins the Bitcoin network as an active node can also be a miner, the process has become so compute-intensive that only those with very specialized computer hardware can compete. In fact, the most successful miners are the mining farms clustered in areas with cheap electricity. About 80% of the hashing power in the world was concentrated in just five Chinese companies until China outlawed mining. Now the US has become the world’s mining center.

Some readers may wonder if Bitcoin transactions are actually less complicated than credit card transactions. Some wonder about the utility of Bitcoin as an exchange currency and as a store of value. I couldn’t possibly comment.

Ethereum

But what about P.I. Kinsey Millhone and the Ethereum smart contracts? Ethereum is a digital currency second in popularity to Bitcoin. The Ethereum currency is called Ether (ETH). Like Bitcoin, Ethereum uses the blockchain technology. But Ethereum has more functionality than the Bitcoin blockchain which only transacts payments. With the Ethereum blockchain you can do that plus create and process transactions that don’t involve currency. These are generally called “smart contracts.” If Beverly had used a smart contract, it would be available for all to see on the Ethereum blockchain.

You could even use the Ethereum blockchain to create your own digital currency. I may do just that. My crypto coin will be called Westie Coin (WST) and will be a token, like Doge, that features my Westies.

All I have to do is submit a smart contract to the Ethereum blockchain that issues, say, one million WSTs to me at my ETH address. The WSTs would be stored on the blockchain and I could sell them to whomever for a mutually agreed price.

Lama Westies: Brody, Charlie and Sammy (RIP)


Dr. William Lama has a PhD in physics from the University of Rochester. Taught physics in college and worked at Xerox as a principle scientist and engineering manager. Upon retiring, joined the PVIC docents; served on the board of the RPV Council of Home Owners Associations; served as a PV Library trustee for eight years; served on the PV school district Measure M oversight committee; was president of the Malaga Cove Homeowner's Association. Writes about science, technology and politics, mostly for his friends.

email: wlama2605@gmail.com