Suppose Alice wants to add a fake transaction where she receives X ammount of BTC. I understand that in order to add that transaction to the blockchain she would have to compete against all the other miners to generate the next block, which makes it improbable to happen as an individual against them.
No, that isn't correct. No matter how much mining power she has, or how many miners she cooperates with, she can't add a fake transaction to the blockchain.
It's a common misconception that miners are solely responsible for determining whether or not a transaction is valid, and if they say it is, then everyone else accepts it. In fact, anyone who runs a Bitcoin full node (e.g. Bitcoin Core) is automatically checking whether each transaction is valid (spends money from a previous valid and unspent transaction, properly signed, etc). If a miner attempts to include an invalid transaction in a block, this will be detected and their entire block will be ignored by everybody, effectively meaning that they don't get their mining reward.
With enough mining power, or the cooperation of a pool, Alice could create a block with her fake transaction. But nobody in the world will consider it as valid or accept it as part of the blockchain. If she tries to spend the proceeds of that transaction, say by sending those coins to Bob in exchange for some goods, Bob's software will simply ignore it. He'll think that Alice just hasn't paid at all, and won't send her any goods. So the whole exercise would be a giant waste of Alice's time and resources, without gaining her anything or harming anyone else.
The only special authority that miners have is this: if there are two or more otherwise valid transactions which are in conflict with one another, then miners get to decide which one (or none) goes into the blockchain, thus confirming it. But they can't confirm a transaction that was never valid in the first place.
A large amount of mining power, or a pool, could help Alice perform a double spend attack, where a valid and confirmed transaction is later replaced in the blockchain with a different valid transaction. The first one might have gone to Bob, who would have sent some goods, and the second one could effectively take the money back from Bob and return it from Alice, who now has the money and the goods. But the second transaction is one that Alice could have created all along (of course she can send her own money to herself); it isn't "fake".
What do you mean by "if there are two or more otherwise valid transactions which are in conflict with one another". Also, i understand it know that the fake transaction would be invalid if they come from another account but, would that apply to altering the reward too? What would be the invalid part of this last transaction? – jscherman – 2018-06-11T04:38:13.277
4
@jscherman: For example, say Alice has received 1 bitcoin. She could create a transaction which sends it to Bob (spending the specific unspent output from the transaction sent to her). Or she could create a transaction that sends it to Charlie. Either of these by itself would be fine. She could also create both, but only one of them can go in the blockchain, since the blockchain is forbidden to contain two transactions spending the same output.
– Nate Eldredge – 2018-06-11T05:07:46.030If she puts both transactions on the peer-to-peer network, more or less simultaneously, then miners will decide which of the two gets confirmed; whether Bob gets paid or Charlie does. – Nate Eldredge – 2018-06-11T05:08:22.900
@jscherman: Re your second question, in the case of a "coinbase" transaction which pays out a miner's rewards, one of the checks done by every full node is that the amount of the reward is appropriate given the reward schedule specified by the protocol. If not, they consider the block invalid and ignore it. – Nate Eldredge – 2018-06-11T05:10:53.270
If you mean to take an existing block and alter who the reward is paid to, this will be noticed because a hash of the transaction is (indirectly) in the block header. And if you change the header then the proof-of-work doesn't match and you'll have to redo the work to mine the block, so you don't gain anything. – Nate Eldredge – 2018-06-11T05:12:00.653
1This answer seems to reaffirm that btc.com cannot create fake transactions, but it begins with "everybody detects fakes immediately, hence none can be inserted". I think it would be very much improved if the mechanism by which fakes are detectable was explained. – AnoE – 2018-06-11T20:10:34.477
@AnoE: I added some links where you can read more about the exact checks that are done. – Nate Eldredge – 2018-06-11T21:40:41.767