Bitcoin Forum
May 09, 2024, 12:28:52 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: The Easy Attack - What am I missing?  (Read 1269 times)
fevirfevir (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 6


View Profile
August 01, 2015, 10:40:15 AM
 #1

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.
In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715257732
Hero Member
*
Offline Offline

Posts: 1715257732

View Profile Personal Message (Offline)

Ignore
1715257732
Reply with quote  #2

1715257732
Report to moderator
1715257732
Hero Member
*
Offline Offline

Posts: 1715257732

View Profile Personal Message (Offline)

Ignore
1715257732
Reply with quote  #2

1715257732
Report to moderator
-ck
Legendary
*
Offline Offline

Activity: 4102
Merit: 1632


Ruu \o/


View Profile WWW
August 01, 2015, 10:47:24 AM
 #2

The block would be rejected by every single node it's sent to as every transaction included in the broadcast block is checked by every node it's sent to.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
fevirfevir (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 6


View Profile
August 01, 2015, 11:01:44 AM
 #3

Thanks. Wasn't aware that every single node receiving a new block also checks the transactions in the new block. I assume each node also performs a "block message" (https://en.bitcoin.it/wiki/Protocol_rules#.22block.22_messages) check upon receiving new blocks.

Another thought occured: what if Eve changes her input to 1000 (of account A) and then send that 1000 to B. But this (https://en.bitcoin.it/wiki/Protocol_rules#.22block.22_messages) reads it becomes an orphan transaction, because there is no corresponding 'out' for Eve's 'input'.
BurtW
Legendary
*
Offline Offline

Activity: 2646
Merit: 1136

All paid signature campaigns should be banned.


View Profile WWW
August 01, 2015, 03:02:08 PM
 #4

Great first post.  I love your enthusiasm.  Reminds me of me when I first found out about Bitcoin.  You brightened my day.  Thanks.

Our family was terrorized by Homeland Security.  Read all about it here:  http://www.jmwagner.com/ and http://www.burtw.com/  Any donations to help us recover from the $300,000 in legal fees and forced donations to the Federal Asset Forfeiture slush fund are greatly appreciated!
jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
August 01, 2015, 06:43:55 PM
 #5


Another thought occured: what if Eve changes her input to 1000 (of account A) and then send that 1000 to B. But this (https://en.bitcoin.it/wiki/Protocol_rules#.22block.22_messages) reads it becomes an orphan transaction, because there is no corresponding 'out' for Eve's 'input'.

This tx is obviously invalid, as the reason you mentioned. Except the 25BTC reward for each block, any attempt to generate bitcoin out of thin air is invalid.

A block containing any invalid tx is simply invalid. Miners mining invalid blocks are just wasting time and energy.

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
dreamspark
Hero Member
*****
Offline Offline

Activity: 798
Merit: 1000


View Profile
August 03, 2015, 10:22:54 AM
 #6

The fact that every node would reject the attempt to just create bitcoin is what makes our little project so great. Traditional money systems allow slect individuals to do just that. Change the rules abit and create money out of thin air  Wink
fairglu
Legendary
*
Offline Offline

Activity: 1100
Merit: 1030


View Profile WWW
August 04, 2015, 09:27:16 AM
 #7

Thanks. Wasn't aware that every single node receiving a new block also checks the transactions in the new block.

Bitcoin protocol being trustless means that the bitcoin code trusts no-one, so it checks everything before accepting it.

Most of the bitcoin kernel code is made up of a of checks that protect relatively few additions and subtractions.

This is completely different from centralized apps, where your bank app trusts the bank servers, your store app trusts the store servers, etc. and so perform only very minimal checks (only at the network connection level).

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!