Author

Topic: Question about transactions (Read 828 times)

legendary
Activity: 1400
Merit: 1005
April 12, 2012, 03:57:00 PM
#4
Makes sense - thanks for the explanation.  Wink
donator
Activity: 1218
Merit: 1079
Gerald Davis
April 12, 2012, 02:47:34 PM
#3
Unless you have miners as peers to your local bitcoind it likely wouldn't even get to a miner.
All nodes validate tx before relaying them.  The peers you broadcast it to would see it as an invalid tx and delete it.  
Even if it did get to a miner it would be also deleted as invalid.  End of story.

More complex answer.
Bitcoin doesn't work on the concept of "balances".  
"Address A has a balance of X" = WRONG.
"Address X has received X BTC " = WRONG.

Bitcoin works on the concept of inputs and outputs.
The input of every tx is the output of some prior tx.

Thus you don't send "1 BTC" you sign over a output(s) from some prior tx(s) totally >=1 BTC along with output(s) one of which may be a change address which total the inputs.  To include a fee the sum of the outputs are less than the sum of the inputs by the amount of the see.

The only valid TX with no input is a coinbase tx (coins generated from "nothing" as part of block reward).

Without already knowing the exact output of the tx which funds address 1 you can't include it as the input of the current tx.   Even when address 1 has a balance of 1 BTC the only valid tx is the one which includes as its inputs the EXACT outputs which gave address 1 a balance of 1 BTC.

The key thing to remember is that address balances are simply an abstraction. When you spend/transfer/send coins you are signing over a prior outputs as new inputs.
donator
Activity: 308
Merit: 250
April 12, 2012, 02:46:53 PM
#2
No, you have to cryptographically sign the input in order to unlock the funds from the prior transaction. If no such input exists, there is nothing to sign.
legendary
Activity: 1400
Merit: 1005
April 12, 2012, 02:43:30 PM
#1
If I had a customized client, and was able to create transactions from an address that didn't have the proper balance, what would happen to such transactions?

For example:
- I have address 1a, balance of 0 BTC.
- I also have address 1b
- I am expecting a payment to 1a of 1 BTC.
- I create a transaction FROM 1a TO 1b for 1 BTC.

Obviously, the transaction from 1a to 1b couldn't go through until 1a has a balance, but for those types of "rejected" transactions, are they just discarded by miners immediately, or would it be saved and transacted once 1a had the balance to cover it?  If it is saved, could both transactions end up in the same block?  The transaction from an unknown address to 1a, and then the transaction from 1a to 1b?
Jump to: