Bitcoin Forum
December 05, 2016, 04:40:32 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Question about transactions  (Read 644 times)
SgtSpike
Legendary
*
Offline Offline

Activity: 1344



View Profile
April 12, 2012, 06: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?
1480912832
Hero Member
*
Offline Offline

Posts: 1480912832

View Profile Personal Message (Offline)

Ignore
1480912832
Reply with quote  #2

1480912832
Report to moderator
1480912832
Hero Member
*
Offline Offline

Posts: 1480912832

View Profile Personal Message (Offline)

Ignore
1480912832
Reply with quote  #2

1480912832
Report to moderator
1480912832
Hero Member
*
Offline Offline

Posts: 1480912832

View Profile Personal Message (Offline)

Ignore
1480912832
Reply with quote  #2

1480912832
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480912832
Hero Member
*
Offline Offline

Posts: 1480912832

View Profile Personal Message (Offline)

Ignore
1480912832
Reply with quote  #2

1480912832
Report to moderator
mcorlett
Donator
Sr. Member
*
Offline Offline

Activity: 308



View Profile
April 12, 2012, 06: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.

DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218


Gerald Davis


View Profile
April 12, 2012, 06: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.
SgtSpike
Legendary
*
Offline Offline

Activity: 1344



View Profile
April 12, 2012, 07:57:00 PM
 #4

Makes sense - thanks for the explanation.  Wink
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!