Questions tagged [best-chain]

Discusses the rules by which one chain-tip gets chosen over another, including questions about heaviest/longest chains. Closely related to [chainwork], [chain-reorganization] and [blockchain-fork].

Filter by
Sorted by
Tagged with
3 votes
2 answers
96 views

Why is not good having forks in a blockchain?

To be more specific, if I imagine to work with isolated transactions chained to each other according to money flow, then I understand that we wish to have a single chain because forks would mean the ...
loremas89's user avatar
0 votes
3 answers
69 views

What is the use of longest chain consensus rule?

I want to know Couldnt a chain be hardcoded in the bitcoin rules itself? Only so and so chain can be used. During the early days of bitcoin, I know a small group of enthusiasts were miners. And they ...
Guinea guinea's user avatar
1 vote
2 answers
289 views

How do transaction verification and adding a block to the blockchain fit together?

I have the below questions: How is a transaction added to a block? Do miners get a reward for adding a transaction to a block? How is that block then added to the blockchain? If everyone (miners) are ...
Tanzeel Malik's user avatar
4 votes
1 answer
902 views

Does local blockchain database (blkXXXXX.dat) contain abandoned forks forever?

When my node realizes that the given block needs to be abandoned - does it leave it in the database or replace the block with a valid one? And if "invalid" block remains: is it somehow ...
ardabro's user avatar
  • 195
1 vote
2 answers
293 views

Why does the longest chain rule make the most sense to deter double spending?

If there is double spending occuring, I don't understand why the longest chain rule would decrease the likelihood for only one transaction to be confirmed. Can someone explain step by step why this ...
HeyDoeFarm's user avatar
4 votes
3 answers
274 views

Can you get the longest chain by keeping a constant low difficulty?

I'm struggling with this question that should be easy to answer. If the truth is the longest chain, what if I redo all the work from Block 1 until I have the longest chain by keeping a constant low ...
SadPepo's user avatar
  • 71
2 votes
1 answer
241 views

If the longest chain is considered the valid blockchain by nodes, what happens if a future supercomputer alters the entire blockchain?

Let's say that the computational power from the genesis block to the current block becomes a trivial computation in the future by some supercomputer using a new technology exclusive to it. Perhaps ...
user4779's user avatar
  • 123
0 votes
1 answer
55 views

How many blocks extra does one need before it's competitor is deemed stale?

so when two equally valid blocks are discovered at roughly the same time, a conflict occurs, nodes should wait for the strongest fork of the chain to emerge and develop before placing trust in the ...
nohatsatthetable's user avatar
2 votes
1 answer
128 views

Does a hard fork need to include a soft fork as well?

Using these definitions of soft fork and hard fork: soft fork – tightening of the consensus rules, new blocks remain valid for old nodes hard fork – loosening of the consensus rules, new blocks might ...
Vojtěch Strnad's user avatar
0 votes
1 answer
85 views

Potential fork from genesis block using enormous computational power

51% attacks are commonly discussed where one entity could potentially mine blocks ahead of the network. The assumption is that the attacker manages to acquire 51% of computational power. However, ...
John Smith's user avatar
7 votes
2 answers
687 views

How does the BTC protocol guarantee that a "main" blockchain emerges?

I'm reading up on the bitcoin/blockchain technology. Usually, the part about proof of work and how to create a block is well explained. However, what is never explained is how/why the communication of ...
lezebulon's user avatar
  • 173
1 vote
2 answers
355 views

Why can't a 51% attack change past blocks on the blockchain?

I have read that it is not possible to reverse transactions already added to the blockchain but I do not understand why that is not possible in a 51% attack. If an attacker was to change the ...
user10764803's user avatar
1 vote
3 answers
139 views

How does a Bitcoin block get generated and 'agreed upon' by everyone?

When a set of new transactions is broadcast to all the Bitcoin mining pools, my understanding is that they all start working on a new block to include all those transactions. But how is it agreed ...
Jez's user avatar
  • 951
1 vote
1 answer
45 views

How does initial exchange of inventory work when both nodes have different chains?

When two nodes connect to each other and exchange getblocks messages but they have different blockchains will both nodes download each others blockchain to verify which has higher chainwork or will ...
lixkel's user avatar
  • 11
1 vote
1 answer
127 views

Is block reorg works in this way?

i need an expert to clarify is my understanding correct to block reorganization. I can't find answer can persuade me, sound like only i dunno what is block reorganization :(. say my bitcoin network ...
Atlas Chiew's user avatar
1 vote
1 answer
96 views

How does longest chain propagation take place in bitcoin?

Let's say the valid blockchain that Node A has is: B1->B2->B3 Now, I am gonna cheat since I have lots of computing power. What I do is I download the above blockchain that Node A has and start ...
Nika Kurashvili's user avatar
3 votes
2 answers
386 views

Bitcoin: Why can the difficulty parameter not be ignored?

by the longest-chain-rule, the chain with the most blocks is considered to be the main chain in Bitcoin. I understand that an adversary needs to have more than 50% of the network's computing power in ...
Max Beikirch's user avatar
6 votes
1 answer
352 views

How does Bitcoin Core know it's on the longest chain?

In trying to implement a client, I am wondering what is the most efficient approach to figure out if you are on a fork. Let's say you pick a peer at random and go through IBD using the headers-first ...
cloudhead's user avatar
  • 189
2 votes
1 answer
156 views

Should a node follow the longest chain, or the chain with most work while syncing?

I'm reading mixed things online - some saying to follow the longest chain, and some say to follow the chain with the most work. But I'm not convinced of the former. If the node follows the longest ...
Michael Fletcher's user avatar
4 votes
1 answer
547 views

How often does temporary fork occur and how long does it last?

I was wondering, how often does temporary forks occur? They appear when there are two different blocks mined based on the same previous block (parent block), but what are chances for that? And if fork ...
ddavi031's user avatar
  • 459
2 votes
2 answers
126 views

Can I rely on my full node to always have the most recent blocks?

I have a full node running and I am using ZMQ to let me know when new blocks arrive. How can I make sure that this block that my node received is a valid block written in the blockchain ledger and it ...
Allan Romanato's user avatar
0 votes
1 answer
531 views

Fork and Longest Chain Rule

At the same time, A and B succeed in resolving the "Proof of work" challenge and both add a new block to their local blockchain, then they propagate the new blockchains to other nodes. I have 2 ...
AleWolf's user avatar
  • 133
3 votes
1 answer
366 views

Why Block Chain not Block Tree?

Why is the Blockchain intended to be a chain and not a tree? Why do orphaned blocks get trimmed off? Would you please provide a detailed answer.
محمد جعفر نعمة's user avatar
2 votes
1 answer
148 views

How Does Bitcoin Core Client Keep Track of Longest Chain/Strongest PoW Chains?

Bitcoin Core stores blocks in files in local disk. And it uses LevelDb to form an index on top of block storage to make it faster to retrieve a block (basically a simple key-value pair db). See this ...
user3299116's user avatar
1 vote
1 answer
739 views

"Fork choice rule" : A general term? or a specific algorithm?

Is "Fork choice rule" a general term including all the algorithms used for choosing a branch among other branches in a fork (including longest chain rule in Bitcoin etc) ? Or is it a specific ...
Questioner's user avatar
  • 1,151
4 votes
1 answer
105 views

Why isn't the block hash used to calculate accumulated work?

Why is this idea flawed? It doesn't seem to be a bad idea at first, because the miners should be incentivized to extend existing chain, instead of to "remine existing blocks", since such "remining" ...
Chris Chen's user avatar
2 votes
2 answers
333 views

How can Segwit increase transaction throughput if the same amount of data is stored in the blockchain?

I'm posting this after reading the answers to this: Where is the Signature stored in a SegWit transaction? I've found out from reading that, that in Segwit, the "witnesses" (or signatures) that ...
wlad's user avatar
  • 177
4 votes
1 answer
381 views

When does a blockchain fork resolution happen?

I understand that forks are resolved by largest proof-of-work etc. but when do the miners decide to resolve a fork? Is it a question of network consensus or does each individual miner resolve at their ...
Larrrrrrrrrry's user avatar
6 votes
2 answers
367 views

Why aren't block hashes used directly as scores for difficulty purposes?

Why does Bitcoin apply a difficulty function to block hashes and then use the output of this function to add up and determine the "longest" chain? Why not just e.g. add together all block hashes (as ...
Adam Ierymenko's user avatar
1 vote
1 answer
89 views

Given that you have the necessary computing power, how does a tampered blockchain get accepted by the network?

I read that you can only tamper with a blockchain if you have more than 50% of the computing power in the network. So say you have 51% of the computing power, then you can create a longer blockchain ...
Surzilla's user avatar
  • 113
0 votes
1 answer
67 views

Several Q's about consensus about the longest chain and when this chain be confirmed? [duplicate]

According to: How Does the Blockchain Work? Each node will adopt the longest chain as the only option. But what will happen if 2 (or more) nodes will solve the next block at the same time,and they ...
user3668129's user avatar
0 votes
1 answer
224 views

Does the Longest Chain Always Win the Mining Award?

If the longest chain (i.e, the one that's the most difficult to produce or the most transactions) is always awarded with 12.5 coins (or whatever the current prize is), what happens if a specific node ...
David Lynch's user avatar
2 votes
1 answer
95 views

Shorter Chains in blockdata

Assuming two blocks are published at exactly the same time, a race for the next block to be added to one of them begins, which eventually one chain will eventually win. My question: will the shorter ...
Jimmy Johnson's user avatar
2 votes
1 answer
112 views

Why can't a Bitcoin fork take over?

According to this question's answers, the difficulty is entirely a result of previous info on a blockchain: How is difficulty calculated? So why can't someone simply fork an earlier state of Bitcoin'...
Gregory Magarshak's user avatar
0 votes
1 answer
330 views

Why is the longest block the one that gets accepted by all the nodes?

I'm confused about one of the core principles of Bitcoin. When various nodes are confirming transactions, why does the longest block win out? That is, why doesn't the system allow whoever confirms a ...
Dave's user avatar
  • 405
2 votes
1 answer
138 views

Can a two-block-sized chain override the main chain?

After i read this: Honest generators only build onto a block (by referencing it in blocks they create) if it is the latest block in the longest valid chain. "Length" is calculated as total combined ...
wutzebaer's user avatar
  • 121
4 votes
1 answer
321 views

What prevents rewriting the history of a chain with a different difficulty? [duplicate]

It looks like the difficulty is deterministic, but only if the timestamps are trusted. What's to prevent a large miner from starting back much earlier in the chain (when difficultly was miniscule) ...
natevw's user avatar
  • 223
1 vote
1 answer
148 views

What if some attacker forks blockchain from height 1 with a constant difficulty 1?

I've been reading Satoshi's paper recently. There's one thing I cannot think through. That is because the target will limit the block production speed to 2016 blocks per two weeks on average no ...
Wang HongQin's user avatar
2 votes
1 answer
490 views

Chain with most proof of work - hash target or block header hash?

What is calculated towards the sum of PoW of the chain? Is it the target difficulty that has been met or is it the actual block header hash? Say the target is 000000ABC00000000... and I mine block ...
Wapac's user avatar
  • 1,074
1 vote
2 answers
247 views

Would an optimization proof-of-work problem where the entity with the lowest hash wins have any security weakness or other disadvantage?

I am wondering if there would be any security deficiencies if cryptocurrencies such as Bitcoin were to change their proof-of-work problems to optimization contests. For example, suppose Bitcoin were ...
Joseph Van Name's user avatar
1 vote
2 answers
324 views

Tie Breaker to reduce orphaned chains?

When two different miners find the same block number at roughly the same time, the chain is forked, and there is a bit of a race to develop a longer chain, leaving the alternative orphaned. Why is ...
abelenky's user avatar
  • 1,344
2 votes
1 answer
97 views

Why is it important that miners mine at the end of the longest branch?

In this paper, the authors present a simplified description of mining strategies. The strategy which they call "honest strategy" is to always mine a block at the end of the currently longest branch. ...
Erel Segal-Halevi's user avatar
2 votes
2 answers
3k views

Is bitcoin just one long block chain or are there multiple chains?

Is each block found just a link in the same long chain, or are there multiple chains?
Deekor's user avatar
  • 123
0 votes
2 answers
188 views

How do miners avoid transactions getting dropped?

I'm having a problem figuring out how miners solve the following problem: Let's say we have 2 miners: M1, M2. M1 adds transactions A,B,C,D to their block. M2 adds transactions A,B,C to their block. ...
Roy Kuper's user avatar
4 votes
1 answer
237 views

How does Bitcoin avoid splitting into multiple p2p networks?

So since Bitcoin is completely decentralized what stops multiple p2p networks from being formed? And what happens with the block chain when two separate P2P networks eventually reach each other? Will ...
user44048's user avatar
3 votes
2 answers
270 views

How do I know I can trust the head of the blockchain

I'm trying to understand how the mining process works. Specifically, my understanding is the local miner works on blocks and add them to their local blockchain if they succeed. It may turn out that ...
mprivat's user avatar
  • 155
2 votes
2 answers
142 views

Can there be stale blocks in "header first" implementation?

The Bitcoin developer guide mentions stale blocks as not being in the longest chain, then moves on to orphan blocks. It states you don't get orphan blocks, "and if you do" they are just dropped. But ...
Engineer's user avatar
  • 121
7 votes
2 answers
6k views

What does "Activating Best Chain" mean?

What does "Activating Best Chain" mean? My Bitcoin Core doesn't freeze, it just takes a while. I'm curious as to what it's doing.
DoaJC_Blogger's user avatar
2 votes
0 answers
65 views

Does the electrum client decide the best chain on the basis of how much work was done, or how long the chain is?

Bitcoin Core compares blockchains based on how much work they contain, and not necessarily which one is longest. This is useful for preventing time warp attacks. This comment on HN says that the ...
Nick ODell's user avatar
  • 29.3k
6 votes
2 answers
3k views

How is a blockchain split resolved?

Let's say two miners created 2 different blocks and broadcast them into the network. Now some clients see blockchain 1 and other blockchain 2 which are different from each other. I would like to ...
Haddar Macdasi's user avatar