Sent ETH? Provided liquidity for AMM? Deployed a new contract? Anything you do will leave an on-chain record on the world computer. Want to know what's in your transactions?
A Guide to Ethereum Computation at the Atomic Level
Ethereum is a world computer: a globally shared infrastructure that exists across thousands of computers in a network.
Users can interact with Ethereum through wallets (like MetaMask), which can create and send transactions to the network. Once a transaction is received, it is written into a block.
Additional benefits: Hashing data (applying hash functions)
Hash function: This is a piece of code used to convert any amount of data into a compressed, uniform value. The input data can be of any length, but the output data length is always the same.
(Benefit) Hash functions cannot be run in reverse.
An Ethereum transaction consists of three parts:
Metadata, including the amount of ETH sent/received, gas details, and signature data.
Cache, a list of accounts and private keys expected to be used by the transaction.
Data, the transaction's payload (smart contract code or API calls).
Metadata - Transaction-related Information#
The following image shows all metadata fields. We will discuss the less prominent parts next.
chainid - Proposed by EIP-155, used to protect the chain from replay attacks from ETC.
type - There are two types here: a new contract (0x0) and all other contracts (0x2). EIP-2718 proposed a wrapper function (0x2) that allows for more types that do not affect the core Ethereum specification.
nonce - The number of transactions sent from a specific address. Once a transaction is packed into a block, the wallet's nonce value increases to avoid replay attacks.
to - The address receiving the transaction (wallet or smart contract).
value - The amount of ETH to be transferred. Note - Only ETH is counted here, not other tokens.
gas - The gas units used for this transaction.
maxFeePerGas - The maximum fee the user creating the transaction is willing to pay (the amount of WEI to be paid per gas. Note: WEI is the smallest unit of ETH, with 1 ETH equivalent to 10 to the power of 18 WEI). It includes the base fee and priority fee.
maxPriorityFeePerGas - The maximum priority fee (the amount of WEI to be paid per gas) the user creating the transaction is willing to pay beyond the base fee. This fee is paid directly to miners/validators as an incentive tip for packaging.
gasPrice - The cost per gas unit that needs to be paid for this transaction.
(r, s, v) - The three values that constitute the user's signature for creating the transaction. They can be used to verify whether the user authorized this transaction before EVM execution.
For more information, you can refer to: Elliptic Curve Digital Signature Algorithm (ECDSA).
Cache
This part includes the access list, which is a list of addresses and private keys that the transaction will use. This transaction can also use resources outside of this list, but the cost will be higher.
The access list was proposed by EIP-2929, allowing clients to access/cache data during the transaction. Currently, obtaining address and private key data through the access list has a 10% discount. However, this discount will increase as Ethereum supports more light clients in the future.
Data - The payload data transmitted in the transaction.
Data can be transmitted in three ways:
ETH transfer - Blank.
Smart contract API call - Names of functions and parameters.
New smart contract - Code of the smart contract.
Input field data is recorded in binary form, but it can be translated into a human-readable form.
Input fields exist on-chain, but they are not part of the EVM state. They only provide data for contracts during the transaction and cannot be tracked by Ethereum or used on the consensus layer.
The EVM can only use the data provided in this transaction; it cannot view past transactions.
This feature is very useful for applications that want to write historical data to the Ethereum blockchain (for later manual retrieval) but do not consider direct access to the EVM.
Rollup is one of the earliest applications to fully leverage this idea.
We will talk about Rollup in due time. For now, Rollup relies on the reality that writing data to input fields is relatively cheaper than writing directly to the Ethereum EVM state.
You can now take a look! This is what an Ethereum transaction looks like.
Basic Principles of Digital Currency#
- Preventing Counterfeit Currency
To eliminate counterfeit currency, Bitcoin's solution is to retain all circulation information of all currencies (i.e., a global ledger), allowing for tracing the source of each currency back to the moment it was created; each transaction adds a record of circulation information and broadcasts it over a peer-to-peer network, ensuring that all nodes (i.e., all computers participating in maintaining the circulation channel) retain all circulation information of all currencies. This way, any node can easily detect counterfeit currency before a transaction, thus preventing the circulation of counterfeit currency.
- Preventing Double Spending
To prevent the same currency from being spent multiple times by the same person, Satoshi Nakamoto adopted a proof-of-work method. As mentioned earlier, each transaction must be broadcast to the network, and double spending means broadcasting multiple transactions for the same Bitcoin. Other network nodes will place one of the received transactions into a block A (a block contains multiple recent transaction records) for verification, which involves a time-consuming calculation. If the calculation is successful, it will be broadcast to the entire network. If another node completes the verification of the next block B based on block A, it will attach block B to block A, and so on, forming a blockchain.
Multiple transactions for the same Bitcoin will create multiple blockchains, and the final result is: the longest chain is recognized as valid, while other transactions are discarded. This ensures that one Bitcoin can only be spent once by one person.
- No Need for Third-party Supervision
Through the proof-of-work method, Bitcoin also fundamentally eliminates the possibility of illegal tampering with historical transaction records, because once historical records are tampered with, it means that a new branch of transaction records for a certain Bitcoin has emerged, and the tamperer must verify the new branch themselves; meanwhile, all other network nodes continue to verify on the old branch, continuously constructing the verification chain. Unless the tamperer possesses computational power exceeding the sum of all other network nodes, their branch growth rate will never catch up with the old branch, resulting in their tampering being declared invalid.
By retaining all transaction records on all nodes and verifying transactions through time-consuming calculations, the combination of these two elements forms a secure, reliable, decentralized payment system. Its essence is to transfer the workload of centralized supervision to a vast network in which everyone participates, with all nodes in the network bearing supervisory responsibilities. Attempting to counterfeit currency or deceive other users means opposing the entire network, making it impossible to succeed.
- Bitcoin Issuance
Bitcoin issuance originates from the currency circulation channel itself. Since every transaction of Bitcoin requires verification, to encourage nodes to fully engage in verification to maintain the normal operation of the system, Satoshi Nakamoto proposed a corresponding incentive mechanism: "Special treatment for the first transaction of each block, which generates a new electronic currency owned by the creator of that block (the first person to successfully verify the transaction)." This increases the incentive for nodes to support the network and provides a method for distributing electronic currency into circulation without a centralized authority issuing currency. "If the output value of a transaction is less than the input value, the difference is the transaction fee, which will be added to the incentive of that block." In other words, the first batch of Bitcoins can be seen as "genesis" Bitcoins, which circulate after being "created," and subsequent Bitcoins are generated through the verification of transactions involving "genesis" Bitcoins, entering the circulation channel and creating a snowball effect, thus increasing the number of Bitcoins.
However, Bitcoin cannot increase indefinitely. Due to the design of the algorithm itself, the number of Bitcoins produced every four years will be halved, so the total number of Bitcoins will eventually approach 21 million.
Because those maintaining the Bitcoin system can obtain Bitcoin rewards through complex calculations, a process similar to mining, they are referred to as "miners," and their maintenance actions are called "mining." It is worth noting that "miners" bring their own equipment (usually customized computers, also known as mining machines), participate in maintenance voluntarily, so there are many of them, and their numbers change constantly, preventing the formation of fixed "third-party supervisors." At specific time intervals, only one miner can receive rewards, making the competition for mining very fierce, thus ensuring the security and stability of the system.
- Mining
The essence of Bitcoin is a public accounting system that verifies each other, while the essence of mining is the competition for accounting rights. From the perspective of work content, "mining" involves collecting, verifying, and confirming transaction information that has occurred over a period of time and has not yet been recognized by the network, and finally packaging and encrypting it into an immutable transaction record block, thus becoming a transaction record that is recognized as completed on the Bitcoin network and is permanently preserved.
In the world of Bitcoin, approximately every 10 minutes, a data block is recorded in the public ledger, containing all transactions verified within that 10-minute period. Since all mining computers are trying to package this data block for submission, the final result is determined by who submits it. The person who successfully generates that "transaction record block" (i.e., block) can receive the transaction fees generated along with these transactions, plus an additional reward. Transaction fees are generally voluntarily provided by the party transferring funds to the miners, so they are not newly created currency; the additional reward is newly generated Bitcoins—this is what was previously referred to as "Bitcoin issuance."
The limited nature of Bitcoin is controlled by the quantity of "additional rewards." According to the design of the Bitcoin system, approximately every 10 minutes, a "transaction record block" can be produced, initially allowing for an additional reward of 50 Bitcoins for each block produced, which means that the Bitcoin network increases by 7,200 Bitcoins daily. However, this reward is halved every four years, so ultimately, there can be a maximum of 21 million Bitcoins in the entire system.
- Blockchain
The calculations miners perform to compete for accounting rights actually involve solving random numbers based on hash values. The competition is to see who can find a random number within 10 minutes, which, when combined with the hash of the previous data block and the newly verified transaction records within those 10 minutes, can yield a minimum hash value that meets certain conditions. The smaller this value, the higher the difficulty coefficient of the Bitcoin network. Since hash values are quite random and unpredictable, the only way to compete is through brute-force calculations. If a miner fails to seize accounting rights within 10 minutes, they must wait for the next round of competition.
The reason for adding the hash of a block when solving for a random number is that this way, all data blocks form a continuously verifiable data chain from front to back. Modifying any transaction record in any intermediate data block will cause the hashes of all subsequent data blocks to fail verification. If one attempts to modify a record and then find a reasonable value to recalculate a compliant hash for repackaging, it means that all subsequent data blocks need to be recalculated for their hashes. Even if they find them, they must do so faster than the entire Bitcoin network's calculations to have their results accepted by the network. This means that an attacker must possess more computational power than the rest of the Bitcoin network, in other words, they must use more than 50% of the entire network's computational power to ensure the attack is effective.
This data chain is called the blockchain, also known as the global ledger, which is permanently stored on every user's computer. Only by possessing over 50% of the total network's computational power can one tamper with this global ledger. The Bitcoin system achieves the goals of preventing currency counterfeiting, transaction tampering, and double spending through the mechanism of blockchain + "mining."
- Computational Difficulty and Confirmation Times
Once a miner finds a valid hash value, they will quickly forward the generated data block. Other miners who receive and recognize this data block will base their next round of calculations on it. If during this time a block with a smaller hash value is received, the priority will first be given to the length of the data chain, and secondly to the smaller hash value, discarding the previous result and continuing the next round of calculations based on the new foundation.
- Client Wallet Software
In the Bitcoin system, a user's account (address) is automatically generated by the local client, represented by a string of characters like 1Gz9XmfTK4aH89MVXky1QxtyMcG44NqDRv. Once the user tells others this address, they can transfer Bitcoin to that address.
A Bitcoin address is actually a public key from a pair of asymmetric keys, generated using elliptic curve algorithms. Its uniqueness lies in the fact that after encrypting a piece of information with the public key, it cannot be decrypted with the public key; it must be decrypted with the private key. Similarly, after encrypting a piece of information with the private key, it cannot be decrypted with the private key; it must be decrypted with the public key. More uniquely, while the public key can be easily calculated from the private key, it is nearly impossible to calculate the private key from the public key.
Therefore, users can share their address (public key) with others for encrypted communication. For example, user A tells B their public key, then encrypts a message with their private key. User B uses A's public key to decrypt this encrypted message and can confirm that the message was sent by A (because only A's public key can decrypt it). User B can encrypt a message with A's public key, and user A can decrypt this message with their private key, confirming that the message was sent to them (because only their private key can decrypt it). However, users must never share their private key with others, as the private key uniquely determines ownership of the address (public key), and it cannot be calculated from the public key. Once someone shares their private key, it is equivalent to giving away all the Bitcoins stored in that address, as the other party can calculate the public key (address) from the private key, then look up the Bitcoin information associated with that address in the blockchain (global ledger) and use those Bitcoins.
The user's account address and private key are stored in the Bitcoin wallet file. Generally, the private key is not visible and is automatically encrypted and decrypted by the Bitcoin client software. Therefore, the wallet file must be kept secure; once lost, all Bitcoins stored in all addresses in the wallet become insecure and may be stolen by others. Due to the decentralized and anonymous nature of the entire Bitcoin system, once Bitcoins are stolen, no one has the authority or ability to recover them.
- Bitcoin Transfers
Since Bitcoin does not have the concept of cash transactions, all transactions rely on digital transfers between accounts, so the concept of Bitcoin payment is similar to bank transfers. Suppose A has 100 Bitcoins and wants to transfer them to B. A writes a message saying "Transfer 100 Bitcoins from A's address to B's address," then encrypts it with their private key and broadcasts it to the entire Bitcoin network. People on the network use A's address (public key) to decrypt and verify that this message was indeed sent by A, and by calculating historical transaction data, they confirm that A's address indeed has 100 Bitcoins. Thus, the entire network recognizes this transfer operation, and the miner who seizes the accounting rights packages all transaction records (including A's transfer to B) within the current time frame onto the blockchain, reducing A's wallet balance by 100 Bitcoins and increasing B's wallet balance by 100 Bitcoins, showing that this transfer has been confirmed once. About an hour later, after 6 confirmations, B gains control over these 100 Bitcoins, and this transfer is completely finalized.
Asymmetric encryption technology enables this transfer process to proceed smoothly, while miners' activities ensure the legality, validity, and irreversibility of transactions.
- Anonymity and Transparency
Due to the absence of traditional bank account opening and identity verification processes, the Bitcoin system is purely anonymous, meaning it is impossible to associate a user's account address with the user themselves. The person who possesses the private key for a certain address has sole ownership of the assets in that address. Although we can query the flow information of each account based on the complete local transaction records, there is almost no way to know who the owner of that account is. Anyone can have almost unlimited addresses if they wish. Similarly, no one has the ability to manipulate the Bitcoins in another person's account. This is the first time in human history that technology has guaranteed that "currency" is untraceable, unfrozen, and cannot be possessed without permission.
Conversely, account owners can easily prove their ownership of wealth in a certain address. They only need to encrypt a message using their private key and publish it, allowing everyone to confirm their ownership of that account without needing to disclose the private key. This also applies to proving that a certain anonymous payment was indeed made by someone.
Of course, although the Bitcoin system is anonymous, if an organization is willing to disclose its Bitcoin account, the entire network can track all flow information of that account at any time. The time of each transfer, the amount, and the expenditures can be clearly seen, equivalent to directly querying the original internal bank statements. For NGOs (non-governmental organizations) or charitable organizations, this can significantly reduce accounting maintenance costs and achieve 100% transparency. During the 2013 Lushan earthquake, the One Foundation accepted Bitcoin donations, and its Bitcoin accounts were clearly traceable online.
- Irrevocability and Non-recoverability
If a transaction has been confirmed sufficiently many times, it becomes irrevocable and irreversible. This means that if a person mistakenly sends Bitcoins to another person's legitimate address, unless the other party is willing to send the Bitcoins back, that person's Bitcoins will be permanently unrecoverable. This is because there are no arbitrators in the Bitcoin world, and users cannot be forced to act, so whether erroneous transactions can be recovered depends solely on the other party's willingness.
For the same reason, if a user's wallet file (private key) is damaged, it means that all Bitcoins on all addresses contained in the wallet are completely lost, lying forever in the historical transaction records. Anyone can see them, but no one can access them. There is no way to retrieve them with an ID card. If one wishes to recover lost Bitcoins by cracking the private key, they will have to wait for quantum computers to emerge. According to current cryptographic theory, only quantum computers could potentially crack elliptic curve encryption algorithms in a short time.
Based on Cryptographic Secure Communication
The connectivity of the P2P network is nearly flawless, but trust issues cannot be resolved solely through the P2P network. For example, A sends a message to B, and B ultimately receives this message through the P2P network. This message could be directly transmitted from A's computer or passed through multiple computers. Thus, B will have two questions: First, is this message really sent by A? Second, could this message have been intercepted or tampered with?
This brings us back to the public key, private key, and asymmetric encryption technology we mentioned in the previous section. If A wants to send a message to B, ensuring that only B can decrypt this message, A encrypts the original message with B's public key (the public key is public, and the entire P2P network knows B's public key). This message propagates through the entire P2P network; although everyone has B's public key, they cannot decrypt this message with it; only B's private key can unlock it. Finally, B receives this message and decrypts it with their private key to read A's message.
So how does A prove they are the sender of this message? On the network, anyone can impersonate anyone else, and when B receives the message, the computer that relayed the message to B might claim to be A, which B cannot trust. So, how can B confirm that this message was sent by A?
It's simple: A just needs to encrypt the message in two steps: First, A encrypts the original message with A's private key (this step is called digital signing, which eliminates the possibility of the message being forged or impersonated by someone else). Second, A encrypts the result from the first step with B's public key. When B receives this encrypted message, they perform two decryption operations in reverse order: First, they decrypt the received message with B's private key to obtain the data encrypted by A's private key; second, they decrypt the data obtained in the first step with A's public key to retrieve the unencrypted message.
The purpose of the first layer of encryption is to prove that this message was encrypted and sent by A, as only A's private key can perform such encryption. The purpose of the second layer of encryption is to ensure that only B can decrypt and see the unencrypted message, as only B possesses the decryption private key. Even if others see the encrypted message, they cannot decrypt or tamper with it.
Public Transparency
The essence of Bitcoin is a public accounting system that verifies each other. What this system does is record all transactions that occur in all accounts. Every change in the amount of each account is recorded in the global ledger (blockchain). Moreover, everyone has a complete ledger, and anyone can independently calculate all accounts' records in Bitcoin's history and determine the current balance of any account.
The key point here is that everyone has a complete ledger, so no one in the system has unique decision-making power. Any attempt to hide or modify transaction data will be rejected by the entire network unless someone has the ability to modify the ledgers of over 50% of the users, which is known as a 51% attack in the Bitcoin system.
When using the Bitcoin client, a large amount of data synchronization occurs, synchronizing the global ledger. This data ensures the decentralization of the entire system and the right to know for every client. It is precisely because all data is public and transparent, and the entire Bitcoin software is open-source, allowing anyone to view its source code, that people trust this decentralized system without worrying about hidden conspiracies.
Computational Power Democracy
Miners' supervision of tampering with the global ledger and double spending issues relies on a computational power voting mechanism. Taking double spending as an example, since the same Bitcoin is paid twice, it will inevitably create inconsistent block data, leading to a blockchain fork. Which payment to acknowledge and which to reject is decided by miners' votes.
The voting rules are as follows: If double spending creates two inconsistent blocks A and B, miner A seizes the accounting rights for A and attaches A to the end of the current blockchain, while miner B seizes the accounting rights for B and similarly attaches B to the end of the current blockchain, resulting in a fork into chain A and chain B. In the next accounting cycle, miners will decide whether to attach the newly generated block to chain A or chain B. Over time, chains A and B will continue to extend until one chain's length significantly exceeds the other, at which point the shorter chain will be discarded, and the transactions contained in the longer chain will be confirmed.
Similarly, tampering with the network's ledger also means a blockchain fork, with one chain being the tampered false ledger and the other being the true ledger held by the vast majority. Since most miners cannot see the tampered false ledger, they will only attach new data blocks to the correct chain, meaning the correct blockchain will be maintained by the vast majority of miners, while the tampered blockchain will only be maintained by the tamperer themselves. The result of the competition is naturally that the tamperer's false ledger is discarded.
Any change to the rules of the Bitcoin system almost always leads to a blockchain fork, with miners expressing their attitudes toward the new and old rules by attaching new data blocks to different chains. Clearly, privately altered rules will not gain the support of the vast majority of miners, as the rules are embedded in the mining software. Miners who do not update the software (i.e., refuse to use software that privately alters the rules) cannot attach new data blocks to the blockchain under the new rules.
Members of the Digital Currency Family#
Since the emergence of Bitcoin, the digital currency family has surged, with new digital currencies being born almost every month. According to incomplete statistics, there are currently at least over 100 types of digital currencies, most of which are derived from modifications to Bitcoin's code and may have disappeared without attracting attention. Another portion has borrowed ideas from Bitcoin and made improvements to its algorithms and mechanisms. We collectively refer to digital currencies outside of Bitcoin as competitive coins, and this section will briefly introduce several common digital currencies.
- Bitcoin (BTC)
Bitcoin is the earliest and most famous digital currency, marking the beginning of the digital currency era. It currently receives the most attention and has the highest price. The main content of this book is based on Bitcoin, so we will skip further details here.
- Litecoin (LTC)
Litecoin was born on October 7, 2011, and is Bitcoin's closest follower. In its own words, if Bitcoin is the gold of the currency world, then we are silver. Compared to Bitcoin, Litecoin has the following characteristics:
Faster issuance speed. Litecoin's issuance speed is an average of 2.5 minutes per block, four times that of Bitcoin, allowing for six confirmations in 15 minutes, facilitating merchant transactions.
In terms of proof of work, it uses the scrypt algorithm instead of the SHA256 algorithm.
The use of the scrypt algorithm is the biggest difference between Litecoin and other purely Bitcoin-imitating digital currencies. The characteristic of the scrypt algorithm is that it cannot rely solely on CPU computational power during calculations; it requires a large amount of memory support. Currently, professional Bitcoin mining machines are not as advantageous in Litecoin mining as graphics cards, which is why most Litecoin miners still rely on graphics card mining.
The inventor of Litecoin believes that this setting allows mining rights to be distributed among a large number of small miners rather than gradually concentrating and monopolizing among large mining machine owners like Bitcoin. However, it should be noted that this setup is a double-edged sword; while it prevents mining from becoming a capital-intensive industry with few participants, the reliance on graphics card mining leads to a lower overall computational power, making Litecoin more susceptible to 51% attacks compared to Bitcoin.
Currently, Litecoin's total network computational power is about 100 GHash/s, with nearly 23.89 million coins issued, averaging around $32 per coin, with a market value of about $770 million.
- Ripple (XRP)
Ripple is an open payment network, and XRP is the base currency within that network. Strictly speaking, XRP cannot be considered "authentic" digital currency because it is not issued by an algorithm but is centrally issued by Ripple's operating company, OpenCoin. The total supply of XRP is 100 billion coins, and OpenCoin distributes these XRP to investors and ordinary users, controlling the price of XRP through the rate of distribution.
Since XRP does not adopt Bitcoin's mining mechanism for issuance, it has faced criticism from many Bitcoin enthusiasts. However, XRP's function is entirely different from Bitcoin; it primarily serves as a base currency for converting between different currencies. Currently, there are nearly 50,000 XRP accounts, with a monthly trading volume of about 900 million coins.
- Mastercoin (MSC) and BitShares (BTS)
The MSC protocol was first released on January 6, 2012, and its chief developer, J.R. Willett, referred to it as Bitcoin 2.0. Willett's view is that the Bitcoin protocol can be "utilized as a protocol layer, allowing the establishment of new currencies with their own rules on top of its blockchain without needing to change the underlying Bitcoin protocol." This project officially launched on July 31, 2013, starting with a month-long crowdfunding campaign during which anyone could exchange Bitcoin for MSC at a rate of 100 MSC for 1 Bitcoin, with an additional 10% reward for investors who sent Bitcoin before the end of the crowdfunding period. A total of 5,120 Bitcoins were raised, which were used to develop MSC-centered projects. Currently, there is a bounty of 300 Bitcoins for developing a decentralized trading client.
BitShares is a project created by Invictus Innovations, which conceptually resembles Ripple, both aimed at solving trading and liquidity issues. BitShares appeared later, borrowing many excellent ideas from Ripple while also developing the decentralization concept of Bitcoin. BitShares has built-in trading functionality, with each user acting as an exchange, achieving decentralization of the exchange. The currency unit built into the BitShares system is also called BitShares (BTS), issued through mining, with a total supply of about 20 million. In BitShares, not only can Bitcoin and Litecoin be traded, but also all valuable securities and physical assets, including USD, CNY, gold, etc.
Further details on MSC and BTS will be provided later, so we will not elaborate here.
- Peercoin (PPC)
PPC was released in August 2012, replacing Bitcoin's proof of work (POW) with proof of stake (POS) to maintain network security. The proposer of the PPC scheme, Sunny King, believes that while POW was a major breakthrough in technology by Satoshi Nakamoto, the essence of POW means that BTC needs to consume energy to maintain operation, leading to high costs for maintaining such a network. As Bitcoin network mining output decreases, it may eventually raise transaction fees to maintain the overall security of the network.
PPC adopts a hybrid design of POS + POW, with blocks in the system including two types: POS blocks and POW blocks. POS blocks are a special type of transaction called coinstake (corresponding to coinbase in Bitcoin). In coinstake transactions, block holders can consume their coin age to earn interest while obtaining a POS accounting (minting) right. Thus, in addition to POW minting similar to Bitcoin, POS can also be used for minting, based on the coin age consumed in coinstake transactions, with one cent minted for every year of coin age consumed, resulting in only slight inflation. POW mainly plays a role in the initial minting phase, with its importance gradually decreasing.
By minting and maintaining the network through POS, PPC does not require large energy consumption and can maintain system security, thus claiming to be an "energy-efficient and cost-effective P2P electronic cryptocurrency." This concept has gained recognition from supporters, and as of now, approximately 20.87 million PPC have been issued, with each priced around $4 and a total market value of about $9 million.
- Namecoin (NMC)
NMC was first released in April 2011 and is a distributed domain name system based on Bitcoin technology. This project was proposed by bitdns, mainly targeting the flaws of the current DNS (Domain Name System). NMC has a top-level domain .bit, allowing users to purchase second-level domains under .bit.
NMC currently has an issuance of about 7.46 million coins, with each priced around $6 and a total market value of about $45 million.
- Others
The issuance, price, and total market value of other digital currencies are shown in Table 1-1.
Some Disappeared Digital Currencies
Coiledcoin, died from a 51% attack.
Fairbrix, poor promotion.
Liquidcoin, fixed mining difficulty led to too fast generation of new chains, ultimately losing control.
MMMcoin, died from fraud.
Qubic, cause of death unknown.
SolidCoin, a unique flower in the digital currency world, attempted to position itself as a currency supported by "energy," died from high transaction fees, labeled a scam.
Tenebrix, pre-mined before release, lost miner trust.
Rucoin, non-open-source.
Two terms related to transactions:
Market Depth#
First, market depth, which is composed of all unexecuted buy or sell orders at the same price level. It refers to the ability of a trading platform to handle large transactions without significant price fluctuations. The deeper the market depth, the more stable and mature the market is. For example, if you want to sell 1,000 Bitcoins on Huobi at the current real-time price, assuming each Bitcoin is priced at 10,000 yuan. On Huobi, there are 500 buy orders at 10,000 yuan, 300 buy orders at 9,999 yuan, and 200 buy orders at 9,998 yuan. At this point, if you sell at the real-time price, after selling these 1,000 Bitcoins, the real-time price will drop by 2 yuan. In other words, your revenue is 5001 + 3009999 + 200*9998, totaling 999,300 yuan. Conversely, if you sell 1,000 Bitcoins on another trading platform with poor depth, where there are only 200 buy orders at 10,000 yuan, 200 buy orders at 9,999 yuan, and only reaching 9,900 yuan to meet your 1,000 coins' trading demand, then if you sell all 1,000 coins at the real-time price, the price will drop by 100 yuan. This illustrates the difference in market depth.
Market Liquidity#
Second, market liquidity, which refers to the ability to buy and sell Bitcoins quickly without obstruction. The better the liquidity, the shorter the waiting time for transactions when buying and selling Bitcoins, and the more active the trading platform's transactions are. For instance, if you buy 10 Bitcoins on Huobi and it takes 5 seconds, while on another platform it takes 5 minutes, during which you may have to bear the risk of price fluctuations. This highlights the difference in market liquidity.
When evaluating trading platforms, professional users will look at who has better market depth and liquidity, while ordinary users will look at which platform has larger trading volumes. However, we know that trading volume data may not be very accurate. A few API users can significantly inflate trading volume; we will explain what API users are later. Market depth and liquidity are important standards for evaluating the quality of trading platforms. Additionally, since many countries' Bitcoin trading platforms do not have traditional financial licenses, when assessing, we should also consider the platform's operating time and brand reputation, which are also very important references.
What do we mean by API users? This is similar to automated trading in traditional financial markets, sometimes referred to as quantitative trading. Traders set their trading strategies and parameters based on their strategies and start the program for automated trading. Since the program runs automatically, its intelligence and frequency are higher than manual operations. Some quantitative trading strategies are arbitrage strategies, where the strategy detects price differences and sells on the higher-priced platform while buying on the lower-priced platform. Other quantitative trading strategies are trend strategies, which are more complex and issue buy and sell signals based on trend indicators. Quantitative trading is a component of a mature trading market.
Now let's look at the development of Bitcoin trading globally. The earliest well-known trading platform was MTGox, established in July 2010 by Jed McCaleb, the "father of eDonkey," and later sold to a Frenchman, Mark Karpeles, who had moved to Japan. Mark Karpeles transformed MTGox into the world's largest Bitcoin trading platform, which once accounted for 70% of global Bitcoin trading volume, and Chinese traders jokingly referred to it as "Mt. Gox." However, this platform was hacked in February 2014, resulting in the theft of 850,000 Bitcoins. The platform subsequently closed and filed for bankruptcy, creating a great opportunity for the rise of Bitcoin trading platforms in China.
From the first half of 2014 to January 2017, China became the largest Bitcoin trading market globally. This was due to the significant efforts made by Chinese trading platforms in service innovation and product innovation, as well as their implementation of zero trading fees.
By January 2017, regulatory bodies such as China's central bank began to intervene in mainstream trading platforms to curb Bitcoin trading speculation. Chinese trading platforms eliminated leveraged trading, began charging trading fees, and upgraded their anti-money laundering systems. During this period, Japan began to regain its position as the largest trading market globally in January 2017. According to statistics from the Huobi Blockchain Research Center in March, the trading volume of Bitcoin denominated in various currencies ranked the Japanese yen first, accounting for about 43% of global trading volume (with 917,478 transactions in a week); the US dollar ranked second, and the Chinese yuan ranked third. By September 2017, the South Korean won had also surpassed the Chinese yuan to become the third-largest fiat currency trading market for Bitcoin.
For foreign trading platforms, we will first introduce a group of platforms with longer operating times. In addition to the previously mentioned MTGox, Slovenia's Bitstamp is also an early platform that experienced a security incident at the end of 2014 but has since stabilized. The US-based trading platform Circle and Coinbase have grown into more competitive exchanges through compliance. Other exchanges have differentiated themselves to attract users, such as LocalBitcoins, which focuses on over-the-counter trading. For all trading platforms, ensuring the security of Bitcoin funds is a serious and critical issue that cannot be taken lightly. Huobi has been operating for many years and is the first domestic platform to employ a full-time security team and the first to use a self-developed multi-signature wallet, accumulating extensive experience in security.
So, what do on-exchange and off-exchange trading mean? These are two relative concepts. On-exchange trading involves matching transactions on a trading platform, where buy and sell prices are public, and the platform displays current quotes in real-time. This is on-exchange trading. For example, if you want to buy 3 Bitcoins and see the current quote is $3,333, you might think it's a bit high and want to buy at $3,332, so you place a buy order at $3,332. Soon after, someone sells at that price, and you complete the transaction, receiving 3 Bitcoins in your account. Since the platform matches you, you do not know who your counterparty is, nor do you need to know who sold you these 3 Bitcoins; it could be one person or many. The trading platforms I mentioned, including Huobi, Bitstamp, Bitfinex, Coinbase, etc., all conduct on-exchange trading.
On-exchange trading involving fiat currencies has a significant characteristic: it must comply with local financial laws and regulations, requiring strict user authentication and anti-money laundering processing, imposing an obligation on the platform to ensure the legality of the source of funds.
Trading Bitcoin on-exchange is similar to buying stocks. However, there are slight differences. In China's A-share market, stock trading occurs from Monday to Friday, from 9:30 AM to 3:00 PM, with a 10% limit on price fluctuations and a "T+1" settlement system, meaning stocks bought on the same day cannot be sold until the next trading day. In contrast, Bitcoin on-exchange trading occurs 24/7 globally, with no opening or closing times and no limits on price fluctuations; all transactions are "T+0," allowing you to buy at any time and withdraw from the platform immediately after.
Off-exchange trading refers to trading that occurs outside of a unified trading market and trading venue. These markets lack centralized and unified trading systems and matching mechanisms, hence are collectively referred to as off-exchange trading markets, also known as OTC trading markets. Using the previous example, if you want to buy 3 Bitcoins, you need to find an intermediary or a miner and negotiate how much they will sell you 3 Bitcoins for. If you want to buy these 3 Bitcoins at $3,332, but the miner tells you your offer is too low, you won't be able to buy them. You will need to continue searching for another seller or negotiate until you find a satisfactory price; this is off-exchange trading or OTC trading.
As the variety of blockchain assets increases, traditional fiat currency trading for digital assets can no longer meet the global investment needs of humanity. According to monitoring by the Huobi Blockchain Research Center, over half of global Bitcoin trading now comes from coin-to-coin trading, with fiat currency to Bitcoin trading occupying an increasingly smaller share. Well-known coin-to-coin trading platforms include Poloniex and Bittrex, commonly referred to as P network and B network. Huobi's international site also supports coin-to-coin trading, operated by Huobi's overseas team.
Coin-to-coin trading is relatively more specialized than fiat currency to Bitcoin trading, so let me explain a few terms.
Trading Pair#
First, let me explain what a trading pair is: a trading pair refers to pricing one asset in terms of another asset. For example, pricing Bitcoin in terms of US dollars creates a Bitcoin to US dollar trading pair, while pricing Litecoin in terms of Bitcoin creates a Litecoin to Bitcoin trading pair. As the variety of global digital assets increases and many countries directly use digital currencies as pricing currencies, the use of coin-to-coin trading will become more prevalent.
Coin-to-Coin Trading#
Next, what is coin-to-coin trading? It involves directly exchanging one digital asset for another without involving any fiat currency as an intermediary or settlement, which is what we refer to as coin-to-coin trading. In trading, you can exchange Bitcoin for Litecoin, or you can exchange Litecoin back for Bitcoin; you can exchange Ether for Bitcoin, or you can exchange Litecoin for Ethereum. The trading targets of coin-to-coin trading are the "trading pairs" I mentioned earlier, and the price of coin-to-coin trading is the pricing price of the base currency of the trading pair.
Here are some common coin-to-coin trading pairs:
For instance, the trading pair of Litecoin to Bitcoin (LTC/BTC) means pricing Litecoin (LTC) in terms of Bitcoin (BTC). Each transaction indicates how many Bitcoins can be used to purchase Litecoin or how many Litecoins can be exchanged for a certain number of Bitcoins.
Similarly, there is the trading pair of Ethereum to Bitcoin (ETH/BTC), which means pricing Ethereum (ETH) in terms of Bitcoin (BTC). The price of this trading pair indicates how much one Ethereum is worth in Bitcoins.
Alright, today we discussed the midstream of the Bitcoin industry—trading. We learned how to evaluate trading platforms based on market depth and liquidity. We also explained the well-known global trading platforms and the differences between on-exchange and off-exchange trading. Let's revisit what these two types of trading are:
On-exchange trading refers to matched trading conducted on a trading platform, where the platform helps match transactions, prices are public, and current quotes are displayed in real-time, and you do not need to know who the counterparty is;
Off-exchange trading refers to a trading method without a unified trading market and venue, where you need to find your counterparty yourself, negotiate with them, and reach an agreement.
Additionally, we mentioned coin-to-coin trading, which now accounts for half of all Bitcoin trading. You can trade Bitcoin for Ethereum, and you can trade Ethereum for Litecoin, and so on, leading to a vast number of trading pairs.
A Bitcoin wallet can generate countless wallet addresses. Each address can store Bitcoins and can also send out Bitcoins. Each address corresponds to a private key, and each private key corresponds to a Bitcoin address. The way to spend Bitcoins using a private key involves signing the unspent Bitcoins owned by that private key, and this signing process is also the encryption process.
The private key is randomly generated, so is the private key safe? Can I find the string corresponding to a certain Bitcoin private key address by exhausting all permutations and combinations? Furthermore, could there be two identical private keys in the world? If two identical private keys exist, then those two individuals could access each other's Bitcoin address assets. Don't worry; let me explain slowly.
From a cryptographic perspective, private keys are secure. This is because a private key essentially consists of an array of 32 bytes, with 1 byte equaling 8 bits of binary, meaning each binary has only two possibilities: 0 or 1. Therefore, the total number of private keys is 2^256 possibilities, a number that exceeds the total number of atoms in the universe. The passwords we use in daily life are often easily cracked by hackers because they are usually short and can be brute-forced. However, if a hacker attempts to traverse all private keys, it would be impossible even with the energy of the entire sun. When we say Bitcoin private keys are secure from a cryptographic standpoint, we do not mean that duplicate private keys cannot occur; rather, we mean that it is impossible to find the private key behind a Bitcoin address through brute-force traversal or other means, so private keys are considered secure from a cryptographic perspective.
If you possess the private key of a certain Bitcoin address, it means you have complete ownership of all Bitcoins associated with that address. Only you have the right to decide whether to spend the Bitcoins in that address and to whom to transfer them. If the private key is lost, the Bitcoins in that address can no longer be spent. This is why we see many Bitcoin addresses with funds that have not moved for a long time; it is possible that their owners have lost their private keys.
What is a Bitcoin wallet?
So, what is a Bitcoin wallet? The private keys and addresses I mentioned need a unified tool to manage them, and this management tool is called a wallet. In previous lessons, I mentioned that a Bitcoin wallet is similar to your physical wallet, where addresses are like the bank cards in your wallet, and the private key is like your bank card password.
There are many types of Bitcoin wallets, which can generally be divided into online wallets and offline wallets. An online wallet is one that generates private keys or runs while connected to the internet, often referred to as a hot wallet. An offline wallet is one that is not connected to the internet, commonly referred to as a cold wallet. Cold wallets significantly reduce the probability of being hacked due to their lack of internet connectivity, making them relatively secure, but their operation is more complex and suited for those with technical backgrounds.
In fact, wallets can also be classified by another dimension, which I will introduce next:
Full Node Wallet
The first type is a full node wallet. A full node wallet is an early form of wallet that downloads all nodes from the Bitcoin network, from its first block to the present, maintaining all data itself and verifying the results of competitive mining, making it a completely decentralized wallet. A typical example is Bitcoin Core, the official core wallet. Don't worry about its size; it is currently about 150 GB, and you can sync all the data in a few days, as an ordinary laptop can still accommodate it. However, you need to keep it running frequently to sync data from the nodes; otherwise, you will need to sync data before using it each time.
Light Wallet
The second type of wallet is called a light wallet. This type of wallet only maintains transaction-related data relevant to you and does not sync other data, making it a type of decentralized wallet. The domestic BitPay wallet is an example of such a light wallet.
Centralized Wallet
The third type is a centralized wallet. It completely relies on the company running the wallet and its servers; the data you access may come from the company rather than from the Bitcoin network. When choosing this type of wallet, be sure to pay attention to its historical reputation, as it is a centralized wallet.
You may have also heard of another term called hardware wallet. What is a hardware wallet? Recently, in September 2017, due to market sentiment in China, the Ledger hardware wallet sold out, popularizing the concept of "hardware wallets" within the community. A hardware wallet refers to wallet software running on specially designed hardware. Because hardware wallets have manufacturing costs, they are not free like online wallets; you need to purchase this hardware device. This hardware device comes in various forms, some resembling USB drives and others resembling mobile phones. Of course, those who possess such hardware wallets feel a sense of security in personally managing their Bitcoins, which is something some people pursue.
With technological advancements, a wallet can now support multiple currencies. If you have more than two types of digital assets, you can choose a multi-currency wallet, making management more convenient. Mainstream wallets generally support Bitcoin, Ethereum, Litecoin, Bitcoin Cash, and Ethereum Classic, among others.
You might ask, as a beginner, if I download a completely decentralized wallet, I won't know how to use it, and I'm worried about malware. But I also don't trust a centralized company's web wallet, fearing they might be hacked or commit insider theft. So what should I do? With technological advancements, a technique called "multi-signature" has been widely adopted in the wallet field. What does "multi-signature" mean? We know that one private key corresponds to one Bitcoin address; you need this private key to process the Bitcoins at that address. The process of using the private key for encryption is signing. Multi-signature means that several private keys are required to sign before the Bitcoins at an address can be accessed. In other words, a transaction requires two, three, or more private key signatures to be fully executed. This greatly enhances asset security and is suitable for enterprise-level Bitcoin transfers without affecting speed.
Now, how do we store and manage our Bitcoin assets? Here are some suggestions. These suggestions are also what my friend Wenhao often tells his users.
First, choose a wallet from the official Bitcoin website or other digital asset wallet websites. The Bitcoin official website was initially maintained by Satoshi Nakamoto and has since developed through a volunteer maintenance model. Therefore, the content it recommends or introduces has its own value judgment and is not driven by commercial interests.
Second, try to download from official channels. Download wallets from official websites or from Google and Apple's official app stores. Do not download wallets from unofficial channels, and do not accept wallet installation packages sent by others via QQ or WeChat. Since this involves the security of your assets, you must be particularly cautious and not easily trust others. The installation packages sent to you may contain malware.
Third, you must back up your private key properly. Protecting your private key should be done thoroughly. Make sure to back up your private key and encrypt it. If you have the technical capability, try to keep it offline and not connected to the internet, which greatly enhances the security of the private key. If you have a significant amount of Bitcoin stored, I recommend that you back up your private key well and store it offline.
Fourth, keep an eye on technological developments. For example, if there are forks in Bitcoin or other digital assets, check whether the wallet you are using can handle these issues and whether you need to take corresponding actions. These are all things you should actively monitor.
Let's summarize today's content as usual. In this lesson, we discussed Bitcoin storage. From a cryptographic perspective, private keys are very secure. We also talked about three types of wallets suitable for the general public: full node wallets, light wallets, and centralized wallets. Finally, I provided four suggestions for storing and managing our Bitcoin assets: download wallets from the official Bitcoin website or other digital asset official websites, download from official channels, back up private keys in a timely manner, and stay updated on technological developments to fill in any gaps.