Author

Topic: Spending At The Same Time? (Read 604 times)

jr. member
Activity: 55
Merit: 2
February 14, 2014, 02:07:42 PM
#6
One of the two transactions will arrive before the other at each node.  Each node will reject the second one to arrive.
Eventually one of the transactions (you can't predict which I guess) will arrive at a miner and be included in the blockchain.  Once that happens the other will be ignored by nodes.

Very good answer.

Here is one where the answer isn't quite as obvious.

Same exact question, except instead of sending 6 BTC, the two people both send 4 BTC?

(I'm aware of the answer to this question.  I'm just posting it to provoke some thought in people who might think they know what will happen.  The true experts will get it right, but many people who think they know the answer will be surprised when they read the actual answer)

That depends on how the initial 10BTC was distributed among the unspent outputs. If the whole 10BTC is just one unspent output then only one transaction can be confirmed no matter how little they send. But suppose there's 2 unspent outputs of 5BTC each and the two people each send 4BTC from a different unspent output then both can be confirmed.

But if both people use the same wallet-software and create their transaction at the same time (or at least before their wallet-software becomes aware of the transaction created by the other), both copies of the software will select the same unspent output(s) to create the transaction and it will still double-spend.

That's correct. The only way both transactions can go through is if the two people coordinate ahead of time to select disjoint unspent output(s) and push Tx manually.
hero member
Activity: 728
Merit: 500
February 14, 2014, 02:03:46 PM
#5
One of the two transactions will arrive before the other at each node.  Each node will reject the second one to arrive.
Eventually one of the transactions (you can't predict which I guess) will arrive at a miner and be included in the blockchain.  Once that happens the other will be ignored by nodes.

Very good answer.

Here is one where the answer isn't quite as obvious.

Same exact question, except instead of sending 6 BTC, the two people both send 4 BTC?

(I'm aware of the answer to this question.  I'm just posting it to provoke some thought in people who might think they know what will happen.  The true experts will get it right, but many people who think they know the answer will be surprised when they read the actual answer)

That depends on how the initial 10BTC was distributed among the unspent outputs. If the whole 10BTC is just one unspent output then only one transaction can be confirmed no matter how little they send. But suppose there's 2 unspent outputs of 5BTC each and the two people each send 4BTC from a different unspent output then both can be confirmed.

But if both people use the same wallet-software and create their transaction at the same time (or at least before their wallet-software becomes aware of the transaction created by the other), both copies of the software will select the same unspent output(s) to create the transaction and it will still double-spend.
jr. member
Activity: 55
Merit: 2
February 14, 2014, 01:57:18 PM
#4
One of the two transactions will arrive before the other at each node.  Each node will reject the second one to arrive.
Eventually one of the transactions (you can't predict which I guess) will arrive at a miner and be included in the blockchain.  Once that happens the other will be ignored by nodes.

Very good answer.

Here is one where the answer isn't quite as obvious.

Same exact question, except instead of sending 6 BTC, the two people both send 4 BTC?

(I'm aware of the answer to this question.  I'm just posting it to provoke some thought in people who might think they know what will happen.  The true experts will get it right, but many people who think they know the answer will be surprised when they read the actual answer)

That depends on how the initial 10BTC was distributed among the unspent outputs. If the whole 10BTC is just one unspent output then only one transaction can be confirmed no matter how little they send. But suppose there's 2 unspent outputs of 5BTC each and the two people each send 4BTC from a different unspent output then both can be confirmed.
legendary
Activity: 3472
Merit: 4801
February 14, 2014, 10:42:44 AM
#3
One of the two transactions will arrive before the other at each node.  Each node will reject the second one to arrive.
Eventually one of the transactions (you can't predict which I guess) will arrive at a miner and be included in the blockchain.  Once that happens the other will be ignored by nodes.

Very good answer.

Here is one where the answer isn't quite as obvious.

Same exact question, except instead of sending 6 BTC, the two people both send 4 BTC?

(I'm aware of the answer to this question.  I'm just posting it to provoke some thought in people who might think they know what will happen.  The true experts will get it right, but many people who think they know the answer will be surprised when they read the actual answer)
sr. member
Activity: 362
Merit: 262
February 14, 2014, 05:40:17 AM
#2
One of the two transactions will arrive before the other at each node.  Each node will reject the second one to arrive.
Eventually one of the transactions (you can't predict which I guess) will arrive at a miner and be included in the blockchain.  Once that happens the other will be ignored by nodes.
newbie
Activity: 4
Merit: 0
February 13, 2014, 08:32:05 PM
#1
  • There is a Bitcoin wallet containing 10 Bitcoin.
  • Two people on two separate computers open the Bitcoin wallet simultaneously.
  • They spend 6 Bitcoin from the wallet.
  • They hit the Send button simultaneously
  • They have set up the timing and positioning so that they are the same time/distance from the nearest Bitcoin node (I know this is silly, but this was the hypothetical presented to me)

What would happen?

My friend asked me what would happen in this situation and I think I know what the answer is, but I thought I'd confirm with the community, so I can say that I heard the answer from other people as well. Gotta be able to answer newcomer questions, if we want Bitcoin to be successful, even silly or weird ones. Tongue
Jump to: