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
4 votes
1 answer
869 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 ...
user avatar
  • 185
1 vote
2 answers
96 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 ...
user avatar
3 votes
3 answers
213 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 ...
user avatar
  • 41
0 votes
0 answers
27 views

is there a way of removing invalid chaintips?

after mining on the testnet getchaintips got full of chaintips with "status": "invalid". Invalid chaintips can't be extended with new blocks because one invalid block makes the ...
user avatar
  • 227
2 votes
1 answer
195 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 ...
user avatar
  • 123
0 votes
1 answer
46 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 ...
user avatar
2 votes
1 answer
101 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 ...
user avatar
0 votes
1 answer
69 views

Potential fork from genesis block using enourmous 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, ...
user avatar
7 votes
2 answers
658 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 ...
user avatar
  • 173
1 vote
2 answers
256 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 ...
user avatar
1 vote
3 answers
111 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 ...
user avatar
  • 941
1 vote
1 answer
41 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 ...
user avatar
  • 11
1 vote
1 answer
75 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 ...
user avatar
3 votes
2 answers
355 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 ...
user avatar
6 votes
1 answer
280 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 ...
user avatar
  • 159
2 votes
1 answer
114 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 ...
user avatar
4 votes
1 answer
329 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 ...
user avatar
  • 449
2 votes
2 answers
100 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 ...
user avatar
0 votes
1 answer
342 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 ...
user avatar
  • 133
3 votes
1 answer
309 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.
user avatar
  • 142
2 votes
1 answer
117 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 ...
user avatar
1 vote
1 answer
483 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 ...
user avatar
  • 1,082
4 votes
1 answer
96 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" ...
user avatar
1 vote
2 answers
267 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 ...
user avatar
  • 137
4 votes
1 answer
350 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 ...
user avatar
6 votes
2 answers
347 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 ...
user avatar
1 vote
1 answer
78 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 ...
user avatar
0 votes
1 answer
58 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 ...
user avatar
0 votes
1 answer
204 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 ...
user avatar
2 votes
1 answer
88 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 ...
user avatar
2 votes
1 answer
102 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'...
user avatar
0 votes
1 answer
319 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 ...
user avatar
  • 405
2 votes
1 answer
127 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 ...
user avatar
  • 121
4 votes
1 answer
302 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) ...
user avatar
  • 224
1 vote
1 answer
132 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 ...
user avatar
1 vote
2 answers
221 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 ...
user avatar
1 vote
2 answers
300 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 ...
user avatar
  • 1,334
2 votes
1 answer
86 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. ...
user avatar
2 votes
2 answers
2k 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?
user avatar
  • 123
0 votes
2 answers
176 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. ...
user avatar
4 votes
1 answer
222 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 ...
user avatar
3 votes
2 answers
261 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 ...
user avatar
  • 155
2 votes
2 answers
122 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 ...
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.
user avatar
2 votes
0 answers
57 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 ...
user avatar
  • 28.7k
6 votes
2 answers
2k 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 ...
user avatar
3 votes
1 answer
592 views

Can a shorter chain overcome a longer one?

Could a dominating chain fork actually be shorter (in blocks) than its abandoned predecessor? Under what circumstances could this happen?
user avatar
  • 1,366
2 votes
2 answers
421 views

In what order do new blocks get processed?

Node A receives a newest block with height h1, which it determines to be valid, and therefore stores the block on disk. A little later, it receives another block with the same height h1 but a greater ...
user avatar
  • 187
2 votes
1 answer
81 views

What does the main_chain value returned by blockchain.info mean?

What does it mean that for bitcoin block to be on the Main Chain? What other chains are there? Is this as opposed to testnet? This is regarding the main_chain value in the blockchain.info api here: ...
user avatar
  • 123
11 votes
1 answer
5k views

Strongest vs Longest chain and orphaned blocks

Satoshi writes at the bottom of page 3 of his white paper that "If two nodes broadcast different versions of the next block simultaneously, some nodes may receive one or the other first. In that case, ...
user avatar
  • 13.7k