Comment
Author: Admin | 2025-04-28
Chain (known as a 51% Attack). As a result, the combined effort of miners coordinating to extend the same chain protects existing blocks and transactions from being replaced by a single miner. Think of it as a cooperative effort to make a chain. Satoshi Nakamoto, bitcointalk.org FAQWhy do miners choose to build on the longest chain?Because a miner can claim a block reward if they are able to mine a block.However, the bitcoins from this block reward can only be spent if the block becomes 100 blocks deep in the longest chain. Therefore, this block reward incentivizes miners to always try and mine new blocks that will become part of the longest chain (by always trying to build on to the current longest one). A block reward can only be spent if the block is part of the longest chain. Miners initially claim the block reward through the coinbase transaction.What happens to transactions that are not part of the longest chain?A transaction inside a block that is not part of the longest chain is invalid.If you try to spend the outputs from a transaction that is not in the longest chain, nodes would not accept this new transaction nor try to mine it into a block. This is because nodes only consider the longest chain as the valid history of transactions, and anything outside of that is not a valid transaction. The outputs in a transaction not in the longest chain are unspendable. So only the transactions inside the longest chain are considered to be part of the valid transaction history, and any transactions outside of it effectively never took place.I recommend that you wait for a transaction to make it to 2 or more blocks deep into the blockchain before you consider bitcoins to be "yours". There is always a chance that the topmost blocks in the blockchain could change due to a chain reorganization, making previously valid blocks and transactions invalid.CommandsYou can find the chainwork values for yourself using these bitcoin-cli commands: bitcoin-cli getblockchaininfo See the total chainwork for the current longest chain. $ bitcoin-cli getblockchaininfo{ "chain": "main",
Add Comment