Bitcoin Forum
March 28, 2024, 10:54:42 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about competing blocks  (Read 153 times)
StackGambler (OP)
Full Member
***
Offline Offline

Activity: 434
Merit: 101

YouTuber, gambler, and scam-buster.


View Profile
January 23, 2021, 08:32:50 AM
 #1

Hi all,

I have a question about competing blocks on the Bitcoin network. Let's say two miners find valid blocks at the same time, so half the nodes have accepted one block and half the nodes have accepted the other block. The blocks would mostly be the same, with a few subtle differences (a few transactions wouldn't be included in one of them).

When the subsequent block is mined on top of one of the previous two candidates, cementing the first one into the blockchain, what exactly happens to the missing transactions that were initially considered confirmed by half the nodes but may not necessarily be confirmed anymore? How exactly is this handled?

Thanks.

I like gambling. Probably currently trying to figure out how to pay next month's rent.
1711623282
Hero Member
*
Offline Offline

Posts: 1711623282

View Profile Personal Message (Offline)

Ignore
1711623282
Reply with quote  #2

1711623282
Report to moderator
1711623282
Hero Member
*
Offline Offline

Posts: 1711623282

View Profile Personal Message (Offline)

Ignore
1711623282
Reply with quote  #2

1711623282
Report to moderator
1711623282
Hero Member
*
Offline Offline

Posts: 1711623282

View Profile Personal Message (Offline)

Ignore
1711623282
Reply with quote  #2

1711623282
Report to moderator
"Bitcoin: the cutting edge of begging technology." -- Giraffe.BTC
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1711623282
Hero Member
*
Offline Offline

Posts: 1711623282

View Profile Personal Message (Offline)

Ignore
1711623282
Reply with quote  #2

1711623282
Report to moderator
1711623282
Hero Member
*
Offline Offline

Posts: 1711623282

View Profile Personal Message (Offline)

Ignore
1711623282
Reply with quote  #2

1711623282
Report to moderator
1711623282
Hero Member
*
Offline Offline

Posts: 1711623282

View Profile Personal Message (Offline)

Ignore
1711623282
Reply with quote  #2

1711623282
Report to moderator
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
January 23, 2021, 08:35:32 AM
 #2

When the subsequent block is mined on top of one of the previous two candidates, cementing the first one into the blockchain, what exactly happens to the missing transactions that were initially considered confirmed by half the nodes but may not necessarily be confirmed anymore? How exactly is this handled?

Each node which received the other (now stale) block will move the transactions back to the mempool.
Each node who initially received the block which is now part of the longest chain doesn't have to do anything.

StackGambler (OP)
Full Member
***
Offline Offline

Activity: 434
Merit: 101

YouTuber, gambler, and scam-buster.


View Profile
January 23, 2021, 08:41:29 AM
 #3

When the subsequent block is mined on top of one of the previous two candidates, cementing the first one into the blockchain, what exactly happens to the missing transactions that were initially considered confirmed by half the nodes but may not necessarily be confirmed anymore? How exactly is this handled?

Each node which received the other (now stale) block will move the transactions back to the mempool.
Each node who initially received the block which is now part of the longest chain doesn't have to do anything.

Ah, very interesting. So in our wallet we may see a transaction go from 1 confirmation to 0, if that unlikely situation happens. Thanks for the info!

I like gambling. Probably currently trying to figure out how to pay next month's rent.
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
January 23, 2021, 08:54:01 AM
 #4

Ah, very interesting. So in our wallet we may see a transaction go from 1 confirmation to 0, if that unlikely situation happens. Thanks for the info!

In the situation where 2 blocks are mined at the same time in which 1 block does contain your transaction and the other doesn't, this is the case if:
1) Your wallet received the block your transaction is included in and
2) the block your tx is included in will become stale since the very next block is building upon the other block (which doesn't have your TX included)

Even though this is pretty unlikely to happen, this is one reason why you should wait for more than 1 confirmation for higher amounts.

ranochigo
Legendary
*
Offline Offline

Activity: 2940
Merit: 4127



View Profile
January 23, 2021, 09:11:08 AM
 #5

Logically, if on the node hasn't seen a transaction on the stale chain, it would also be pushed from the stale block into the mempool, unless it is a non-standard transaction.

If a node is well connected, then it would probably be able to see both of the blocks (albeit only validating the entire block for the first block received) as the block header would be relayed.

..JAMBLER.io..Create Your Bitcoin Mixing
Business Now for   F R E E 
▄█████████████████████████████
█████████████████████████
████▀████████████████████
███▀█████▄█▀███▀▀▀██████
██▀█████▄█▄██████████████
██▄▄████▀▄▄▄▀▀▀▀▀▄▄██████
█████▄▄▄██████████▀▄████
█████▀▄█▄██████▀█▄█████
███████▀▄█▀█▄██▀█▄███████
█████████▄█▀▄█▀▄█████████
█████████████████████████
█████████████████████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
      OUR      
PARTNERS

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
▄█████████████████████████████
████████▀▀█████▀▀████████
█████▀█████████████▀█████
████████████████████████
███████████████▄█████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████▀█████████
████████████████████████
█████▄█████████████▄█████
████████▄▄█████▄▄████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
   INVEST   
BITCOIN

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
Oshosondy
Legendary
*
Offline Offline

Activity: 1400
Merit: 1114


...gambling responsibly. Do not be addicted.


View Profile WWW
January 23, 2021, 08:38:55 PM
 #6

...

...
I am somehow confused about the recent block that this kind of thing happened to, it is said to have never happens before. But I just want to ask that the first transaction which was later replace by RBF was later became invalid but at the time two mining pool took it up into block, that means the transaction was confirmed at the time? Which later remain invalid as miners tend not to make chain on the block at a particular point. I will like if this is clarified. That means two transactions can be confirmed in which one (the previous one) be confirmed but later become invalid?

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4315

<insert witty quote here>


View Profile
January 24, 2021, 01:19:43 AM
 #7

I am somehow confused about the recent block that this kind of thing happened to, it is said to have never happens before. But I just want to ask that the first transaction which was later replace by RBF was later became invalid but at the time two mining pool took it up into block, that means the transaction was confirmed at the time? Which later remain invalid as miners tend not to make chain on the block at a particular point. I will like if this is clarified. That means two transactions can be confirmed in which one (the previous one) be confirmed but later become invalid?
It now seems that the original transaction actually "won" and was confirmed... and the RBF (second) transaction with the "higher" fee ended up being invalid.

Essentially, 2 miners... 2 transactions...

Miner 1 Block 666833: Original Transaction
Miner 2 Block 666833: RBF Transaction

Miner 1's chain then becomes longest, as more miners add blocks on top of Miner 1's Block 666833.... it "wins" so Miner 2's block 666833 becomes "stale". This means that the Original Transaction is now "confirmed"... and the RBF Transaction is now invalid in the "stale" block.

What you "see" as "confirmed" and/or "invalid" when the 2 miners both broadcast competing block 666833's would depend on what "chain" your wallet (or wallet provider) was taking it's data from (ie. which Nodes it happened to be receiving data from). You may never have seen the RBF transaction if you were getting Miner 1 chain data... However, if you were getting Miner 2 chain data, you'd suddenly see a "re-org" when the other chain became longest and the last block on Miner 2 chain got rolled back.

..JAMBLER.io..Create Your Bitcoin Mixing
Business Now for   F R E E 
▄█████████████████████████████
█████████████████████████
████▀████████████████████
███▀█████▄█▀███▀▀▀██████
██▀█████▄█▄██████████████
██▄▄████▀▄▄▄▀▀▀▀▀▄▄██████
█████▄▄▄██████████▀▄████
█████▀▄█▄██████▀█▄█████
███████▀▄█▀█▄██▀█▄███████
█████████▄█▀▄█▀▄█████████
█████████████████████████
█████████████████████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
      OUR      
PARTNERS

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
▄█████████████████████████████
████████▀▀█████▀▀████████
█████▀█████████████▀█████
████████████████████████
███████████████▄█████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████▀█████████
████████████████████████
█████▄█████████████▄█████
████████▄▄█████▄▄████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
   INVEST   
BITCOIN

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
DannyHamilton
Legendary
*
Offline Offline

Activity: 3346
Merit: 4505



View Profile
January 24, 2021, 01:27:30 AM
Merited by HCP (2)
 #8

I am somehow confused about the recent block that this kind of thing happened to, it is said to have never happens before.
Sounds to me like nonsense from people that don't know what they are talking about. Reorgs happen all the time, it's part of the expected behavior from the design of Bitcoin.

That means two transactions can be confirmed in which one (the previous one) be confirmed but later become invalid?

Correct. This is why for high value transactions it has ALWAYS been recommended, by those that understand how bitcoin works, to wait for more than just 1 confirmation.  Each additional confirmation makes it exponentially less likely that it will later become invalid.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3346
Merit: 4505



View Profile
January 24, 2021, 01:32:24 AM
 #9

When the subsequent block is mined on top of one of the previous two candidates, cementing the first one into the blockchain, what exactly happens to the missing transactions that were initially considered confirmed by half the nodes but may not necessarily be confirmed anymore? How exactly is this handled?

Each node which received the other (now stale) block will move the transactions back to the mempool.
Each node who initially received the block which is now part of the longest chain doesn't have to do anything.

Ah, very interesting. So in our wallet we may see a transaction go from 1 confirmation to 0, if that unlikely situation happens. Thanks for the info!

Yes, however, keep in mind that it is quite likely (as long as the transaction is still valid) that the transactions in the stale block that were missing in the "cementED" block will be included in the cementING block.

(since they had a high enough transaction fee and propagation to make it into the stale block, there's a pretty good chance that the miner which handles the cementING block will include those transactions in that block.)

So while it's not a guarantee, and the transaction COULD go from 1 confirmation back to 0 confirmations for a bit, it's quite likely that it just goes from 1 confirmation to still being at 1 confirmation for a bit longer.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18497


View Profile
January 24, 2021, 04:34:35 AM
Merited by Oshosondy (1)
 #10

it is said to have never happens before.
As DannyHamilton has said, these single block re-orgs happen pretty frequently. The most recent ones are as follows:

Block 666833, on January 20th
Block 665005, on January 7th
Block 664578, on January 5th
Block 663043, on December 26th
Block 662642, on December 23rd

It is part of the normal functioning of bitcoin and absolutely nothing to be concerned about. It's not entirely clear why low quality clickbait crypto blog sites like CoinTelegraph have decided to blow this most recent reorg out of all proportion. Either because they are generally incompetent and don't understand what they are writing, or perhaps they needed to generate some more clicks for their ad revenue. Probably both.

Here is a good source of factual and non-click bait information about chain reorgs: https://learnmeabitcoin.com/technical/chain-reorganisation
StackGambler (OP)
Full Member
***
Offline Offline

Activity: 434
Merit: 101

YouTuber, gambler, and scam-buster.


View Profile
January 24, 2021, 07:27:14 AM
 #11

As far as I understand it, a 1 block reorg happens every 2 weeks, and usually the blocks contain mostly the same transactions. However this time there was a special case where one block had an input spent and the other block had the same input spent elsewhere with a higher fee, which hadn't happened before. (Still not dangerous, just new). Am I looking at it correctly?

I like gambling. Probably currently trying to figure out how to pay next month's rent.
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1610
Merit: 1899

Amazon Prime Member #7


View Profile
January 24, 2021, 07:40:50 AM
 #12

I am somehow confused about the recent block that this kind of thing happened to, it is said to have never happens before. But I just want to ask that the first transaction which was later replace by RBF was later became invalid but at the time two mining pool took it up into block, that means the transaction was confirmed at the time? Which later remain invalid as miners tend not to make chain on the block at a particular point. I will like if this is clarified. That means two transactions can be confirmed in which one (the previous one) be confirmed but later become invalid?
It now seems that the original transaction actually "won" and was confirmed... and the RBF (second) transaction with the "higher" fee ended up being invalid.

Essentially, 2 miners... 2 transactions...

Miner 1 Block 666833: Original Transaction
Miner 2 Block 666833: RBF Transaction
There were actually a total of 3 transactions, the original, and two RBF transactions. The first RBF transaction was never confirmed, and the 2nd RBF transaction was confirmed in the orphaned block.

Address 1D6ae...1va ended up receiving 0.00014499 on the final chain instead of 0.00062063 on the orphaned chain. My review of the transaction in question makes me believe that 1D6ae...1va is most likely a change address. I think the concern of some people is that 1D6ae...1va received less coin in the transaction that made it into the final chain than in the transaction in the chain that was orphaned.

While I do agree that orphaned blocks are not uncommon (and are part of how bitcoin works), it is more unusual for a confirmed transaction to be invalidated after a reorganization.
ranochigo
Legendary
*
Offline Offline

Activity: 2940
Merit: 4127



View Profile
January 24, 2021, 09:19:54 AM
 #13

Either because they are generally incompetent and don't understand what they are writing, or perhaps they needed to generate some more clicks for their ad revenue. Probably both.
The more you look into it, the more bizarre it gets. The reason why they decided to put $22Million is because some BSV supporter decided to make a tweet that was intentionally made to be out of context[1]. Well, instead of you know quoting someone more renowned within the field. They also decided to link some article on an "exploit" about RBF which is obviously known from the implementation of opt-in RBF. I don't trust CoinTelegraph to be reporting anything objectively considering that they cherrypicked the tweet.

As far as I understand it, a 1 block reorg happens every 2 weeks, and usually the blocks contain mostly the same transactions. However this time there was a special case where one block had an input spent and the other block had the same input spent elsewhere with a higher fee, which hadn't happened before. (Still not dangerous, just new). Am I looking at it correctly?
It doesn't have to happen every 2 weeks. Here's a monitor from BitMex[2]. Stale blocks doesn't happen all that often due to the fact that the block propagation timing has decreased drastically, in the earlier stages of Bitcoin, stale blocks happens much more often. It's also to the miners advantage to have their pools as interconnected to the others as possible, FIBRE has reduced the propagation times for miner in this aspect.

I'm fairly sure it has happened before, just that it isn't documented. There can be a variety of factors, ranging from poor propagation, different mempool policy, etc for this to happen. It's rare in this case as Slush didn't see both of the replacement transaction and instead chose to mine the one with the lowest fee.


[1] https://twitter.com/justicemate/status/1352092084346339332
[2] https://forkmonitor.info/feeds/stale_candidates/btc.rss

..JAMBLER.io..Create Your Bitcoin Mixing
Business Now for   F R E E 
▄█████████████████████████████
█████████████████████████
████▀████████████████████
███▀█████▄█▀███▀▀▀██████
██▀█████▄█▄██████████████
██▄▄████▀▄▄▄▀▀▀▀▀▄▄██████
█████▄▄▄██████████▀▄████
█████▀▄█▄██████▀█▄█████
███████▀▄█▀█▄██▀█▄███████
█████████▄█▀▄█▀▄█████████
█████████████████████████
█████████████████████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
      OUR      
PARTNERS

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
▄█████████████████████████████
████████▀▀█████▀▀████████
█████▀█████████████▀█████
████████████████████████
███████████████▄█████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████▀█████████
████████████████████████
█████▄█████████████▄█████
████████▄▄█████▄▄████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
   INVEST   
BITCOIN

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18497


View Profile
January 24, 2021, 09:00:29 PM
 #14

The reason why they decided to put $22Million is because some BSV supporter decided to make a tweet that was intentionally made to be out of context[1].
That tweet is a complete lie. "This could have been 22million" - no, it couldn't. Anyone who is accepting $22 million worth of bitcoin understands the basics of how bitcoin works. Be it an exchange, service, corporation, or individual, no one who is trading that amount of money is doing so while completely naive to how blocks are mined. No one who is accepting $22 million worth of bitcoin is handing over goods or services after 1 confirmation.

Stale blocks are not a bug nor a vulnerability. They are a byproduct of the very way that bitcoin works. They are the very reason that people talk about waiting for 3 or 6 confirmations. Much like the CoinTelegraph article, that BSV shill is either deliberately spreading misinformation for their own benefit or doesn't really understand what they are writing. Again, I suspect both.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!