Hi all,
While trying to understand how Bitcoin operates under the hood, I was wondering if it's not dead easy to cheat (in Bitcoin).
Suppose we have Alice and Bob, you may know them, and Alice wants to send 10 BTC to Bob. Suppose both have a Bitcoin client (
https://en.bitcoin.it/wiki/Clients) running on their device. From what I understand, a client is build upon Bitcoin core. Bitcoin core contains all protocol rules (
https://bitcoin.org/en/developer-guide), such as transaction and block rules (
https://en.bitcoin.it/wiki/Protocol_rules).
Now, in short, if Alice wants to send Bob 10 BTC, her client verifies the transaction (tx message:
https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages), the client broadcasts the transaction to peers/miners, who add the transaction into their block they're about to mine. The miner itself also performs a check (block message:
https://en.bitcoin.it/wiki/Protocol_rules#.22block.22_messages). If Alice wants to cheat (e.g. tries a double spend), it's either detected by her own client, or by the miner.
Now, suppose the following. Eve wants to get rich. Fast. She decides upon the following. She downloads the source code of Bitcoin Core and makes some adjustments in its protocol, particulalrly, all checks on tx and block messages will pass the check, no matter how the transaction or block looks like. She then compiles the code and has her home-brewn Eve-Bitcoin-client.
Now, Eve creates two addresses (A and B), both contain 0 Bitcoins. Then, she creates a transaction, which sends 1000 BTC from address A to B. She does not broadcast this transaction to the network. Instead, she starts mining a block (based on the latest block in the blockchain) which include her own transaction. Suppose Eve is lucky or very patient and finds the right hash. Her client performs a block checks (which passes all criteria, remember Eve's client) and broadcasts the block to the network. Since the hash is correct, it seems that the network will add Eve's block to the chain. Eve just created 1000 BTC out of thin air.
It sounds too obvious though - what am I missing? Are there additional checks? What are the exact criteria upon which a block is added to the chain, and who decides this?
Fevir.