search
Homeweb3.0What is block height?

What is block height?

Mar 06, 2024 pm 01:31 PM
BlockchainPopular scienceBitcoinblockchain

In many articles about blockchain, we often see that the blockchain forks at a certain block height.

So what exactly is a block height, and why does a fork occur at a certain block height? Today Dabai will talk to you about block height.

01. Blockchain and ledger

What is block height?

The block height is as the name suggests. The height of a block, to be precise, is the number of blocks attached to the blockchain. Therefore, if we want to understand what block height is, we must first understand what blockchain is. If the blockchain is a ledger, then a block is like each page of the ledger.

Every account is clearly recorded in the pages of the accounting book. And in order to prevent transactions from being tampered with and ensure openness and transparency, the blockchain accounting method is that everyone keeps accounts together.

02. Block height and accounting book page number

Since the blockchain is a small accounting book, then each page (block) can record the number of accounts It is limited, so in order to distinguish and find which block a transaction is recorded in, we can easily think of marking the page number in this book. Therefore, if the blockchain is a small accounting book, the block height is like the page number of this accounting book.

Here comes the simple thinking question. In the case of a blockchain with only one longest chain, assuming that the page number of this page of the current ledger is 3, then this block is this block How many blocks in the chain is it? Answer: Block 4.

Some friends may wonder why it is not the third block? The reason is that the blockchain also has a block with a block height of 0, which is the genesis block. Its page number is 0, so when it reaches the block with page number 3, it means that there are 3 blocks in front of it, which is also called the number of ancestors of the block. And it itself is the 4th block of this chain.

03. Block generation and ledger page number generation

Understanding what a block is After the height, Dabai will continue to talk to everyone about how the block height is formed. In the blockchain with the mining mechanism, the page numbers of the small bookkeeping booklet of the blockchain are obtained by miners through competition. For example, the current block height is 3. When a lucky miner solves the calculation problem, he will get the accounting rights of the page of the ledger with page number 4 (that is, the block with a block height of 4), and will receive a certain amount of rewards. At this time, this block will record the transactions that have been packaged and confirmed by the miner. When this block has been formed, miners will continue to compete on the block with block height 4 to get the block with block height 5.

04. Duplication of bifurcation and ledger page numbers

What is block height?Dabai mentioned earlier , miners obtain the accounting rights of the next block by solving calculation problems. Then the question arises. If the current block height is 2, when two lucky miners solve the calculation problems at the same time, they will both obtain the block height. The accounting right of the block is 3.

This is equivalent to saying that miner Xiaobai is holding a page with page number 3, and miner Xiaohei is also holding a page with page number 3, although the page numbers of Xiaobai and Xiaohei's paper are The same, but the contents recorded on the two accounting papers are not exactly the same.

But according to the rules, there is no problem with the two pages of Xiaobai and Xiaohei, so which accounting paper should I choose? At this time, some miners will choose Xiaobai's page to be stapled at the back of the accounting book and continue to "seek" the page of accounting paper with page number 4, while some miners will choose Xiaohei's page to be stapled to the back of the accounting book. Continue to "search" for the accounting paper with page number 4 in the accounting book.

This is equivalent to dividing the page with page number 2 into two accounting books. In blockchain, this behavior is called forking. But there is a "longest chain principle" in the blockchain. Miners will choose the longest chain as the main chain to continue mining. For example, after Xiaobai's chain, Xiaohong first mines a block with a block height of 4, then Xiaohei's chain will be abandoned, and miners will choose to continue mining on Xiaobai's chaindig.

Dabai mentioned earlier that block height is used to identify which block a certain transaction belongs to. But now there are two blocks with the same height, so how to identify them?

In fact, in the blockchain, the block hash is used to uniquely identify a block, not the block height. Because even if the height of the block is the same, the content recorded in the block is not exactly the same. Therefore, the hash of the block (obtained from the content of the block) must not be the same, so the hash of the block can be used to Uniquely identifies a block.

In summary, the blockchain is like a ledger, and the blocks are like pages of accounting paper in the ledger. The height of the block is the page number of the accounting paper. A fork occurs when two identical page numbers appear at the same time.

Do you know what block height is and how to identify two blocks with the same height? Welcome to share your views in the message area.

The above is the detailed content of What is block height?. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:知乎. If there is any infringement, please contact admin@php.cn delete
The Pi Network token price has increased by more than 14% over the past week.The Pi Network token price has increased by more than 14% over the past week.Apr 16, 2025 am 11:22 AM

As of press time, Pi is trading at $0.6711 after its integration with Chainlink on April 12th. The announcement caused a surge in the price of Pi

More Reasons to Be Bullish on SUI as Price Enters Prime Buying ZoneMore Reasons to Be Bullish on SUI as Price Enters Prime Buying ZoneApr 16, 2025 am 11:20 AM

An analyst on X, Frigg, highlights multiple reasons to be optimistic about SUI Network price trajectory.

Bitcoin (BTC) Sentiment Is Turning Bullish as Over $467 Million of the Cryptocurrency Was Withdrawn From Exchanges YesterdayBitcoin (BTC) Sentiment Is Turning Bullish as Over $467 Million of the Cryptocurrency Was Withdrawn From Exchanges YesterdayApr 16, 2025 am 11:18 AM

Following today's data released by IntoTheBlock, sentiment around Bitcoin appears heightening towards bullishness.

Movement Labs and the Movement Network Foundation have launched an independent investigation into recent market-making irregularities related to the MOVE token.Movement Labs and the Movement Network Foundation have launched an independent investigation into recent market-making irregularities related to the MOVE token.Apr 16, 2025 am 11:16 AM

nt Labs and the Movement Network Foundation Launch Independent Investigation into MOVE Token Market-Making Irregularities

A wave of capital is flowing out of Ethereum [ETH] and into Tron [TRX]A wave of capital is flowing out of Ethereum [ETH] and into Tron [TRX]Apr 16, 2025 am 11:14 AM

With $1.52 billion in stablecoins migrating to Tron, investors appear to be favoring lower-cost chains and diversifying beyond traditional USD-backed assets.

Mantra CEO John Patrick Mullin Burns His Allocation of OM Tokens to Restore Investor ConfidenceMantra CEO John Patrick Mullin Burns His Allocation of OM Tokens to Restore Investor ConfidenceApr 16, 2025 am 11:12 AM

Mantra CEO John Patrick Mullin has proposed burning his allocation of OM tokens in a move aimed at restoring investor confidence after the protocol's native token suffered a sharp collapse.

Recent market movements and technical analysis suggest that BONK may be on the brink of a significant price surge, outpacing Solana's broader ecosystem.Recent market movements and technical analysis suggest that BONK may be on the brink of a significant price surge, outpacing Solana's broader ecosystem.Apr 16, 2025 am 11:10 AM

Technical Setup for Bonk Price Recovery According to prominent crypto analyst Altcoin Sherpa, Bonk is showing signs of a potential rebound.

Securitize Acquires MG Stover's Fund Administration Business to Become the Largest Digital Asset Fund AdministratorSecuritize Acquires MG Stover's Fund Administration Business to Become the Largest Digital Asset Fund AdministratorApr 16, 2025 am 11:08 AM

Securitize, one of the largest tokenized asset issuers, said on Tuesday it has acquired MG Stover's fund administration business

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools