"It was something that was born on the internet, that was developed on the internet, that was tested on the internet — it is of the internet."
― Jack Dorsey
Bitcoin is now entering the lexicon of legendary macro traders and no longer considered as nerd money. Instead of jumping on the bandwagon straight away, I wanted to learn the intricacies of Bitcoin to appreciate its full potential.
One problem that I faced in my attempts to learn about Bitcoin from scratch was that the explanations were either too simplified or too technical.

So, without further ado, here's my technical guide to Bitcoin Protocol for non-technical people.
Bitcoin vs bitcoin:
Bitcoin is both the protocol and the currency. It is generally accepted practice is to use Bitcoin (singular with an upper case letter B) to refer to the protocol that forms the basis of the ecosystem, and bitcoins (with a lower case b) to label units of the currency.
What is Bitcoin?
“Money is the most universal and most efficient system of mutual trust ever devised.”
― Yuval Noah Harari, Sapiens: A Brief History of Humankind
Unlike physical money, such as banknotes or gold coins, the virtual nature of digital currencies allows easy (and unlimited) replication of itself. This poses three fundamental problems:
Can I trust the authenticity of the money?
Can I be sure the money solely belongs to me? (The "double-spend" problem)
Can I be sure the supply of the money will be stable or limited?
Or asked differently, how do we ensure a digital asset to behave like a physical object?
Asked differently again, how do we ensure a digital asset is never replicated?
The answer is to allow every single participant in the ecosystem to track and monitor transfer records of this asset from its creation to the current moment.
Bitcoin incentivizes the participants to maintain a public transaction ledger by reaching consensus on new transactions based on computational power.
Let's learn how Bitcoin establishes a system of trust based on computational power.
How Bitcoin Works
What is Hashing?

Hashing is a process of mapping a group of characters (called a key) to a fixed-sized string of texts (called a hash value or hash) using a mathematical function.
Any text, no matter how long, can be converted into an array of numbers and letters through an algorithm.
What is the advantage of hashing?
Hashing is a reliable and flexible method of data retrieval. It is faster than searching through multiple arrays and lists.
Here's a simplified example to illustrate the advantages of hashing.
Let’s say we have a 3-dimensional multiplication table:

If we were to find the value for x = 17, y = 53, z =183, we would have to sift through each axis to find the corresponding value. Or, we could simply "compute" 17 x 53 x 183.
Now, imagine the labels on each axis are not in any logical order.
It will be a lot quicker to take out a calculator and run the multiplication.
Cryptographic Hash Functions in Bitcoin
One of the two main cryptographic hash functions used in Bitcoin is SHA256, which was designed and published by the National Security Agency in 2001.
SHA256 is a one-way function that generates an almost-unique, fixed-size 256-bit hash:

One of the key properties of this cryptographic hash function is that a slight change in the message will generate an unrecognizably random hash. The only way to reverse engineer the message from a hash is to guess the correct one out of 2^256 possibilities.
And this is a very very large number:

The world simply does not have enough computing power to correctly guess the message from the hash of SHA256, thereby making the inverse infeasible.
Bitcoin Wallet
A Bitcoin wallet contains a pair of keys: a private key and a public key. A wallet is required to execute a transaction on Bitcoin's peer-to-peer network.
As the name suggests, the private key should not be shared with anyone as it will prove your rightful ownership of bitcoins without having to explicitly share it with other participants.
Let’s learn how a wallet interacts with the network through Jenny’s experience.
User story: Jenny
Jenny is keen to get started with using bitcoins. Jenny googled “Bitcoin wallet” and finished creating her wallet.
Knowing that her friend Toby is a well-known Bitcoin user in her group of friends, she reached out to him and agreed to pay him $950 to receive 0.1 bitcoins.

To receive bitcoins from Toby, Jenny must share her address. Just like you would ask people to send emails to your email addresses, you would ask others to send you bitcoins to your bitcoin address.
Jenny’s address (A) is generated from her public key (K), which is in turn generated from her private key (k):

Jenny’s wallet created an address, which she promptly shared it with Toby.
She is now ready to receive her first bitcoin.
Bitcoin Transactions
A transaction is a message sent out to the network that an owner of a number of bitcoins has authorized the transfer of some of those bitcoins to an address.
Anatomy of a Transaction

A transaction is comprised of three parts:
An input: the source of the transaction of coins that were previously sent to Toby’s address.
An amount: the amount Toby agreed to send Jenny plus a small transaction fee
An output: Jenny’s public address
Here’s an interesting fact about a bitcoin wallet: it does not store any coins.
How is this possible?
The balance you see on your wallet is the net amount of bitcoins assigned to your address after your transactions.
Is it then possible to overspend in Bitcoin?
The answer is definitely no. Bitcoin has a clever way to ensure one never overspends.
Upsent Transaction Output: UTXO
Let’s examine the history of Toby’s transactions (without any transaction fees):

Unspent Transaction Output (UTXO) is an output from a transaction that quite literally shows the upsent amount after a transaction. UTXO is like the change you receive after a transaction.
Alice to Toby:

When Toby receives BTC 1.0 from Alice, Toby’s first UTXO, let’s call it UTXO #1, is created with BTC 1.0 for Toby.
Bob to Toby:

Similarly, when Toby receives BTC 1.5 from Bob, Toby’s second UTXO, let’s call it UTXO #2, is created with BTC 1.5 for Toby.
One key characteristic of UTXO is that it cannot be broken down into fractions and has to be used as a whole. It behaves like a physical coin in that sense.
Toby to Calvin:

When Toby sends BTC 0.5 to Calvin, Toby’s wallet will automatically select the smallest possible UTXO to complete the transaction. In the transaction above, UTXO #1 used as an input of the transaction and generated UTXO #3 with BTC 0.5 for Toby.
Toby to Daisy:

When Toby sends BTC 0.6 to Daisy, Toby’s wallet will select UTXO#2 as the input and will generate UTXO #4 with BTC 0.9 for Toby.
Toby to Elsa:

When Toby sends BTC 1.0 to Elsa, Toby’s wallet will combine UTXO #3 and #4 to create sufficient balance to complete the transfer and will generate UTXO #5 with BTC 0.4 for Toby.
The bitcoin balance that you see on your wallet is simply the sum of all unused UTXOs linked to your address.
Bitcoins do not exist per se. It resides as a concept within the transaction records.
Digital Signature
In order to avoid fraudulent transactions, each transaction has to be authorized by the sender using a digital signature.

Toby’s digital signature is generated by applying SHA256 to the message and Toby’s private key.

To strengthen security, each transaction will include a unique transaction ID.

This will prevent the same set of the message and the digital signature from being used more than once.
When a node in Bitcoin’s peer-to-peer network receives the transaction from Toby’s wallet, it will verify the signature using Toby’s public key. The result will show if the signature is either True or False.

Knowing that a) a public key is generated from a private key and b) how big of a number 2^256 is, you can be extremely confident that the signature was generate using the sender’s private key when it is verified as True.
Think of the verification process as validating hyperdimensional sudoku:

It’s extremely difficult, or impossible in the case of SHA256, to complete but it’s very easy to verify.
Bitcoin’s Peer-to-Peer Network
The Bitcoin Network is currently comprised of more than 10,000 full nodes. A full node validates transactions and maintains the ledger of the entire transaction history of Bitcoin.

Each node is independent of each other, and there is no central node. This architecture makes every node equally important.
When a transaction is originated from a wallet, it is transmitted to the nearest node.

A node will then verify the transaction and will only propagate the validated transactions to other nodes to which it’s connected. This is a swift process that will allow a validated transaction to be propagated and heard by all nodes in the Bitcoin Network within 2 ~ 3 seconds.

If each node is independently receiving new transactions and broadcasting the validated ones to its peers, how does the network as a whole reach a consensus on the history of transactions?
Transaction Blocks & Miners
Miners listen to new transactions broadcasted to the network and start grouping them into a block.
The mining of the next block of transactions is designed as a competition of computational power. The network will accept the block from the miner who put the highest amount of computational power.

The competition requires miners to find a value that applying SHA256 to the new transactions and the value together will generate the hash value that starts with a predetermined number of zeros.
In the example above of finding a value that will generate a hash value starting with forty zeros, miners will have no choice but to guess 1 trillion times to find this special value. This process requires a lot of computational power and energy, which is why the special value is called Proof of Work.
The Proof of Work is easy to validate as you can run the inputs through SHA256 and determine if the output meets the requirement.
You can adjust the difficulty of the competition by adjusting how many consecutive zeros are required at the start of the hash output of the block. The level of difficulty is adjusted to allow a new block to be mined approximately every 10 minutes.
The newly mined block will be broadcasted to the network, and the miner who wins the competition is rewarded with newly minted bitcoins and entitled to the transaction fees.
Bitcoin Supply
The mining reward (excluding the transaction fees) is the only supply mechanism for new bitcoins. This reward, which started at BTC 50 per block in January of 2009, will half every 210,000 blocks or approximately 4 years.

As the reward halves every 210,00 blocks, it will eventually reach zero. The implication of this is that the supply of bitcoin is finite and limited to 21m bitcoins.
As of June 29, 2020, 18.417 million bitcoins, or 87.7% of the total theoretical supply, have been created through mining rewards.
A quick diversion: why GPU vs. CPU for mining?
A CPU has multiple powerful cores that are optimal for serial operations. In contrast, a GPU has thousands of less powerful cores that are optimal for parallel operations.

Considering that the heavy computational power required for mining is due to the high volume of simple computations as opposed to the complexity of the task, utilizing GPU's parallel computing power makes it ideal for miners.
The Blockchain
To establish an order to these blocks, the hash of the newly mined block becomes the header of the next block to be mined. This combination is used to generate the hash of the next block, which creates a chain of blocks. Hence, blockchain.

This process starts from the Genesis block, the first-ever blocked to be mined, to all the new blocks added to the blockchain. This chain creates an unbreakable dependency from one block to another.
Changing any of the information of a block, such as a historical transaction, will change the hash of the block. This will create a chain reaction of changes in the hash values of all sequential blocks. This characteristic of blockchain makes it tamper-proof.
A quick revisit to Mining:
When miners are searching for the Proof of Work, they include the previous hash as the input.

Therefore, the hash of the new block is irrevocably chained to the previous block.
What if two blocks are mined at the same time?
It is perfectly normal for two blocks to be mined. When this happens, the nodes will accept the first block they receive as part of their active blockchain but also keep the second block they receive outside their active blockchain.

As a result, nodes in the network will disagree about which of these two blocks should be at the top of the chain.
This disagreement is resolved when the next block is mined and chained to one of the two blocks to create a new longest chain of blocks. As a rule, nodes will always accept the longest known chain of blocks as their active blockchain.

Some nodes will perform a chain reorganization to remove old blocks and adopt the new longest chain in the network.
This process ensures all nodes will always end up in agreement despite temporary disagreement.
Conclusion
We started the post by posing three questions:
Can I trust the authenticity of the money?
Can I be sure the money solely belongs to me? (The "double-spend" problem)
Can I be sure the supply of the money will be stable or limited?
Bitcoin's creative use of cryptographic hash functions elegantly solves the "double-spend" problem and ensures the authenticity of all bitcoins in circulation.
Furthermore, Bitcoin's mathematical and deterministic currency issuance via distributed mining provides a stable and finite supply of bitcoins.
So, what do you say?
Do you believe Bitcoin will become the currency of the Internet?