Author

Topic: How would an exchange handle a reorg? (Read 1017 times)

sr. member
Activity: 658
Merit: 250
January 30, 2015, 11:47:01 AM
#15
Quite unlikely for this to happen. But it is possible, any reputable exchange should have enough funds to cover any loses in such scenario.
legendary
Activity: 3388
Merit: 4615
January 30, 2015, 11:44:28 AM
#14
Well bitcoin is somewhat principled on libertarian values which includes anonymity.

Other libertarian values are personal responsibility and suffering the consequences of your actions when your decisions lead to loss that you are not prepared for.
sr. member
Activity: 306
Merit: 250
January 29, 2015, 11:41:19 PM
#13
I think that debt collection is difficult for a lot of exchanges that do not require identity verification like bitfinex, btc-e and LBC (although technically not an exchange however the same principle applies). To my knowledge they all accept connections via anon proxies so all they would really have to go on is an email address, and it would not be difficult to create a new account if a reorg caused their account to "go negative". If a person's identity is not tied to their exchange account then I would doubt that many people would redeposit funds back into their account

If they choose to take on such a risk, that is their business.  It is up to the business to protect their financial interests.
Well bitcoin is somewhat principled on libertarian values which includes anonymity. Both when Gox (a very long time ago) and bitstamp (more recently) started requiring their customers to provide identity documents before they can withdraw even bitcoin, people made a big fuss about it.

I don't however think the risk for a reorg is very large, and the chances of a lot of any given exchange's customers withdrawing their entire balance at a time when a reorg would cause losses is probably even greater.   
legendary
Activity: 3388
Merit: 4615
January 29, 2015, 11:16:11 PM
#12
I think that debt collection is difficult for a lot of exchanges that do not require identity verification like bitfinex, btc-e and LBC (although technically not an exchange however the same principle applies). To my knowledge they all accept connections via anon proxies so all they would really have to go on is an email address, and it would not be difficult to create a new account if a reorg caused their account to "go negative". If a person's identity is not tied to their exchange account then I would doubt that many people would redeposit funds back into their account

If they choose to take on such a risk, that is their business.  It is up to the business to protect their financial interests.
legendary
Activity: 1176
Merit: 1001
January 29, 2015, 08:40:36 PM
#11
Say someone deposits 10 BTC, with 6 confirmations and immediately places a sell. Someone else buys them and withdraws quickly.
After sometime a reorg invalidates the initial 10 BTC tx.
Orphaning 6+ blocks is very unlikely.
Orphaning 6+ blocks AND not including an initial transaction of 10 BTC in the new chain is extremely unlikely.

Quote
What is the right way to handle this?
For the withdraw transaction, the exchange spends the same coins that came from the initial deposit (the transaction is built with the same outputs). So even if (and that's a huge if) the blockchain part with the 10 BTC becomes orphaned, and doesn't end up in the new chain, thus basically deleting the 10 BTC deposit from history, then so will the 10 BTC withdrawal.
sr. member
Activity: 306
Merit: 250
January 29, 2015, 08:32:24 PM
#10
- snip -
After sometime a reorg invalidates the initial 10 BTC tx. What is the right way to handle this?

A re-org would not necessarily "invalidate" the initial 10 BTC tx.  It is quite possible that the transaction was confirmed on both chains and therefore the re-org has no effect on the transaction at all.  It is also possible that the transaction was not yet confirmed on the new chain, but that it is still valid.  In that case it would eventually be re-confirmed on the new chain, and the exchange would suffer no adverse effects at all.

However, there is a possibility that the transaction (and other transactions that the exchange both sent and received) are invalid on the new chain.  In this case, the exchange would be expected to re-compensate anybody that they sent transactions to which are not confirmable on the new chain.  The exchange would lose any funds that were sent to them which became invalid on the new chain.  They could attempt to contact those users and request that the user re-send the missing funds.  They could engage in debt collection processes against anybody that didn't re-send the missing funds.  Hopefully the exchange has calculated this risk and adjusted the pricing of their service to ensure that they have enough revenue to survive any loss experienced.  They might also attempt to acquire an insurance policy that would compensate them for such losses.
I think that debt collection is difficult for a lot of exchanges that do not require identity verification like bitfinex, btc-e and LBC (although technically not an exchange however the same principle applies). To my knowledge they all accept connections via anon proxies so all they would really have to go on is an email address, and it would not be difficult to create a new account if a reorg caused their account to "go negative". If a person's identity is not tied to their exchange account then I would doubt that many people would redeposit funds back into their account
legendary
Activity: 3388
Merit: 4615
January 28, 2015, 09:57:59 AM
#9
- snip -
After sometime a reorg invalidates the initial 10 BTC tx. What is the right way to handle this?

A re-org would not necessarily "invalidate" the initial 10 BTC tx.  It is quite possible that the transaction was confirmed on both chains and therefore the re-org has no effect on the transaction at all.  It is also possible that the transaction was not yet confirmed on the new chain, but that it is still valid.  In that case it would eventually be re-confirmed on the new chain, and the exchange would suffer no adverse effects at all.

However, there is a possibility that the transaction (and other transactions that the exchange both sent and received) are invalid on the new chain.  In this case, the exchange would be expected to re-compensate anybody that they sent transactions to which are not confirmable on the new chain.  The exchange would lose any funds that were sent to them which became invalid on the new chain.  They could attempt to contact those users and request that the user re-send the missing funds.  They could engage in debt collection processes against anybody that didn't re-send the missing funds.  Hopefully the exchange has calculated this risk and adjusted the pricing of their service to ensure that they have enough revenue to survive any loss experienced.  They might also attempt to acquire an insurance policy that would compensate them for such losses.
sr. member
Activity: 860
Merit: 423
January 28, 2015, 09:15:32 AM
#8
Say someone deposits 10 BTC, with 6 confirmations and immediately places a sell. Someone else buys them and withdraws quickly.
After sometime a reorg invalidates the initial 10 BTC tx. What is the right way to handle this?

First of all, it is a rarest of the rare situation.

Even if it happens, both seller and buyer's Tx gets cancelled. Exchange needs to work with bank to revert the FIAT paid to the seller.
legendary
Activity: 896
Merit: 1000
January 28, 2015, 12:54:24 AM
#7
I've just looked it up, and unless the info I found is outdated, the longest such orphaned chain was 4 blocks (March 2013): http://bitcoin.stackexchange.com/questions/3343/what-is-the-longest-blockchain-fork-that-has-been-orphaned-to-date
That non-canonical chain was mined on for some time by clients that were not updated, so it grew longer but never became the "official" chain again.

4 blocks?  Not even close Tongue there was an unintentional hardfork that went of for over 30 blocks back in March 2013.  That was exciting!


http://mineforeman.com/2013/03/14/what-the-fork-was-that-a-forking-post-mortem/
legendary
Activity: 1008
Merit: 1000
January 28, 2015, 12:42:27 AM
#6
there are 2 possible things that could happen

1. all transaction that done during that reorg(including deposit and withdrawal) will need to be resent so in this case withdrawal of 10BTC will also not happen in real

and second that most people thinking are now is exchange will loss that money (10 BTC)  Tongue
legendary
Activity: 1001
Merit: 1003
January 28, 2015, 12:10:30 AM
#5
Additionally the buyer who quickly withdrew his 6 BTC would have now not received his bitcoin to his address (due to the reorg)

That's not necessarily true. If the exchange used different sets of coins for the withdraw transactions and those were not affected by the reorg, it could still be possible (I think).

sr. member
Activity: 306
Merit: 250
January 28, 2015, 12:01:55 AM
#4
Say someone deposits 10 BTC, with 6 confirmations and immediately places a sell. Someone else buys them and withdraws quickly.
After sometime a reorg invalidates the initial 10 BTC tx. What is the right way to handle this?
The exchange would likely be having problems if this were to happen 6 confirmations in. It is my understanding that this type of thing will generally not affect any transactions more then 2 blocks deep.

As mentioned above, if this were to happen then the exchange would need to bite the bullet on the 10 BTC, although they could in theory take the funds the seller received. Additionally the buyer who quickly withdrew his 6 BTC would have now not received his bitcoin to his address (due to the reorg)
legendary
Activity: 4298
Merit: 3209
January 27, 2015, 01:21:23 PM
#3
Say someone deposits 10 BTC, with 6 confirmations and immediately places a sell. Someone else buys them and withdraws quickly.
After sometime a reorg invalidates the initial 10 BTC tx. What is the right way to handle this?

A transaction with 6 confirmations is not likely to be invalidated, but it would be a major hassle for the exchange. The exchange would lose 10 BTC unless the sender pays again. It is possible that some withdrawals or other transactions would then be invalidated and those would have to be paid again.
legendary
Activity: 1039
Merit: 1003
January 27, 2015, 01:19:22 PM
#2
With "reorg" you mean a long chain that becomes orphaned?
I've just looked it up, and unless the info I found is outdated, the longest such orphaned chain was 4 blocks (March 2013): http://bitcoin.stackexchange.com/questions/3343/what-is-the-longest-blockchain-fork-that-has-been-orphaned-to-date
That non-canonical chain was mined on for some time by clients that were not updated, so it grew longer but never became the "official" chain again.

So more than 6 blocks should be a rather rare event. I suspect that exchanges should have fork alarm mechanisms in place that allow them to stop emitting and accepting transactions when there is a reasonable expectation that a fork may happen.
If they don't, they will probably negotiate with their users about how to handle BTC deposits and withdraws that are invalidated due to the fork. There is no defined "right" way to handle this, as neither the exchange nor the customer can be made responsible for the failed transactions.

Onkel Paul
legendary
Activity: 1001
Merit: 1003
January 27, 2015, 01:05:51 PM
#1
Say someone deposits 10 BTC, with 6 confirmations and immediately places a sell. Someone else buys them and withdraws quickly.
After sometime a reorg invalidates the initial 10 BTC tx. What is the right way to handle this?
Jump to: