62

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 ...


44

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 ...


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 ...


15

One might think that the network maintaining the same consensus rules would be considered the original, and the project introducing a consensus rule change and thus creating a new network would be considered the derivative, but you've already pointed out an exception to that rule with the ETH DAO fork. Various arguments can be made why one or the other ...


14

What Nicolai said is not completely right. The network would decide which one is the main chain according to the following block mined. Let's assume that block A and B are mined at almost the same time. The miners would accept the first block that was broadcast to them, so there would be some miners accept A and others accept B, it doesn't matter whether A/B ...


13

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 ...


12

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 ...


11

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 (...


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

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 ...


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

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

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

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

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

No, there is no consensus until the next block is found. The network is experiencing a blockchain-fork. It will only mend once one of the tips pulls ahead by adding another block. Then all nodes will reorganize to the longest chain and consensus is reestablished. The losing chain becomes an extinct branch – valid but not part of the longest chain. There can'...


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

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 ...


7

You're looking for CBlockIndexWorkComparator, which operates by three rules. The rules are applied one at a time, and if a rule leads to a tie, then the next rule is applied. Which blockchain has the most work? Which one was received first? (This can be different for different clients, which is why the previous rule is applied first.) Which one has a ...


7

Actually, it is not related to the difficulty at all, rather just related to the expected time until the next block is found. Block finding is a Poisson process. The probability of x blocks occuring in the amount of time we'd expect λ blocks occuring therefore is: In ideal conditions, we expect one block per ten minutes, i.e. 600 seconds. Therefore ...


7

A hard fork is something that happens when some of the nodes on the network follow a new set of rules that are in some way incompatible with the existing set of rules. It occurs upon mining the first block that is valid under the new rules, but invalid under the old. The software following new rules is deployed and in place before the fork occurs, but ...


7

If you didn't move out your BTC before the fork, then your BitCoin Cash tokens remain with CoinBase. They are not really lost, but they might remain in their system for a while. Here is the explanation directly from CoinBase Support: We are planning to have support for bitcoin cash by January 1, 2018, assuming no additional risks emerge during that time. ...


7

I don't believe any replay protection has yet been implemented, they still have an issue open for it on the BitcoinGold repository here: https://github.com/BTCGPU/BTCGPU/issues/51 I haven't dug into the code itself but I would imagine that they would have closed the issue if they had implemented something. The statement by Bittrex also claims that they ...


7

There is this list on Wikipedia: https://en.wikipedia.org/wiki/List_of_Bitcoin_forks Bitcoin Cash (Forked at Block 4785591, 1 August 2017) Bitcoin Gold (Forked at Block 491407[2], 24 October 2017) Bitcoin Diamond (Forked at Block 495866[3], 24 November 2017) UnitedBitcoin (Forked at Block 498777[4], 12 December 2017) BitcoinX (Forked at Block ...


7

In theory it can as the explicit consensus rules have not changed. However in practice, it will not be able to sync without some special modifications. First of all, the network version is so old that no modern node software will accept connections from it. Furthermore, the format of the network messages has changed since the first release so that it now ...


6

You've described it very accurately. When there's a protocol change that not everyone adopts, you'll have essentially two different currencies, with any coin in the original currency turning into a coin in each of the new block chains. The total value of the coins in both chains will be roughly equal to the total value of the coins in the original currency. ...


6

No, there isn't currently any way to do what you describe without using a third-party oracle. Yes, you may be able to do this relatively soon. A soft fork has been proposed to introduce a OP_CHECKLOCKTIMEVERIFY op code` (CLTV), and what what I can tell it has strong support from the core dev team (but note that soft forks require miner support for ...


6

So which is it? Does "hard fork" describe a condition of the network, or a software update? Either is acceptable. You can say that version so-and-so causes a fork, and you can say that the network is currently forked. Was the March 2013 fork a hardfork? It depends on your definition. The March 2013 incident initially appeared to be a hard-fork, but a ...


6

I'm not an economist, but… No, that's very unlikely. Starting from your assumption that the network splits into two persisting blockchains*: The number of active participants of each network is reduced. This reduces the utility of the network. → Negative effect on the value. The amount of transactions that can be sent increases. This improves the utility ...


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