Bitcoin Forum
November 11, 2024, 11:43:11 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Transaction Size  (Read 628 times)
optimator (OP)
Sr. Member
****
Offline Offline

Activity: 351
Merit: 250



View Profile WWW
August 20, 2012, 02:39:38 PM
 #1

What determines transaction size?

Say I have 1,000btc in one address and I want to spend it 1btc.

versus

1btc in 100 addresses.

Can I calculate or estimate my transaction size for each of the above? Or do i misunderstand it completely?

DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
August 20, 2012, 03:21:21 PM
 #2

Well you don't have 1,000 BTC in one address.  That is an abstraction.

Bitcoin works on the concept on inputs and outputs.

If I send you 1BTC that is a 1 BTC unspent output.  

So your 1,000 BTC address could consists of a single 1,000 BTC unspent output or it could consist of 10,000 unspent outputs worth on average 0.1 BTC each.  Also you can't spend only 1 BTC of a single 1,000 BTC input.  If an tx inputs are 1,000 BTC the tx outputs must be ~1,000 BTC.  The difference between input and output is the fee to miner.   So if the 1,000 BTC address consisted of a single 1,000 unspent output the tx would have 1x1000BTC input and two outputs (1 BTC "spend", 999 BTC "change") totaling 1,000 BTC.

The size of the tx is based on the number of inputs and outputs.  There is no correlation between size and value.  You could have a 1M BTC tx which is <1KB and have a 0.00001 tx which is dozens or even hundreds of KBs.

A two input and two output tx is roughly 1 KB.  The average tx has ~4 combined inputs and outputs.
optimator (OP)
Sr. Member
****
Offline Offline

Activity: 351
Merit: 250



View Profile WWW
August 20, 2012, 05:56:06 PM
 #3

Got it... I think.

So the wallet, another abstraction?, it aggregates the individual addresses into a single BTC number?

Also, if I had 100BTC in one address and only spend 1BCT, does that mean I need to wait until consensus is reached on me receiving the 99btc output as "change" before I can spend it?


TangibleCryptography
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


Tangible Cryptography LLC


View Profile WWW
August 20, 2012, 06:08:55 PM
 #4

Yes the wallet is an abstraction.  It is merely an arbitrary number of addresses which being generated from random private keys have no connection to each other.   Since tx are stored in the blockchain it is possible for someone to determine that 2+ addresses come from the same wallet by analyzing txs however the protocol itself has no concept of wallets.


The protocol doesn't require any confirmations before spending funds (except newly mined coins).  Now the entity you are sending coins may require confirmation(s) before transferring goods or services but the protocol doesn't care if you receive 100 BTC and instantly use them in a tx worth 100 BTC.

The satoshi client does require 1 confirmation before allowing you to use funds.  This isn't required by the protocol but is done to prevent "issues" where users do "dumb" things which cause problems.   The Satoshi client is smart enough to recognize funds sent to itself and thus will waive its requirement for 1 confirmation requirement making those funds instantly "spendable".  Since this is a client only check it could be modified in source code.
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!