Is the first transaction picked up and the second dropped? or are both dropped? or are the btc lost for ever? Thanks!
The context is important here.
Most mining occurs using the Bitcoin-Qt/bitcoind client which will reject any double spend attempts. So it is the first transaction to reach the miner is the one that gets included in a block.
So how a "race attack" double spend works is if the attacker knows your IP address and you take incoming connections, the attacker has one node shoot a spend transaction to you. Then at the very same time the attacker has another node shoot another spend transaction to the rest of the network. The attacker's aim is to have you see the transaction (0/unconfirmed), then you hand over the cash or whatever reason the coins were sent, and then only later when the mined block arrives would you realize that the funds were double spent. There are protections against that (don't allow incoming transactions, for outgoing you have an explicit connection to well-connected nodes. Additionally, even if you do accept incoming, you can check the rest of the network (e.g.,blockchain.info being one source) before handing over any value to see if any double spend transactions were broadcast.
That's the typical race attack. There's also the Finney attack, the 51% attack, and others.
-
http://en.bitcoin.it/wiki/Double-spendingWhat is the context in which you are asking?