Questions tagged [chain-reorganization]

Questions about the client-local phenomenon when a Bitcoin client discovers a new chain longer in terms of difficulty than its current chain.

Filter by
Sorted by
Tagged with
2 votes
1 answer
55 views

When was the most recent multiblock reorg?

We have an extinct chaintip with a single stale block something like once per month. But if I remember right, we haven’t had a multiblock reorg (two competing chaintips with at least two blocks depth) ...
Murch's user avatar
  • 72.7k
2 votes
1 answer
78 views

Retention and Accessibility of Disconnected Block and Transaction Data

In the context of a fully indexed, non-pruned Bitcoin Core node, I am exploring the duration and persistence of data related to disconnected blocks and their contained transactions due to a blockchain ...
Jeff Trimmer's user avatar
2 votes
3 answers
269 views

Would a series of reorgs cause Bitcoin to break because of the 2-hour block time difference restriction?

Imagine there are a series of reorgs happening because of maybe some fee sniping event or something else, doesn't matter. If that happens for over than 2 hours, then new blocks will not be able to ...
fiatjaf's user avatar
  • 559
0 votes
1 answer
253 views

Often seeing Rewinding blocks... and Loading block index

Every so often I see these error messages in Rewinding blocks... and Loading block. What is the cause of those error messages? I am using the core wallet.
Eddie0110's user avatar
2 votes
1 answer
253 views

InvalidateBlock RPC call behavior with Bitcoin Core

I'm currently implementing the rpc call invalidateblock on btcd, an alternate Bitcoin full node implementation. I'm trying to figure out how Bitcoin Core handles branch selection on reorganizations ...
kcalvinalvin's user avatar
1 vote
1 answer
335 views

Bitcoin chain reorganization

When two blocks are mined and propagated at similar times times causing a fork, how long would a node store a stale chain until considered orphaned? How many blocks (work) are needed on chain I for ...
Yazid's user avatar
  • 13
1 vote
2 answers
287 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
3 votes
1 answer
222 views

How can I simulate a reorg for testing?

I'm trying to test the Bitcoin Dev Kit Electrum client with Electrs 0.9.1 for the case of a 1-block reorg. I use invalidateblock on my single regtest bitcoind 22.0, but I don't see my test transaction ...
Murch's user avatar
  • 72.7k
4 votes
3 answers
273 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
1 vote
2 answers
218 views

What is the downside of having a default setting in which nodes will invalidate blocks that comprise a surprise reorg?

Suppose that suddenly, out of nowhere, a longest-chain appears that reorgs the last 15 blocks. Such an attack could be accomplished from time-to-time even by a minority attacker who is either lucky ...
MicahW's user avatar
  • 81
3 votes
2 answers
91 views

What verb best describes "causing another block to become stale"?

For example, suppose I'm selfish mining; you publish a block and then I immediately publish two, what did I do to your block? Similarly, if I'm executing a double-spend attack, my goal is to ?___? the ...
MicahW's user avatar
  • 81
1 vote
1 answer
117 views

Can a proof of work chain have finality?

My understanding is that finality is just a rule in the consensus which says any block that gets buried X block deep will be considered unchangeable by the consensus. This has nothing to do with proof ...
Kyrielight's user avatar
0 votes
1 answer
82 views

How do bitcoin nodes rollback state when a higher POW chain is introduced

Let's say the current chain consensus has a total POW of X... this is agreed upon by all 10k+ BTC nodes. A new "magic" node joins and it has mined a chain (privately) with total POW = 2*X. ...
user491880's user avatar
1 vote
1 answer
92 views

How exactly are the undo files used when a re-org takes place?

It is obvious that the undo files (rev*.dat files) are stored to restore the blockchain to a previous version when a re-org takes place. What is not clear to me is what are the exact uses of the ...
FrozoWeb's user avatar
0 votes
0 answers
179 views

Bitcoin re-org stats

Does anyone have a table of historic Bitcoin reorgs? Something like [yyyymmdd] [blockheight] 1 stale block [yyyymmdd] [blockheight] 1 stale block [yyyymmdd] [blockheight] 2 stale blocks [yyyymmdd] [...
Paul's user avatar
  • 13
2 votes
1 answer
332 views

What are the use cases where very old rev*.dat files are needed?

There have been multiple questions on this but none, IMO, really get to the issue: Given: The rev*.dat files hold "undo" data for rolling back the UTXO state, block by block, and they're 1::...
davidbak's user avatar
  • 261
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
2 answers
603 views

Incoming transaction has been marked as pending since 2013. How can I retrieve it?

I requested BTC from someone back in 2013. Its been in pending status ever since. It has nearly 500,000 confirmations. The value of transaction when initiated was only $200 or so. Now the value is ...
S D's user avatar
  • 21
1 vote
0 answers
97 views

How do nodes handle long reorgs?

In a reorg where a node receives blocks for a longer or equal-length chain than the chain they previously followed as longest, what is the process for that node to handle this situation? I can imagine ...
B T's user avatar
  • 1,569
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
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
3 votes
0 answers
185 views

Orphan blocks explorer

Is there any blockchain explorer that lists orphaned blocks or reorgs? How often does it happen in general? I only found this site which doesn't show any orphaned blocks after 2017: https://www....
premek.v's user avatar
  • 133
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
1 vote
0 answers
107 views

Where can I find data for abandoned blocks (74,638 to 74,690) for the Value Overflow Incident when ₿184 billion BTC were accidentally created?

I already have data for all the Mainchain Blocks. Where can I find data for the orphaned/abandoned blocks (74,638 to 74,690) before the re-organisation occurred? I can only seem to find information ...
Aman Saggu's user avatar
3 votes
1 answer
118 views

What is the proper way to handle reorgs when fetching headers

I work on bitcoin-s, and we've found a problem where if a node is stopped with it's chain tip being a one that is later reorged out it will not be able to continue syncing headers. This happens ...
benthecarman's user avatar
4 votes
1 answer
544 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
1 vote
1 answer
66 views

What does an orphaned tx look like via rpc? [closed]

I am testing with a currency forked from Pivx, but I see that bitcoind responds the same way here https://bitcointalk.org/index.php?topic=100824.0 with error code -5 If I send/receive a tx that then ...
Ben Muircroft's user avatar
4 votes
1 answer
100 views

What are the reasons to avoid spend-paths that become invalid over time (without a transaction)?

I have been told that a spend-path that expires is something bitcoin designers have explicitly avoided, and that it would cause bad reorg behavior (eg here). To be clear about what I mean by an ...
B T's user avatar
  • 1,569
0 votes
1 answer
121 views

Rewriting the blockchain?

The main bitcoin blockchain (the chain that miners choose to work on) is the chain with the most proof of work ("heaviest" chain). Currently, the cumulative proof of work on the bitcoin main ...
Anonymous's user avatar
0 votes
1 answer
86 views

Undo files format change and reorg process question for v0.19

This is a follow-up question for rev.dat file format Pieter Wuille gave a great explanation that is easy to follow. Since that posting there was a replacement of CTxInUndo with Coin, does the format ...
Vlad Proskurin's user avatar
1 vote
1 answer
306 views

Bitcoind not publishing blocks via ZMQ after reorganization

On the testnet, I am running a bitcoin core deamon (bitcoind) and am using ZMQ to receive updates about transactions and blocks (subscribed to both 'rawblock' and 'rawtx'). I was curious as to how ...
Jpst's user avatar
  • 113
2 votes
1 answer
2k views

What is the length of largest known reorganization in bitcoin? [duplicate]

Usually there is an assumption, that a transaction is fully finalized after 6 confirmations, e.g. 6 blocks mined on top of the block, which includes given transaction. What is the length of largest ...
warchantua's user avatar
1 vote
2 answers
208 views

How does bitcore handle transactions in a stale block situation?

I know stale blocks can occur naturally when two miners produce blocks at similar times. How is this handled in bitcore? For example, when a chain reorganization occurs in the node, does bitcore ...
SeungJun's user avatar
1 vote
1 answer
102 views

What happens if I spend a double spend?

Given I can receive a double spend and potentially re-spend it after 1 confirmation, what happens to that transaction once the double spend is detected during a blockchain reorg?
Anonona's user avatar
  • 215
2 votes
1 answer
579 views

Understanding getchaintips in terms of chain reorganisations

I'm trying to get an understanding of the chain reorganisations my node has experienced by looking at bitcoin-cli getchaintips. The "status" of the different branches tells me the following: 1. "...
inersha's user avatar
  • 2,968
1 vote
1 answer
168 views

Can a transaction disappear?

Can a transaction disappear after a transaction is submitted to the Bitcoin network? I read about stale blocks. Are all transactions in a stale block going away? Is there a possibility that ...
이경언's user avatar
1 vote
1 answer
431 views

bitcoin reorg question

if a block takes 10 minutes to be mined does it need 21 minutes to be reorged? if the reorg started immediately after the block was mined because 100% was mining and 51.5% will reorg how long does ...
BTC involver's user avatar
6 votes
1 answer
433 views

How long are orphaned or stale blocks kept in bitcoin core nodes memory?

If there was a chain reorg, for example: Blockchain: 0a---1a---2a---3a becomes... 0a---1a---2b---3b How long are blocks 2b and 3b kept in memory on the node? If I query the node for block 2b ...
Malone's user avatar
  • 207
1 vote
0 answers
62 views

how do I mark coins spent in invalid blocks as unspent?

I was just testing bitcoin (v17) in regtest mode with the local, built-in wallet. If I send money to an address (I don't own), generate 1, and then invalidate that block, the local wallet does not ...
Brannon's user avatar
  • 189
0 votes
1 answer
133 views

Where is the code of chain reorganization in Bitcoin Core

I'm trying to understand how Bitcoin Core works in-depth. Can someone tell me where is the code executed during a blockchain reorganization in Bitcoin Core? Any explanation would also be greatly ...
SystemGlitch's user avatar
1 vote
1 answer
66 views

Is Block Finalization a valid development to remove the threat of 51% attacks?

https://www.reddit.com/r/btc/comments/bq8cqo/btctop_currently_has_51_hashing_power/eo2p4md?utm_source=share&utm_medium=web2x A recent comment from a Reddit user in response to BTC.top acquiring ...
AdaptiveAnalysis's user avatar
2 votes
2 answers
311 views

Why do large blocks increase the probability of chain reorgs?

After the recent two chain reorgs taking place in Bitcoin Cash SV, I am finding a number of developers stating that large blocks are the reason for the reorgs: "Almost each time someone is trying to ...
AdaptiveAnalysis's user avatar
0 votes
1 answer
94 views

Bitcoin fork resolution - Fork losers download previous blocks 'til common block?

When resolving a naturally occurring fork in Bitcoin, do the miners who were working on the orphaned fork download previous blocks from the miner who won the block reward that resolved the fork until ...
Fisticuffs's user avatar
1 vote
0 answers
98 views

confirmations: 0 vs confirmations: -1? [duplicate]

I'm looking at a bitcoin clone, not sure what codebase it was cloned from, but I've noticed that the listSinceBlock output sometimes includes: a receive that has 0 confirmations a send that has 0 ...
Caius Jard's user avatar
2 votes
2 answers
166 views

Transaction in orphaned block question

This is a theoretical question. Assuming that a transaction (TX_A) with me on the receiving end gets added to the blockchain, I should be able to spend the amount I received. So I go on and spend it ...
Larrrrrrrrrry's user avatar
1 vote
2 answers
303 views

How to return tx to mempool from stale block?

This question is centered around the implementation of how transactions from a reorganized block return to the mempool. In my understanding, once a block becomes organized out of the best chain all ...
Some_user_qwerty's user avatar
2 votes
1 answer
202 views

Is "fee higher than block reward" attack possible?

Imagine the following scenario: I send you 1000 BTC. After 6 confirmations, you give me what I bought. I create another transaction with 900 BTC to my own wallet and 100 BTC as transaction fee, using ...
zzh1996's user avatar
  • 134
4 votes
1 answer
533 views

Are old rev*.dat file safely deletable?

based on this answer rev files contains information for dealing with reorgs. If I think reorg longer than let's say a month are highly unlikely, could I safely delete rev*.dat files older than a month?...
Riccardo Casatta's user avatar
3 votes
3 answers
1k views

Why you need to rehash each block after a changed block when changing data in a blockchain?

Maybe my question is stupid, but, why you need to rehash each block after a changed block when changing data in a blockchain? Each block contains a hash of its data and hash of previous block. If I ...
umaru's user avatar
  • 33
6 votes
2 answers
1k views

51% attack and rewriting to the latest checkpoint

This is not a question about the consequence of a 51% on the price nor as to the motivation of the attacker. Let say we don't care that it's not realistic and we don't care that the attacker wouldn't ...
Cedric Martin's user avatar