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
1
vote
1answer
67 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 ...
4
votes
1answer
80 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 ...
1
vote
0answers
35 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 ...
0
votes
0answers
42 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 ...
1
vote
1answer
39 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 ...
1
vote
2answers
126 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 ...
0
votes
1answer
45 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 ...
1
vote
0answers
59 views

confirmations: 0 vs confirmations: -1?

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 ...
3
votes
3answers
432 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 ...
5
votes
2answers
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 ...
1
vote
1answer
256 views

Why is the Bitcoin blockchain designed so that a block can be unconfirmed?

I have a basic question about blockchain and Bitcoin. After a transaction is confirmed and included in a block, it is said to have a depth (confirmation) of one. However I've read that many ...
1
vote
2answers
377 views

Valid block on top of invalid block

I have been researching a little on the concept of blockchain for some time now. If there is any corrupted block then others won't try to build blocks on top of it. But suppose for some time if it ...
1
vote
2answers
308 views

What going to happend with transactions that is in both rejectend AND accepted chains?

I have been reading about blockchain forks and the longest chain situations and I cannot really understand what is going to happend in the situation when the transacton were included in both accepted ...
1
vote
0answers
107 views

Bitcoinj stuck after chain split

I am using LevelDBFullPrunedBlockStore as a BlockChain. once in every 2-3 chainsplit in the network my bitcoinJ node stops to download new block. The scenario is always the same 1)My node get block ...
4
votes
2answers
613 views

How to detect reorganization from bitcoind via ZMQ?

I have my own bitcoind server (bitcoin core) and receive transaction data from the bitcoind via ZMQ. Then the transactions are stored into my database for data analytics or statics. [bitcoind] --> (...
4
votes
1answer
196 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 ...
3
votes
2answers
212 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 ...
0
votes
2answers
248 views

What would happen if a private fork several hundred blocks ahead tried to merge back?

Suppose mining pool has been off the main network for a long time so that they are 100 or so blocks behind, but managed to mine 200 blocks in the period (say, some combination of had 33% before, ...
2
votes
2answers
78 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 ...
2
votes
1answer
189 views

In what scenarios can the blockchain size decrease for bitcoin?

I am running a private bitcoin network for which I changed the target time between two blocks to 12 seconds and the difficulty adjustment to 25 blocks interval. I ran the network for about 4 hours ...
2
votes
1answer
286 views

What happens to non-standard transactions in the case of a blockchain reorg?

Blockchain [m1]-> [m2] -> [m3] -> [m4] | -> [f1] -> [f2] -> [new] m - mainchain blocks f - fork blocks new - tip of the fork that is at greater height than the previous ...
2
votes
1answer
211 views

What would you do while a hard fork lasts?

It is conceivable (though generally buried with cognitive dissonance, I imagine) that a hard fork might not get resolved. This almost happened once before, and the miners picked the fork that solved ...
1
vote
1answer
414 views

Do we need to maintain the ability to do a reorg over 100 blocks?

The protocol requires that freshly generated coins wait 100 blocks before they can be spent in order to avoid polluting bitcoin addresses with bitcoins that are "uncreated" by a reorg that invalidates ...
3
votes
1answer
127 views

When an attacker publishes a longer chain, does Bitcoin Core emit a warning?

I tried answering a question about a majority-attacker's power to change the blockchain yesterday. There is one thing I haven't been able to get a clear picture on, yet: When a previously unknown ...
2
votes
1answer
542 views

Can an attacker with 51% of hash power change old blocks?

I read what an attacker with 51% of hash power can do in here and here. However, I want to know whether an attacker with 51% of hash power can change old blocks? For example, assume the attacker has ...
1
vote
0answers
612 views

Mempool tracking

I'm trying to clear up some uncertainties around the mempool A tx comes in, its validated, and no other transactions have currently marked any of its inputs. Tx gets added to mempool. If a double ...
3
votes
1answer
530 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?
3
votes
1answer
297 views

What happens to my outgoing txs in a block reorganization?

Let's assume I create and send a series of txs: |------block A--------|------block B----------|----block C-----|----block D-----| |Tx1......Tx2.........|...Tx3.................|................|.........
3
votes
1answer
890 views

Conflicted transactions in blockchain reorganizations

When my service detects a conflicted transaction (either sent or received) it rollbacks everything that was logically built upon this transaction. The "problem" is that transactions can go from ...
2
votes
2answers
356 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 ...
2
votes
1answer
649 views

What happens to off chain transactions when the blockchain is reorganised?

Many companies seem to use off chain transactions to transfer bitcoins between their own customers. What happens when a side chain gains dominance and no longer contains a block with the underlying ...
4
votes
1answer
451 views

How frequent are side-chain reorganizations of various lengths?

I'm wondering if anyone has collected statistics on how often reorganizations of side-chains with length 1 happen in comparison with lengths of 2, 3, or more. Related: What is the longest chain ...
1
vote
1answer
115 views

Would it be possible to overtake the network by running a secluded mining operation for many years?

I have a scenario. Let's say I start my own Bitcoin mining on a secluded network. I leave this to mine for many years or even pass it down to future generations. To the very point that my chain is ...
7
votes
2answers
696 views

Can the blockchain be outpaced by a chain of low-difficulty blocks?

Let's say someone creates a blockchain fork starting from the genesis block, when the difficulty was absurdly low compared to today; then he starts mining new blocks from there up to the current block ...
0
votes
2answers
249 views

Why can't I create a fork of BTC that has no difficulty changes so I can premine the rest of the coins?

I don't want to necessarily do this, but what prevents this scenario from being possible? [just timestamps and a difficulty modifier alone? - if that's the case then why can't I modify the client to ...
3
votes
3answers
364 views

How is over-spending one block apart prevented?

So, let's say you have a wallet with 20BTC, and you have a flow like so: You send 15BTC to A in block 1 You send 15BTC to B in block 2 What happens if at block 1 there are two chains across miners. ...
8
votes
1answer
7k views

What was the goal of creating the feature of immature coins?

I just ran into the idea of immature coins. Can someone explain to me the idea behind immature coins and what was the purpose of it?
1
vote
2answers
622 views

If a block chain is considered invalid, how about transactions in this block chain?

Say if at current time there exist split of block chain, we call them A and B. A is "longer" then B, as the result B will be eventually forgotten, but what happened about the transactions in blocks on ...
18
votes
3answers
1k views

Countrywide Internet isolation, inevitable fork

Many countries around the world have provisions for shutting off the Internet as well as isolating itself from the Internet (where networking within borders still flourishes), any transaction ...
2
votes
1answer
115 views

How are transactions in forks verified efficiently?

In this answer here, it's stated that Bitcoin uses a hashtable of all currently unspent outputs, in order to verify that the inputs of transactions haven't already been spent. How does this interact ...
1
vote
0answers
44 views

statistics on actual “replacement” of blocks [duplicate]

I'm not sure if I'm using the right terminology but I know that theoretically it's possible for a block to be part of the longest (i.e. "main") blockchain but then be "replaced" by an alternative ...
3
votes
3answers
593 views

Why should a miner choose the longest blockchain if another chain has a higher expected reward?

Why did miners/pools choose the longest chain for continuing it? Because with this strategy they have the highest expected bitcoin reward. The expected bitcoin reward is (new generated bitcoin (b) + ...