Bitcoin Forum
May 05, 2024, 01:27:01 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about transactions  (Read 828 times)
SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



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?
1714915621
Hero Member
*
Offline Offline

Posts: 1714915621

View Profile Personal Message (Offline)

Ignore
1714915621
Reply with quote  #2

1714915621
Report to moderator
1714915621
Hero Member
*
Offline Offline

Posts: 1714915621

View Profile Personal Message (Offline)

Ignore
1714915621
Reply with quote  #2

1714915621
Report to moderator
1714915621
Hero Member
*
Offline Offline

Posts: 1714915621

View Profile Personal Message (Offline)

Ignore
1714915621
Reply with quote  #2

1714915621
Report to moderator
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714915621
Hero Member
*
Offline Offline

Posts: 1714915621

View Profile Personal Message (Offline)

Ignore
1714915621
Reply with quote  #2

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

Activity: 308
Merit: 250



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
Merit: 1079


Gerald Davis


View Profile
April 12, 2012, 06:47:34 PM
Last edit: April 12, 2012, 08:00:05 PM by DeathAndTaxes
 #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 (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



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

Makes sense - thanks for the explanation.  Wink
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!