Tweeted twitter.com/#!/StackBitcoin/status/498642343235710976
deleted 2 characters in body
Source Link
src091
  • 253
  • 1
  • 8

I'm confused about how exactly should I should compute a change for a transactions.
Say, for a given address I have 4 unspent outputs containing 2 BTC each and I want to send 5 BTC to other address.

Here's what I do:

  1. Find 3 outputs needed so the total is 6 BTC
  2. Now, what should be the change be? 6-5=1 or 8-5=3?

I'm confused about how exactly should I compute a change for a transactions.
Say, for a given address I have 4 unspent outputs containing 2 BTC each and I want to send 5 BTC to other address.

Here's what I do:

  1. Find 3 outputs needed so the total is 6 BTC
  2. Now, what should be the change? 6-5=1 or 8-5=3?

I'm confused about how exactly I should compute a change for transactions.
Say, for a given address I have 4 unspent outputs containing 2 BTC each and I want to send 5 BTC to other address.

Here's what I do:

  1. Find 3 outputs needed so the total is 6 BTC
  2. Now, what should the change be? 6-5=1 or 8-5=3?
Source Link
src091
  • 253
  • 1
  • 8

Transaction change calculation

I'm confused about how exactly should I compute a change for a transactions.
Say, for a given address I have 4 unspent outputs containing 2 BTC each and I want to send 5 BTC to other address.

Here's what I do:

  1. Find 3 outputs needed so the total is 6 BTC
  2. Now, what should be the change? 6-5=1 or 8-5=3?