Bitcoin Forum
November 08, 2024, 01:42:18 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Possible to send a transaction without sending ALL coins from your adress?  (Read 1047 times)
Fuzzy (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 12, 2012, 06:13:21 AM
 #1

Does the bitcoin protocol support the ability to send a portion of your balance from address A to someone else's address X without sending ALL the coins from address A?

As I understand, the default transaction method in the standard client would take all the coins from A, send whatever amount you specified to address X, and send the remainder to address B, which is just another address in your wallet address pool.



DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
June 12, 2012, 06:17:16 AM
 #2

No.

The reason why is Bitcoin doesn't know/care about address balances.  You spend (use as inputs) prior tx ouputs.  We call these outputs "unspent" outputs.  Due to the way that Bitcoin tx are constructed any Output can only be spent once.  So all outputs can be classified as either spent or unspent.  The spent ones can be pruned away and the sum of all the unspent outputs for which you have private keys is the "value" of your wallet.

As a technicallity you can "send" less than the value of an output but the output is still totally spent.  If you create tx with 50 BTC input and 1 BTC output then you just created a tx w/ a 49 BTC tx fee.  Lucky miner to be the one who mines that block.
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
June 12, 2012, 06:19:00 AM
 #3

Close.  It will take all the coins from certain prior outputs in address A -  but not necessarily the whole balance since there may be other transactions - and send them all to X and B.  It already does this routinely.

It is not possible to spend only part of a transaction.  You have to generate change unless you're spending the exact amount of one of the prior outputs.

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
Fuzzy (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 12, 2012, 06:47:08 AM
 #4

Interesting. Could you then Just have a wallet with two addresses, A and B, and bounce the change from one to the other when sending to X?

ie, your wallet has address A and B only, and A holds 50 BTC. X,Y,Z are various addresses you want to send coins to.

A sends 10 to X, remaining 40 to B

B now has 40 BTC.


B sends 10 to Y, remaining 30 to A

A now has 30 BTC


A sends 10 to Z, remaining 20 to B

B now has 20 BTC.

etc etc...


I'm looking at the possibility of hard-coding the private keys for A and B into an executable, in case anyone is wondering why I'm asking.
bitcats
Legendary
*
Offline Offline

Activity: 1014
Merit: 1001



View Profile
June 12, 2012, 06:53:45 AM
 #5

Does the bitcoin protocol support the ability to send a portion of your balance from address A to someone else's address X without sending ALL the coins from address A?

As I understand, the default transaction method in the standard client would take all the coins from A, send whatever amount you specified to address X, and send the remainder to address B, which is just another address in your wallet address pool.
You can use Electrum if you automatically want to get the change back to the sending address.

"Unser Problem ist nicht ziviler Ungehorsam, unser Problem ist ziviler Gehorsam."  - Howard Zinn
Maged
Legendary
*
Offline Offline

Activity: 1204
Merit: 1015


View Profile
June 12, 2012, 06:54:17 AM
 #6

Oh, in that case, let me add an important detail: the change address can be any Bitcoin address, including an address that signed an input.

So, A sends 10 to X, remaining 40 to A.

Fuzzy (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 12, 2012, 07:06:50 AM
 #7

Oh, in that case, let me add an important detail: the change address can be any Bitcoin address, including an address that signed an input.

So, A sends 10 to X, remaining 40 to A.

Bingo! Talk about a technicality o.O

Just to be sure, can anyone confirm this will work without some other technical catch?
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
June 12, 2012, 07:12:49 AM
 #8

Yes it will work.  Blockchain.info wallet works this way
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
June 12, 2012, 07:18:34 AM
 #9

It's no technicality.  It works just fine.

Again, this will fully use all of JUST the inputs (not the whole balance of A).

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
Foxpup
Legendary
*
Online Online

Activity: 4532
Merit: 3183


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
June 12, 2012, 07:39:53 AM
 #10

Oh, in that case, let me add an important detail: the change address can be any Bitcoin address, including an address that signed an input.

So, A sends 10 to X, remaining 40 to A.

Bingo! Talk about a technicality o.O

Just to be sure, can anyone confirm this will work without some other technical catch?

There's no technical catch, just a privacy catch: by using a different address for change, there is no way to know with absolute certainty (though you can make an educated guess) which address is the recipient and which is the change; sending change to the original address removes the guesswork involved in determining who the recipient is.

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
da2ce7
Legendary
*
Offline Offline

Activity: 1222
Merit: 1016


Live and Let Live


View Profile
June 12, 2012, 12:19:43 PM
 #11

Sending change to a new address becomes a non-issue when the client finally supports deterministic wallets.  Grin

One off NP-Hard.
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!