58

What is a Project Fork? A fork in software development refers to the event of an independent project spinning off from a software project. Such forks sometimes occur in the opensource sphere, when there are irreconcilable plans/goals within a project's community, then often leading to a split in the community and two distinct projects thereafter. In ...


40

Bitcoin Cash (aka Bitcoin ABC aka UAHF) provides two methods of replay protection, both of which are opt in. If you do not create transactions which use these features, then your transactions are vulnerable to replay. The first method is a redefined sighashing algorithm which is basically the same as the one specified by BIP 143. This sighash algorithm is ...


31

Softforks are forwards-compatible Old nodes will accept blocks created by new nodes. With a softfork, only miners will have to upgrade, or else they will end up on the losing fork. Users and merchants can keep running older nodes, which will accept the newer blocks. Hardforks are not forwards-compatible Old nodes may not accept blocks created by new ...


28

Yes, it is possible, and you can actually follow "orphaned blocks" here: https://blockchain.info/orphaned-blocks Bitcoin clients always trust the longest chain, so if two blocks is mined on the same time, it's up to (51% of) the miners to decide which is going to be 'accepted' and which is going to be worthless. This is one of the reasons why you shouldn't ...


23

Gary's answer is not entirely correct. When comparing two chains, their total "scores" are compared. Each block counts as (2^256 / block_target); this is the expected/average number of attempts that were necessary to create it. Obviously, within one series of 2016 blocks, the difficulties are all equal, so for most small reorganizations, the score will tell ...


21

Simply put, a so-called hard fork is a change of the Bitcoin protocol that is not backwards-compatible; i.e., older client versions would not accept blocks created by the updated client, considering them invalid. Obviously, this can create a blockchain fork when nodes running the new version create a separate blockchain incompatible with the older software. ...


18

I found the best exact definition in the First three paragraphs here: gavinandresen / BitcoinVersioning We recently rolled out two changes to the Bitcoin block acceptance rules (BIP16 and BIP30); this document records the lessons learned and makes recommendations for handling future blockchain rule changes. Note: there are "soft" rule changes and ...


17

Short answer: 4 [Prior to the March 12, 2013 fork] The Value Overflow incident seems to be the longest ever blockchain split. The problem with blockchain forks is that once they are resolved the only trace they leave is a log entry. To reconstruct the following I used the printblocktree output that theymos gave me in this question and the information from ...


14

A hard fork is by definition one that does not get solved. At least not by the rules of the system, as it is essentially an incompatibility between the rules assumed by separate nodes. But think about what can cause such a thing: An incorrect (=not identical to the rest of the network) implementation forks off. In this case it will always certainly be ...


13

The March 12, 2013 blockchain fork started with 225430 and so far has reached block 225461, so it is 31 blocks long. Some of those were mined long after the fork supported by v0.7 clients had regained longest chain. At the peak the fork which supported by v0.8 clients was at least a dozen blocks higher meaning transactions that had more than ten ...


12

There are two problems with this: The "longest" block chain is selected not by total number of blocks, but by total difficulty. A chain with a large number of low-difficulty blocks would not win. The Bitcoin reference client hard-codes the hashes of a relatively recent block as a "checkpoint" and will reject any chain not containing that block at the ...


11

On July 29 2010, it was discovered that block 71036 contained several transactions with a ton of OP_CHECKSIG commands. There should only ever be one such command. This caused every node to do extra unnecessary work, and it could have been used as a denial-of-service attack. A new version of Bitcoin was quickly released. The new version did not cause a fork ...


11

Your assumptions are perfectly right. Since there is no information exchange between the two partitions while the network is partitioned, and Bitcoin guarantees liveness, the global consistency suffers (see CAP Theorem). This means that each partition will have its own blockchain fork, unaware of each other. The forks are incompatible not just because the ...


10

The "longest" chain is the one with the most work. A chain's work is equal to the expected number of hashes it would take for someone to replicate a chain of the same number of blocks and the exact same difficulty steps. So currently each block adds about 266 work to the chain because it takes on average ~266 hashes to solve a block with the current ...


10

If you have 1 Bitcoin (BTC) before the hard fork, you will have 1 Bitcoin (BTC) and 1 Bitcoin Cash (BCC) after the hard fork. Whether you can spend those BCC depends on who has control of your private keys. If you currently keep your BTC on an exchange (Coinbase, GDAX, Poloniex, ...) you need to check their policy w.r.t. the fork, since they control your ...


10

What is a transaction replay In the context of forks, transaction replay is when a transaction is valid on both sides of the fork. So a transaction can be played (i.e. broadcast) on both chains after the fork and be a valid transaction and confirm. This means that if you intend on sending coins on one fork, you could accidentally end up sending your coins ...


9

The power to dissent over changes that causes existing clients to reject a block does lie disproportionately with miners. Any change that causes existing clients to consider a block invalid is useless until the majority of miners update. Miners who consider the block invalid will never attempt to build on a chain that includes any such blocks. So until a ...


9

When there's a fork, part of the network will mine to find the next block in one branch and part in the other branch. Whichever part finds the next block first will determine the winning branch. A miner who finds a block will want to spread it widely and quickly. This makes sure there are many other miners who saw his block first, and thus a high ...


9

My question then is: why doesn't bitcoin specify a maximum duration of time and/or a maximum number of confirmations, after which a competing/forking block is rejected even if it's backed by a longer chain of (secretly premined) child blocks? Because you can't prove that to nodes that weren't on the network at the time of the attack. Which means that either:...


9

You can use the invalidateblock RPC commands to create blockchain forks. invalidateblock hash tells a node to consider hash invalid, so just generate a bunch of blocks, invalidate one somewhere down the chain on one of the regtest nodes, and have that node generate a bunch more to create a fork. See qa/rpc-tests/mempool_resurrect_test.py in the Bitcoin ...


9

SPV mining is the term commonly used for 'less-than-full-node-validation' mining. It usually means that miners skip the verification of the block and the transactions within, and immediately start mining a new block referencing the just-solved block header. However, since they don't know what is in the last block, they have to mine without any transactions (...


9

Yes Coinbase has not mentioned supporting Bitcoin Gold or Not so to be safe definitely move your BTC to a wallet so you have control of your private keys. On Oct 25th the fork will happen and on November 1st you will be able to access your BTG Bitcoin Gold by using your private keys. Here is a video explaining this better... https://www.youtube.com/watch?v=...


9

For one, Litecoin is not a fork of Bitcoin. It relies on the same base code, but it is a separate network, and they do not share the genesis block. Bitcoin Cash is a true fork of Bitcoin, in the sense that they can be traced back to the same genesis block. Both chains continue to exist as they follow different consensus rules. Blocks on the bitcoin Cash ...


8

Gavin Andreson has tweeted this: https://twitter.com/gavinandresen/status/311290936527298561 The bitcointalk post linked by Gavin is a post by Peter Wuille, which says this: Hello everyone, there is an emergency right now: the block chain has split between 0.7+earlier and 0.8 nodes. I'll explain the reasons in a minute, but this is what you need to know ...


8

The question is too speculative to answer. The groups could institute whatever rules they want. If you assume there's a group that's willing to modify the software to create a permanent fork, presumably they are doing so for some reason. And whatever that reason is, that will affect what changes they make that cause the fork. They could decide to allow ...


8

What you are describing there is a client that is a hybrid of Bitcoin and something else. For instance there is nothing to stop you starting ManishCoin and writing a ManishBitcoinSuperClient. If you can get enough people to believe in ManishCoin then it becomes a useful currency.


8

First, a quick clarification: assuming two chains both have valid blocks, it's the chain with the most proof of work that wins, not necessarily the chain with the most blocks. Second, thanks for the psuedocode. It's always nice answering a question written in clear code. The answer is that we want nodes to be able to agree on the best block chain based ...


8

Note that the word "fork" can have several meanings. The more common one is a protocol change (either a soft or hard fork) where everyone switches to the new protocol. In this case there will still be only one type of coin. You are talking specifically about a scenario where both the new and old versions are being used. In this case the network and the ...


7

You would be able to spend your bitcoins twice - once on each branch. The independent branches have no way of telling whether pre-fork bitcoins have already been spent on the other branch. This only applies to bitcoins that you received prior to the fork event. If you receive bitcoins after the fork event you have to choose one or the other.


7

Background info: Strongest vs Longest chain and orphaned blocks How does a client decide which is the longest block chain if there is a fork? Where exactly is the "off-by-one" difficulty bug? (timewarp info) A shorter chain could possibly be considered the correct one, but it would be very hard to make this happen in bitcoin. I can think of two ...


Only top voted, non community-wiki answers of a minimum length are eligible