Summary
A user would register transactions with the proposed service that would move coins from one wallet to another (safe) wallet. In the event that the service notices an attempt to empty the contents of the wallet, the saved transaction would be broadcast in an attempt to move the coins to safety before the wallet could be emptied.
How do you define emptying the wallet? What if I have $500 and want to spend $200 of it? Also, a "saving" transaction might not work if the attacker pushed a higher fee tx to the miners. Even if they didn't push to the miners, if they broadcast a transaction stealing your entire wallet, then you would somehow have to make your "saving" transaction be put in a block instead of theirs which was broadcast first.
Questions
- Is there any way to make a transaction that sends the entire contents of the wallet, rather than a fixed coin amount?
Not unless you keep remaking the transaction.
- If a miner sees two transactions that cause a double-spend, does it always only include the one with the earlier timestamp? If so, then maybe this is a non-starter (other than trying to ensure the service is better connected in the network)
The miner will do whatever his software choses to do. The smart thing for the miner is to include the higher fee tx. The network will not relay a double-spend though, so you need to push it directly to miners.
- If the "emergency eject" has a higher fee would it have a better chance of getting included in the block even it was later?
If it reaches the miners, yes.
- Is it possible to know that the transaction was broadcast by the service? If so, then with the acceptance by the mining community to prefer the eject transactions, the service becomes much more valuable and effective.
You could send it directly to the miners, but most miners/pools go by monetary incentives and not ethics *cough* GHash *cough*.