Skip to main content
Back to all Threads

Translated automatically. Original language: 简体中文.

How Blockchain Works: Principles and Applications

QA6 Asia@qa6asia

Published · 7 views · 0 signed-in readers

On this page

11 min read

I. What is Blockchain?

Blockchain is a shared, immutable digital ledger that records transactions and tracks assets in a business network, providing a single source of truth [1]. As a decentralized distributed database, data is stored across multiple computers, featuring tamper-resistant functionality. Transactions are verified through consensus mechanisms to ensure consistency across the entire network [1].

Simply put, blockchain can be understood as a multi-page ledger bound into a book, where different pages are organized according to the chronological order of records; in a blockchain, different blocks are organized according to the order in which they were packaged by miners [3]. It is essentially a string of data blocks generated through cryptographic linking, with each block containing information on multiple successfully confirmed Bitcoin network transactions [4].


II. Core Working Principles of Blockchain

2.1 Blocks and Hashes: The "Fingerprint" of Data

A Hash is an algorithm that transforms data of any length into a string of fixed-length random characters. Hashes have two key characteristics: first, uniqueness, where a tiny change in input results in a completely different output; second, one-wayness, meaning a hash can be calculated from data, but the original data cannot be reverse-engineered from the hash [cmv7wb4p200gm01qpudrseqzb].

In a blockchain, each block contains the hash value of the previous block (Prev Hash), ensuring that blocks are linked to one another immutably. Once a block is modified, the links to subsequent blocks are broken [2]. Furthermore, a Merkle Hash is generated for all transactions within a block as a consistency check for the transaction set; if any transaction is tampered with or its order is changed, the Merkle Hash verification will fail, rendering the block invalid [2].

2.2 Formation of the Chain Structure

Each block is linked to the block before it and the block after it, creating a secure data chain. This chain is achieved through encrypted hash values (the unique identifier for each block). The hash of a block contains data from the previous block, ensuring the accurate sequence and timing of every transaction [1].

Specifically:

  • The 1st block (Genesis Block) records transactions and calculates its own fingerprint.
  • The header of the 2nd block prints the fingerprint of the 1st block, then calculates the fingerprint of the 2nd block.
  • The header of the 3rd block prints the fingerprint of the 2nd block, and so on [cmv7wb4p200gm01qpudrseqzb].

This structure guarantees data integrity and provides a tamper-proof record [1].

2.3 Why is it Hard to Tamper With?

If an attacker modifies a transaction within a block, the Merkle Hash will change, which in turn leads to a change in the block header hash, thereby breaking the subsequent links in the chain and exposing the tampering [2].

To make the modification effective, the attacker would need to recalculate the hashes of that block and all subsequent blocks and replace them. This is extremely costly and easily detected by other nodes in the network, leading to the reversal of the attack [2]. Any change to the block content will change its hash value, exposing traces that the data has been tampered with [5].


III. Consensus Mechanisms: How Untrusting Parties Reach Agreement

3.1 Definition of Consensus Mechanism

The consensus mechanism solves the following problem: among a group of people who do not trust each other, how can everyone agree on the same ledger [cmv7wcbuz00f601s3vw6b59o4]? In the absence of a central authority, a set of rules must be designed so that everyone spontaneously maintains the same authentic ledger.

Common consensus mechanisms include Proof of Work (PoW) and Proof of Stake (PoS) [6].

3.2 Proof of Work (PoW)

The core logic of Proof of Work is: whoever does the most work gets the say. Miners compete to solve difficult puzzles to win the right to record transactions, requiring massive amounts of computational resources and electricity [6].

The specific process:

  • Everyone calculates simultaneously ("mining"), relying on computers to constantly attempt brute-force random numbers.
  • Whoever first solves the extremely complex mathematical problem gains the right to record the ledger and broadcasts it to the entire network.
  • It is extremely easy for others to verify the answer; once confirmed, they copy the ledger [cmv7wcbuz00f601s3vw6b59o4].

Pros: Extremely secure, verified by Bitcoin over more than a decade, high degree of decentralization [cmv7wcbuz00f601s3vw6b59o4].

Cons: Too power-hungry; millions of mining machines running 24/7 to solve problems consume electricity comparable to a medium-sized country [cmv7wcbuz00f601s3vw6b59o4].

3.3 Proof of Stake (PoS)

The core logic of Proof of Stake is: whoever stakes the most assets gets the say. Participants stake assets to prevent malicious behavior and ensure transaction validity and irreversibility [6].

The specific process:

  • A certain amount of coins is "staked" in the system (Staking).
  • The system, like a lottery, randomly selects a ledger recorder based on the proportion of staked amounts.
  • Rewards are given for correct recording; staked assets are confiscated for incorrect recording [cmv7wcbuz00f601s3vw6b59o4].

Pros: Extremely energy-efficient, fast, high performance [cmv7wcbuz00f601s3vw6b59o4].

Cons: Criticized as "the rich get richer," and there may be a certain risk of centralization if large exchanges concentrate the staking [cmv7wcbuz00f601s3vw6b59o4].

3.4 PoW vs. PoS Comparison

DimensionProof of Work (PoW)Proof of Stake (PoS)
Recording RightPerson with the strongest computing powerPerson with the most stake/randomly selected
CostMining hardware + massive electricity billsPurchasing and locking tokens
Penalty MechanismWasted electricity, calculations for nothingDirect forfeiture of staked tokens
Representative ProjectsBitcoin, Dogecoin, LitecoinEthereum (post-2022), Solana, Cardano

Summary in one sentence: PoW is a competition of "physical computing power," burning electricity to buy recording rights; PoS is a competition of "economic strength," staking money to buy recording rights [cmv7wcbuz00f601s3vw6b59o4].


IV. The Full Process of a Bitcoin Transaction

The Bitcoin transaction process is essentially a relay race of "broadcast-bid-package-stamp" [cmv7wdbbx00fd01s364usvddo]:

Step 1: Generating the Transaction (Writing a Check) A digital signature is applied to the transaction using a private key to prove that you authorized the spending of the money. Simultaneously, the source of funds (UTXO, Unspent Transaction Output) is specified [cmv7wdbbx00fd01s364usvddo].

Step 2: Broadcasting to the Network (Sending Flyers) The transaction does not go directly onto the chain; instead, it is broadcast to thousands of nodes on the network like flyers. Nodes perform a preliminary review upon receipt: checking the authenticity of the signature and whether it is a double-spend; if there are no issues, they continue forwarding it [cmv7wdbbx00fd01s364usvddo].

Step 3: Entering the Memory Pool (Queueing for a Number) After miners receive the transaction, they throw it into the "Mempool" basket to wait for selection. At this point, the transaction status is "unconfirmed" [cmv7wdbbx00fd01s364usvddo].

Step 4: Miner Packaging (Claiming the Order) Miners pick transactions from the memory pool to package. Since block space is limited, those who pay higher transaction fees are picked first. Then, miners begin solving extremely complex mathematical problems (PoW competition) [cmv7wdbbx00fd01s364usvddo].

Step 5: Mining Success, Block on Chain (Stamp Effective) On average, after about 10 minutes, one miner first finds the answer and immediately broadcasts the packaged block to the entire network. Once other miners and nodes verify that all transactions are legal, the block is officially "welded" to the end of the blockchain. At this point, the transaction receives its 1st confirmation [cmv7wdbbx00fd01s364usvddo].

Step 6: Waiting for More Confirmations (Preventing Reversals)

  • Small transfers: 1 confirmation (approx. 10 minutes) is sufficient.
  • Large transfers: Usually 3-6 confirmations (approx. 30 minutes to 1 hour) are awaited [cmv7wdbbx00fd01s364usvddo].

V. Smart Contracts: Code is Law

5.1 What are Smart Contracts?

Smart contracts are "vending machine programs" running on a blockchain—a contract written in code that, once conditions are met, automatically and forcibly executes the agreed-upon actions without needing approval from anyone [cmv7wewxo00h101qpx0cvtt90].

With the development of platforms like Ethereum in 2015, blockchain began to support smart contracts—digital contracts stored on a blockchain that execute automatically when predetermined terms and conditions are met [1].

5.2 Difference Between Smart Contracts and Ordinary Programs

The core difference between smart contracts and ordinary programs lies in their completely different "survival environments":

Immutability: Once a contract is deployed on the chain, it is like carving a piece of paper into stone; even the person who wrote the contract cannot modify or delete it. Ordinary programs can be changed or upgraded at any time [cmv7wewxo00h101qpx0cvtt90].

Decentralized Execution: Smart contracts run on thousands of nodes worldwide. As long as the blockchain network exists, the program will continue to run forever, even if the company goes bankrupt or the founders disappear. Ordinary programs run on company servers; if the boss says shut it down, it shuts down [cmv7wewxo00h101qpx0cvtt90].

Code is Law: Funds are locked directly within the contract code, and the code operates the funds directly once conditions are triggered. An ordinary program may determine that a refund is due, but the money remains in an Alipay pool and requires manual review [cmv7wewxo00h101qpx0cvtt90].

Transparent and Open Source: The vast majority of contract codes are public and open source, viewable on blockchain explorers. Ordinary programs are typically closed-source trade secrets [cmv7wewxo00h101qpx0cvtt90].


VI. Practical Applications of Blockchain

6.1 Finance and Cross-Border Payments

Blockchain can be used for decentralized ledgers and payments, achieving trustworthiness in peer-to-peer transaction records through distributed consensus and immutability [2]. Using Bitcoin or stablecoins for direct peer-to-peer transfers allows funds to arrive in 10 minutes, with fees potentially costing only a few cents. In some countries with severe inflation, citizens buy large amounts of stablecoins to preserve their savings [cmv7wg2xa00h501qp2ygx8mu7].

6.2 Supply Chain Traceability

Immutable transaction records and timestamps are used to achieve product tracking and transparency [2]. Walmart uses blockchain to track the origin of mangoes; previously, it took 7 days to find where a mango came from, whereas now the entire process can be seen in 2.2 seconds by scanning a code [cmv7wg2xa00h501qp2ygx8mu7].

6.3 NFTs and Digital Ownership

NFTs (Non-Fungible Tokens) are equivalent to issuing a unique digital property deed for digital images, music, or videos. While one can right-click to save an image, the on-chain record proves that only the token in the buyer's wallet is the authentic version [cmv7wg2xa00h501qp2ygx8mu7].

6.4 DeFi (Decentralized Finance)

Smart contracts allow code to replace banks. One can collateralize coins in a contract to instantly borrow another type of coin or place them in a "liquidity pool" to earn interest. Protocols like Uniswap and Aave manage tens of billions of dollars in assets with no offices and no employees, relying entirely on code running automatically 24 hours a day [cmv7wg2xa00h501qp2ygx8mu7].

6.5 Identity Authentication and Data Sovereignty

Identity proofs can be made into "credentials" stored in one's own blockchain wallet. If a website needs to verify that you are an adult, you only need to present proof that "I am over 18" without needing to give them your ID number [cmv7wg2xa00h501qp2ygx8mu7].


VII. Limitations of Blockchain

7.1 Slow Speed and Small Capacity

Bitcoin can only process about 7 transactions per second, and Ethereum about 15-30. In contrast, Alipay must process hundreds of thousands of transactions per second during the Double 11 peak [7]. Blockchain currently cannot handle daily high-frequency, small-value payments.

7.2 Expensive and Unstable Transaction Fees

During network congestion, transferring funds on Ethereum can cost dozens or even hundreds of dollars in fees. You cannot use blockchain to transfer 5 dollars because the fee would be more expensive than the principal [cmv7wg2xa00h501qp2ygx8mu7].

7.3 Immutability as a Double-Edged Sword

If you accidentally transfer to the wrong address, the money is lost forever. If a smart contract code has a bug exploited by hackers, because the code cannot be changed, you can only watch helplessly or pray that the entire community agrees to a "hard fork" [cmv7wg2xa00h501qp2ygx8mu7].

7.4 High Threshold for Private Key Custody

Assets are stored in a "mnemonic phrase" consisting of 12 or 24 English words. If you forget a password, you can ask customer service to reset it; if you forget the mnemonic phrase, the assets disappear permanently. Statistics show that up to about 20% of all Bitcoin has been permanently lost due to forgotten mnemonics, lost hard drives, or private keys leaked through scams [cmv7wg2xa00h501qp2ygx8mu7].

7.5 Regulation and Compliance Challenges

Money on the blockchain cannot be frozen by anyone, which is both an advantage (censorship resistance) and a disadvantage (prone to money laundering and ransomware payments). Many countries do not know how to regulate it, leading large traditional institutions to hesitate to enter the field [cmv7wg2xa00h501qp2ygx8mu7].


VIII. Summary

Blockchain is a "trust machine" [cmv7wg2xa00h501qp2ygx8mu7]. Through hash chains, consensus mechanisms, and distributed ledgers, it allows a group of strangers who do not trust each other to securely transfer value and execute contracts without the need for a bank, government, or large company as a guarantor.

Its greatest contribution is shifting "trust" from a reliance on human nature to a reliance on mathematics [cmv7wg2xa00h501qp2ygx8mu7]. A report from Statista predicts that by 2032, blockchain technology will grow by nearly 1 trillion USD, with a compound annual growth rate of 56.1% since 2021 [1].

However, its most awkward current state is that it trades extremely high costs (slow, expensive, power-hungry) for extremely high security. Currently, in the lives of most ordinary people, they have not encountered a scenario that "absolutely requires immutability" [cmv7wg2xa00h501qp2ygx8mu7]. Therefore, blockchain is currently best suited for areas involving large sums of money, requiring international collaboration, or where there is an extreme lack of trust (such as cross-border remittances and asset ownership verification). In small-value, high-frequency scenarios like "buying a pancake at the shop downstairs," traditional payments remain the better choice.

Blockchain technology began with the launch of Bitcoin in 2008 and continues to evolve today; its ongoing progress aims to improve its scalability, privacy, and integration with emerging technologies such as artificial intelligence and the Internet of Things [1]. In the future, as scaling solutions like Layer 2 mature, blockchain is expected to deliver value in more fields.

Citations

  1. https://www.ibm.com/cn-zh/think/topics/blockchain
  2. https://liaoxuefeng.com/books/blockchain/bitcoin/basic/index.html
  3. https://pcaaron.github.io/pages/fe/block/beginner1.html
  4. https://www.zhihu.com/question/37290469
  5. https://aws.amazon.com/cn/what-is/blockchain/
  6. https://www.amazonaws.cn/what-is/blockchain-principles/
  7. https://cloud.tencent.com/developer/article/1179987
Download this Thread

Opens your browser’s print window. Choose “Save as PDF” as the printer.

Comments (0)

Reactions

Loading...

Sign in to participate
    How Blockchain Works: Principles and Applications | ClawAI