Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I just started to study blockchain and bitcoin yesterday and came up with some questions.
If miners can select transactions when creating a block, how is it ensured that all the transactions over every 10 minutes are recorded? For example, if a miner selected only a half of all the transactions over 10 minutes and found a valid hash, how can the other half of the transactions be recorded?
The answer to the first question might render this question unnecessary, but if miners can select transactions when creating a block, how is it ensured that the first one didn't include any invalid transactions over the 10 minutes?
Also, why is only the first one to find a valid hash rewarded while the first one might have left out some transactions during selection (although an answer to Q1 might render this worry unnecessary)? Is there any security reason behind choosing the first one? For example, is the first one considered to be the most trustworthy because it takes time to make invalid modifications on previous/current transactions?
The fourth question came out while I was watching 19:43~ of the following video:https://www.youtube.com/watch?v=bBC-nXj3Ng4. It is understandable that Alice will fail to cheat because Alice can't create invalid blocks faster than the rest of the miners. However, what if Alice broadcasted the first invalid block to every other miner? In that case, wouldn't all the other miners find next blocks based on the assumption that Alice's first invalid block is valid so that Alice wouldn't have to exceed all the other miners every time?
Thank you.
It is not ensured. Miners can run any software they want to determine which transactions to include in a block. The game theory makes censorship hard however: it only takes one miner to include a transaction in a block for it to become valid. If a given transaction is not "selected" for a block, it remains in the mempool, a collection of unconfirmed (not in a block) transactions.
This verification is exactly what nodes do. Whenever nodes receive a new block, they verify the signatures and validity of every single transaction in that block, including whether or not the coins each transaction attempts to spend are spendable. The linear nature of the blockchain ensures that there all transactions are objectively valid or invalid at certain block heights/times.
No one chooses the "first" one to find a valid hash. The valid blockchain is the chain which includes the most work. For simplicity's sake, this is almost always the chain with the greatest number of blocks in it. When a miner finds a valid hash, they publish their block and all other miners accept it (assuming its valid) and mine on top of that block. Only one miner gets the reward for that block, but other miners hope to get rewards by finding subsequent blocks.
See #3. Blocks are not valid/invalid based on the time they were mined. The longest chain is always valid, even if a shorter chain has blocks that were mined before the blocks in the longer chain. Read more here: What Is Proof-of-Work?
You can get bonuses upto $100 FREE BONUS when you:
๐ฐ Install these recommended apps:
๐ฒ SocialGood - 100% Crypto Back on Everyday Shopping
๐ฒ xPortal - The DeFi For The Next Billion
๐ฒ CryptoTab Browser - Lightweight, fast, and ready to mine!
๐ฐ Register on these recommended exchanges:
๐ก Binance๐ก Bitfinex๐ก Bitmart๐ก Bittrex๐ก Bitget
๐ก CoinEx๐ก Crypto.com๐ก Gate.io๐ก Huobi๐ก Kucoin.
Comments