Bitcoin Forum
June 30, 2024, 11:08:09 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Longest Chain?  (Read 436 times)
BlackJacky (OP)
Full Member
***
Offline Offline

Activity: 237
Merit: 100


View Profile
April 27, 2016, 12:05:41 PM
 #1

Folks,

Im wondering on what always the longest chain is based on. Is it on how many blocks or on how many transactions have been included.

For Example - lets say you have two chains competing:

1st chain has 6 blocks and every block has 100 Transactions (total 600 transactions)

2nd chain has 4 blocks and every block has 400 transactions (total 1600 transactions)

Which is now the longest chain and on which are miner now looking on?

Thanks in advance

Best
Lauda
Legendary
*
Offline Offline

Activity: 2674
Merit: 2965


Terminated.


View Profile WWW
April 27, 2016, 12:29:21 PM
 #2

Im wondering on what always the longest chain is based on.
Do you know what the word longest means? In your case, the answer would be chain 1. The number of blocks is what determines the longest chain. Additional useful information can be found here.

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
😼 Bitcoin Core (onion)
franky1
Legendary
*
Offline Offline

Activity: 4270
Merit: 4536



View Profile
April 27, 2016, 12:30:20 PM
 #3

Folks,

Im wondering on what always the longest chain is based on. Is it on how many blocks or on how many transactions have been included.

For Example - lets say you have two chains competing:

1st chain has 6 blocks and every block has 100 Transactions (total 600 transactions)

2nd chain has 4 blocks and every block has 400 transactions (total 1600 transactions)

Which is now the longest chain and on which are miner now looking on?

Thanks in advance

Best

answer in green

the chain is a chain of blocks. the longest chain is the longest amount of blocks

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
BlackJacky (OP)
Full Member
***
Offline Offline

Activity: 237
Merit: 100


View Profile
April 27, 2016, 01:01:35 PM
 #4

Thanks Smiley

How is it if two blocks are being published at the same time. One block with 100 transactions and the other block with 200 transactions included. Is the latter one taken or are miner not looking on the transactions included in the block?
topiOleg
Full Member
***
Offline Offline

Activity: 174
Merit: 100



View Profile
April 27, 2016, 01:19:57 PM
Last edit: April 27, 2016, 01:30:57 PM by topiOleg
 #5

Thanks Smiley

How is it if two blocks are being published at the same time. One block with 100 transactions and the other block with 200 transactions included. Is the latter one taken or are miner not looking on the transactions included in the block?

If both blocks with the same height received about the same time, miners build on top of the one received bit sonner because this one has higher chance to be longest chain in next block height (miners always build on top of longest chain anyway). Number of transactions included does not matter at all.

franky1
Legendary
*
Offline Offline

Activity: 4270
Merit: 4536



View Profile
April 27, 2016, 01:22:47 PM
Last edit: April 27, 2016, 01:37:36 PM by franky1
 #6

Thanks Smiley

How is it if two blocks are being published at the same time. One block with 100 transactions and the other block with 200 transactions included. Is the latter one taken or are miner not looking on the transactions included in the block?

its not about transactions amounts. forget transaction amounts.

if there were 2 blocks published at same time. they are both pushed out. and the the next fastest block (minutes later) will contain details of one OR the other, and obviously becomes the longest chain. and everyone follows that one, and drops the chain that is no longer the longest because it doesnt have a new block to keep up.. (process called orphaning)

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
DannyHamilton
Legendary
*
Offline Offline

Activity: 3430
Merit: 4681



View Profile
April 27, 2016, 02:39:14 PM
Last edit: April 27, 2016, 02:59:38 PM by DannyHamilton
 #7

Folks,

Im wondering on what always the longest chain is based on. Is it on how many blocks or on how many transactions have been included.

Most people will tell you that it is based on how many blocks are in the chain.  As a general rule of thumb that's a reasonable explanation, but technically it isn't correct.

The "longest chain" rule is actually based on the total proof of work.  Usually blocks generated at the same block height all have the same difficulty target, so more blocks means more proof of work.  However, if someone were to go back to the genesis block and try to generate several hundred thousand blocks at a MUCH easier difficulty target than the existing blockchain, their chain would still be "shorter" even if it had more blocks because it would have less total difficulty.

For Example - lets say you have two chains competing:

1st chain has 6 blocks and every block has 100 Transactions (total 600 transactions)

2nd chain has 4 blocks and every block has 400 transactions (total 1600 transactions)

Which is now the longest chain and on which are miner now looking on?

Assuming that all the blocks were generated at the same difficulty target, the 1st chain is the one that miners would choose to work on. Choosing the 2nd chain would result in all other miners rejecting your block, and therefore you would waste your effort (and money) trying to build on it.

Thanks Smiley

How is it if two blocks are being published at the same time. One block with 100 transactions and the other block with 200 transactions included. Is the latter one taken or are miner not looking on the transactions included in the block?

The intention is for miners to use the first block they receive. So some miners would receive the 100 transaction block first and would build on top of that. Other miners would receive the 200 transaction block and build on top of that.  Eventually, a miner would solve a block and broadcast it.  This would make the chain they were working on now the "longest". All miners that were working on the other chain would abandon it and switch to this new longest chain.  The block that didn't get built on top of would be considered "orphaned".
BlackJacky (OP)
Full Member
***
Offline Offline

Activity: 237
Merit: 100


View Profile
April 27, 2016, 02:49:59 PM
 #8

Folks,

Im wondering on what always the longest chain is based on. Is it on how many blocks or on how many transactions have been included.

Most people will tell you that it is based on how many blocks are in the chain.  As a general rule of thumb that's a reasonable explanation, but technically it isn't correct.

The "longest chain" rule is actually based on the total proof of work.  Usually blocks generated at the same block height all have the same difficulty target, so more blocks means more proof of work.  However, if someone were to go back to the genesis block and try to generate several hundred thousand blocks at a MUCH easier difficulty target than the existing blockchain, their chain would still be "shorter" even if it had more blocks because it would have less total difficulty.

For Example - lets say you have two chains competing:

1st chain has 6 blocks and every block has 100 Transactions (total 600 transactions)

2nd chain has 4 blocks and every block has 400 transactions (total 1600 transactions)

Which is now the longest chain and on which are miner now looking on?

Assuming that they all the blocks were generated at the same difficulty target, the 1st chain is the one that miners would choose to work on. Choosing the 2nd chain would result in all other miners rejecting your block, and therefore you would waste your effort (and money) trying to build on it.

Thanks Smiley

How is it if two blocks are being published at the same time. One block with 100 transactions and the other block with 200 transactions included. Is the latter one taken or are miner not looking on the transactions included in the block?

The intention is for miners to use the first block they receive. So some miners would receive the 100 transaction block first and would build on top of that. Other miners would receive the 200 transaction block and build on top of that.  Eventually, a miner would solve a block and broadcast it.  This would make the chain they were working on now the "longest". All miners that were working on the other chain would abandon it and switch to this new longest chain.  The block that didn't get built on top of would be considered "orphaned".

Wow, thanks for the long explanation!!! I got it!!! Cheesy
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!