Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: underhood on October 10, 2016, 07:44:04 PM



Title: Strange Tiny blocks
Post by: underhood on October 10, 2016, 07:44:04 PM
Hi,

usually block sizes of mined blocks are near 1MB limit however from time to time strange blocks are mined with just few transactions. Any idea why?

Example:
  • 1 transaction 0.27kb- https://blockchain.info/block-height/433789
  • 9 transactions 2.19kb - https://blockchain.info/block-height/433768
  • 170 transactions 58kb - https://blockchain.info/block-height/433736

In the middle of typical blocks:
 ~2000+ transactions
 ~ 990kb+

It quite stands out. Another question is could this be a possible way to attack block-chain? You do not need to have 50% of mining power but if you mine blocks without transaction on purpose you are slowing the network down.


Title: Re: Strange Tiny blocks
Post by: Chris! on October 10, 2016, 07:48:55 PM
Huh I've never seen a block with 1 transaction before. I'm sticking around to hear a good technical answer here  :P

Are these perhaps orphan blocks?

http://bitcoin.stackexchange.com/questions/13987/what-happens-when-you-send-a-transaction-that-ends-up-in-an-orphaned-block-is-i (http://bitcoin.stackexchange.com/questions/13987/what-happens-when-you-send-a-transaction-that-ends-up-in-an-orphaned-block-is-i)


Title: Re: Strange Tiny blocks
Post by: achow101 on October 10, 2016, 07:49:46 PM
Empty blocks (blocks with one transaction, the coinbase transaction) usually occur due to SPV mining where the miners have not validated the previous block before building the next block on it. This means they don't know what transactions were included in that block so they do not include any transactions in the next block until they have validated the previous block.

The other blocks with few transactions may happen if the entire mempool of the miner's node was cleared by the last block and they have only received a few transactions when they began building the next block. This may be unlikely, but not impossible.

There may be another reason, but it all depends on the algorithm used to select the transactions. Blocks being at less than the maximum is not really strange, they happen all the time.

One thing to note is that if all blocks were full (as many claim is true but is actually not), then a significant amount of the "backlog" would actually be cleared.


Title: Re: Strange Tiny blocks
Post by: Lutpin on October 10, 2016, 07:51:16 PM
Are these perhaps orphan blocks?
No, oprhan blocks are part of chains that are shorter than the current main chain (most of them are just single or two blocks).
All of the blocks above are part of the main chain. A block doesn't have to be empty in order to be orphaned, both things don't directly influence each other.

(everything else is well covered by achow101 above)


Title: Re: Strange Tiny blocks
Post by: underhood on October 10, 2016, 07:53:25 PM
Well what i say is maybe wrong? I do know the concept of how bitcoin works but do not follow all the tiny details.

I am sure there is some technical issue resulting in those blocks.

But it makes me think:

Imagine attacker looking to disrupt BTC with enough power (example china) but not enough to have 50%. As a government of china i want to disrupt bitcoin. There is lot of miners in China. Instead of blocking them i would just block them from receiving transactions and thus mining useless blocks (as they do not have any transactions within them).
Another question would be how are miner protected from fake transaction DDOSing:
Is it possible to DDOS miner pool with purposely wrong transactions? Keeping pool busy rejecting them and real transactions not reaching the pool as result?


Title: Re: Strange Tiny blocks
Post by: underhood on October 10, 2016, 07:58:01 PM
Empty blocks (blocks with one transaction, the coinbase transaction) usually occur due to SPV mining where the miners have not validated the previous block before building the next block on it. This means they don't know what transactions were included in that block so they do not include any transactions in the next block until they have validated the previous block.

The other blocks with few transactions may happen if the entire mempool of the miner's node was cleared by the last block and they have only received a few transactions when they began building the next block. This may be unlikely, but not impossible.

There may be another reason, but it all depends on the algorithm used to select the transactions. Blocks being at less than the maximum is not really strange, they happen all the time.

One thing to note is that if all blocks were full (as many claim is true but is actually not), then a significant amount of the "backlog" would actually be cleared.

Hi thanks to explanation.
It is clear to me block doesn't have to be full. However usually they are near full due to high traffic nowadays. Even if traffic is lower block is ~>500kB. It just seemed very strange to me in the middle of high traffic there is suddenly block with no transactions (technically with one coinbase transaction)


Title: Re: Strange Tiny blocks
Post by: achow101 on October 10, 2016, 07:59:01 PM
Well what i say is maybe wrong? I do know the concept of how bitcoin works but do not follow all the tiny details.

I am sure there is some technical issue resulting in those blocks.
There isn't really an issue. The issue is that miners SPV mine, and that can be really bad for the blockchain as it can lead to forks.

But it makes me think:

Imagine attacker looking to disrupt BTC with enough power (example china) but not enough to have 50%. As a government of china i want to disrupt bitcoin. There is lot of miners in China. Instead of blocking them i would just block them from receiving transactions and thus mining useless blocks (as they do not have any transactions within them).
Theoretically possible, but not likely.

Another question would be how are miner protected from fake transaction DDOSing:
Is it possible to DDOS miner pool with purposely wrong transactions? Keeping pool busy rejecting them and real transactions not reaching the pool as result?
There are no such things as "fake transactions". If a transaction is invalid it will be rejected. If someone attempts to DoS a node with invalid txs, then they will be banned by that node.


Title: Re: Strange Tiny blocks
Post by: DarkStar_ on October 10, 2016, 08:00:14 PM
Imagine attacker looking to disrupt BTC with enough power (example china) but not enough to have 50%. As a government of china i want to disrupt bitcoin. There is lot of miners in China. Instead of blocking them i would just block them from receiving transactions and thus mining useless blocks (as they do not have any transactions within them).
That wouldn't work, as miners (unless it's an SPV block) get the previous block's information from another node (hence the p2p network), and if that node can give the miner the block information, it can give them the translation information as well. Blocking them off from other bitcoin nodes will cause them to be unable to mine a block and claim the reward.


Title: Re: Strange Tiny blocks
Post by: achow101 on October 10, 2016, 08:04:04 PM
Imagine attacker looking to disrupt BTC with enough power (example china) but not enough to have 50%. As a government of china i want to disrupt bitcoin. There is lot of miners in China. Instead of blocking them i would just block them from receiving transactions and thus mining useless blocks (as they do not have any transactions within them).
That wouldn't work, as miners (unless it's an SPV block) get the previous block's information from another node (hence the p2p network), and if that node can give the miner the block information, it can give them the translation information as well. Blocking them off from other bitcoin nodes will cause them to be unable to mine a block and claim the reward.
It's called a sybil attack and they are entirely possible. A miner's node could be theoretically connected to only malicious nodes which could withhold all the new transactions and only relay blocks. It would be more effective to just cut them off the network though.


Title: Re: Strange Tiny blocks
Post by: underhood on October 10, 2016, 08:05:06 PM
There isn't really an issue. The issue is that miners SPV mine, and that can be really bad for the blockchain as it can lead to forks.
Clear and agree. "Issue" is wrong word for what i meant to say. Better word would be "technical reason" (as in not malicious)

Theoretically possible, but not likely.

A lot of the blocks are mined by different mining pools, not some anonymous big miner. Furthermore, just because a lot of the miners are of the same ethnicity and nationality does not mean that they all communicate with each other and are colluding to disrupt the blockchain. Also, the miners do not control what goes in the block but rather the pool operators.
What i meant is Government instead of blocking bitcoin all-together (as it has control over internet in that country) blocking just incoming transactions for miners. However as I think more about it miners would soon notice it.
There are no such things as "fake transactions". If a transaction is invalid it will be rejected. If someone attempts to DoS a node with invalid txs, then they will be banned by that node.
Again poor choice of words. I meant as you corrected me invalid transactions. And again thanks for answer. Basically what i asked is if there is invalid transaction DDOS protection. You say there is.

Thanks


Title: Re: Strange Tiny blocks
Post by: underhood on October 10, 2016, 08:12:36 PM
It's called a sybil attack and they are entirely possible. A miner's node could be theoretically connected to only malicious nodes which could withhold all the new transactions and only relay blocks. It would be more effective to just cut them off the network though.

Well idea was for attacker with control of internet in country not to only block Bitcoin use in the country but to cause a disruption as well (for users outside country to for example decrease price of BTC). However as is clear to me now miners would soon detect this and try to circumvent, meaning you still cannot do it for long time without assistance from all mining pools in the country as well.

Thinking even further it would be much easier for them (China as example but meant any big anti bitcoin country) to just push fake binaries of bitcoin to people. Especially after WoSign/StartCom debacle with issuing HTTPS certificate for any domain if you asked nicely.


Title: Re: Strange Tiny blocks
Post by: achow101 on October 10, 2016, 08:28:26 PM
Thinking even further it would be much easier for them (China as example but meant any big anti bitcoin country) to just push fake binaries of bitcoin to people. Especially after WoSign/StartCom debacle with issuing HTTPS certificate for any domain if you asked nicely.
Even so there are still protections against that. Bitcoin Core uses a distributed and deterministic release process (known as gitian building). Multiple people build the Bitcoin binaries and the hashes of all the binaries must match. Then the release is made and those hashes are signed with Wladimir's PGP key which only he has (in theory). The code signing keys for windows and mac are controlled only by Cory Fields (IIRC). Anything a malicious entity does would result in hashes that don't match what was released and what the gitian builders published when they did the gitian builds.


Title: Re: Strange Tiny blocks
Post by: underhood on October 10, 2016, 08:39:51 PM
Thinking even further it would be much easier for them (China as example but meant any big anti bitcoin country) to just push fake binaries of bitcoin to people. Especially after WoSign/StartCom debacle with issuing HTTPS certificate for any domain if you asked nicely.
Even so there are still protections against that. Bitcoin Core uses a distributed and deterministic release process (known as gitian building). Multiple people build the Bitcoin binaries and the hashes of all the binaries must match. Then the release is made and those hashes are signed with Wladimir's PGP key which only he has (in theory). The code signing keys for windows and mac are controlled only by Cory Fields (IIRC). Anything a malicious entity does would result in hashes that don't match what was released and what the gitian builders published when they did the gitian builds.

That is all nice and perfect however I am not optimistic about percentage of users who really go and verify binaries against signature. If nobody really verifies it then it is not so useful (e.g. majority doesn't verify resulting in majority of user possibly running fake version).


Title: Re: Strange Tiny blocks
Post by: DarkStar_ on October 10, 2016, 08:53:55 PM
That is all nice and perfect however I am not optimistic about percentage of users who really go and verify binaries against signature. If nobody really verifies it then it is not so useful (e.g. majority doesn't verify resulting in majority of user possibly running fake version).
Eventually someone will do it though, realize that they don't match and post it here or on reddit. If it's legit, a lot of discussion will occur, and eventually it will be published on bitcoin news sites, and possibly get on mainstream media as people will care about it. People will then start to get the legit client from a torrent or a mirror site, and China's (or another country)'s attack will be stopped.


Title: Re: Strange Tiny blocks
Post by: ranochigo on October 11, 2016, 08:49:43 AM
That is all nice and perfect however I am not optimistic about percentage of users who really go and verify binaries against signature. If nobody really verifies it then it is not so useful (e.g. majority doesn't verify resulting in majority of user possibly running fake version).
Eventually someone will do it though, realize that they don't match and post it here or on reddit. If it's legit, a lot of discussion will occur, and eventually it will be published on bitcoin news sites, and possibly get on mainstream media as people will care about it. People will then start to get the legit client from a torrent or a mirror site, and China's (or another country)'s attack will be stopped.
Censorship is prevalent in China with majority of the sites being blocked in China. AFAIK, China started blocking bitcointalk.org sometime ago. It is up to the miner to verify the software themselves.


Title: Re: Strange Tiny blocks
Post by: -ck on October 11, 2016, 12:18:12 PM
Here's a long discussion regarding empty blocks in mining:
https://bitcointalk.org/index.php?topic=1085800.0

In short it's a crappy workaround used by some pools to speed up their block changes immediately after another blocksolve to compensate for slow software which does not do full verification of the previous block, using only the header and therefore cannot build any more transactions onto the next block.

If you look at this site at the last 6 months' blocks you can see the sizes and pools that offend with 1txn blocks:

http://data.bitcoinity.org/bitcoin/blocksize/6m?t=l

Also if you sort by average size you'll see my pool has the largest average blocksize - in fact 3 of the top 4 average blocksize pools run my software. I strongly advocate against SPV mining and empty blocks.


Title: Re: Strange Tiny blocks
Post by: RocketSingh on October 11, 2016, 03:15:50 PM
usually block sizes of mined blocks are near 1MB limit however from time to time strange blocks are mined with just few transactions. Any idea why?
AntPool owner Jihan Wu said the following in response to Alex Petrov of BitFury...

Quote
@sysmannet sorry, we will continue mining empty blocks. This is the freedom given by the Bitcoin protocol.
Source: https://twitter.com/JihanWu/status/704476839566135298

  • 1 transaction 0.27kb- https://blockchain.info/block-height/433789
Mined by BTCC Pool.

  • 9 transactions 2.19kb - https://blockchain.info/block-height/433768
Mined by AntPool.

  • 170 transactions 58kb - https://blockchain.info/block-height/433736
Mined by Kano CKPool.


Title: Re: Strange Tiny blocks
Post by: underhood on December 23, 2016, 09:06:19 AM
usually block sizes of mined blocks are near 1MB limit however from time to time strange blocks are mined with just few transactions. Any idea why?
AntPool owner Jihan Wu said the following in response to Alex Petrov of BitFury...

Quote
@sysmannet sorry, we will continue mining empty blocks. This is the freedom given by the Bitcoin protocol.
Source: https://twitter.com/JihanWu/status/704476839566135298

  • 1 transaction 0.27kb- https://blockchain.info/block-height/433789
Mined by BTCC Pool.

  • 9 transactions 2.19kb - https://blockchain.info/block-height/433768
Mined by AntPool.

  • 170 transactions 58kb - https://blockchain.info/block-height/433736
Mined by Kano CKPool.

I think it will self correct anyway as mining reward is going to decrease the main revenue source will be transaction fees. Meaning after some time mining empty blocks would be against miners interest.


Title: Re: Strange Tiny blocks
Post by: mezzomix on December 23, 2016, 09:56:47 AM
Quote
@sysmannet sorry, we will continue mining empty blocks. This is the freedom given by the Bitcoin protocol.
Source: https://twitter.com/JihanWu/status/704476839566135298

Not relaying new small blocks when the mempool is full is a freedom every node operator has! Let's create a small disadvantage for SPV miners.  ;)


Title: Re: Strange Tiny blocks
Post by: Yogafan00000 on December 23, 2016, 04:30:50 PM
Because it's too slow to include transactions in a block, during that very short time, some other miner might solve the block, they want to submit the solution as fast as possible, they will ignore the transaction fees and only go for the mining reward.



Title: Re: Strange Tiny blocks
Post by: Taras on December 24, 2016, 04:18:33 AM
Small blocks are really not some horrible sinister thing. There is no reason to take action against someone that solves one, or otherwise berate them.

Sure, it would have been better if the block could contain more transactions and lessen the load on the mempool. But if you had to choose between submitting a 100 kb block and not submitting a block at all... You're going to submit the 100 kb block, obviously. You are still getting 12.5 BTC and are confirming a sizable number transactions.

When a 100 kb block is solved, 900 kb of capacity was not just lost. The miner responsible introduced 100 kb of capacity. Not 1 mb, but still a lot more than zero. Mining is all probabilistic, remember. The block could never have been solved at all, and the mempool would be 100 kb bigger as a result.

Even if a block has no transactions at all other than the coinbase - which does not happen a lot nowadays except in some technical cases - the block is still improving the integrity of the block chain, giving recently confirmed transactions and blocks another confirmation, and introducing 12.5 BTC to most likely many people at once (enthusiasts like you and me). It is not by any means a waste and should not be considered unwelcome or inappropriate.


Title: Re: Strange Tiny blocks
Post by: gmaxwell on December 25, 2016, 07:04:34 AM
But if you had to choose between submitting a 100 kb block and not submitting a block at all... You're going to submit the 100 kb block, obviously. You are still getting 12.5 BTC and are confirming a sizable number transactions.
That isn't actually the choice being made here-- tiny blocks are created even when there is plenty of reasonably high fee paying backlog.

Quote
When a 100 kb block is solved, 900 kb of capacity was not just lost. The miner responsible introduced 100 kb of capacity. Not 1 mb, but still a lot more than zero. Mining is all probabilistic, remember. The block could never have been solved at all, and the mempool would be 100 kb bigger as a result.
At an instant this is true, but the empty block still serves to increase the difficulty and reduce the rate of block finding in the next interval. If it happens on an ongoing basis it does reduce capacity.

Quote
Even if a block has no transactions at all other than the coinbase - which does not happen a lot nowadays except in some technical cases - the block is still improving the integrity of the block chain, giving recently confirmed transactions and blocks another confirmation, and introducing 12.5 BTC to most likely many people at once (enthusiasts like you and me). It is not by any means a waste and should not be considered unwelcome or inappropriate.

Unfortunately the parties producing small blocks do so because they haven't validated the prior block. So they add only a false confirmation and erode the security of lite clients rather than contributing to security as empty blocks did in prior years before this practice became common.