Bitcoin Forum
November 24, 2017, 09:09:58 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Trying To Understand How Transactions Work  (Read 999 times)
Cataclysmic
Newbie
*
Offline Offline

Activity: 25


View Profile
August 12, 2012, 09:43:12 PM
 #1

To try to understand how transactions work, I tried sending some bitcoins to myself.

I created this address for receiving the money I was going to send to myself: 1K563Jeki3qtJrfv8BR6LLeG1ioK13K3td

Then I sent 0.0003 BTC to that address.  In doing so, a message popped up saying I'd be charged a fee of 0.0005 BTC because "this transaction is over the size limit"  (usability problem BTW - that is NOT a meaningful or helpful message!!)

I approved the fee and the transaction occurred (I got all 6 confirmations - for the fee at least).  Now the transactions in my wallet look like this: http://screencast.com/t/8zoAY7XM

You can see that I got charged the fee of 0.0005... but where's the 0.0003 leaving my wallet and coming back in?

If I check on BlockChain.info it does look like the 0.0003 transaction occurred as you can see here: http://blockchain.info/address/1K563Jeki3qtJrfv8BR6LLeG1ioK13K3td

QUESTION #1: So why does it not appear in my wallet?  (my wallet says it's up to date)

Also, that BlockChain.info page shows that funds for the transaction came from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo - which is the address to which I received the 8.7642 BTC you can see coming into my wallet in the screenshot I linked to above.  I didn't want the funds to come from that address.  I wanted them to come from one of my other addresses that a much smaller balance - because I wanted to see how it would look on blockchain.info if when multiple addresses were used to compile the total input amount.  QUESTION #2: Is there no way that I can specify which addresses I want to use for the input to a transaction?


And another random question - QUESTION #3: I've read in a few places that a new block is added to the blockchain every 10 minutes.  If that's true, then why are the "recent blocks" listed on the home page of BlockChain.info not exactly 10 minutes apart?  They actually almost never exactly 10 minutes apart.

Thanks.
1511557798
Hero Member
*
Offline Offline

Posts: 1511557798

View Profile Personal Message (Offline)

Ignore
1511557798
Reply with quote  #2

1511557798
Report to moderator
1511557798
Hero Member
*
Offline Offline

Posts: 1511557798

View Profile Personal Message (Offline)

Ignore
1511557798
Reply with quote  #2

1511557798
Report to moderator
1511557798
Hero Member
*
Offline Offline

Posts: 1511557798

View Profile Personal Message (Offline)

Ignore
1511557798
Reply with quote  #2

1511557798
Report to moderator
Join ICO Now A blockchain platform for effective freelancing
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
finkleshnorts
Sr. Member
****
Offline Offline

Activity: 336



View Profile
August 12, 2012, 09:54:48 PM
 #2

I can only answer #3 since I don't use the default client.

#2 With the default client, you can't specify which address to send from. There is a patch available to do that, or you can use a different wallet. I use blockchain.info's wallet most of the time. It's very useful and straightforward, without skimping on features.

#3 The protocol tries to make the average time between 10 min, but there is a LOT of variance This is because of mining. If a lot of more people started mining right now, the gap would shrink temporarily. Conversely, if a lot people stopped mining, it would take a lot longer to find a new block. The protocol adjusts itself (the mining difficulty) every 2016 blocks (I think that's right) to compensate for the change in mining power, shooting for a 10 minute average.

And I believe that technically the all time average is < 10 minutes because the network has, of course, grown.

littleblackhat
Newbie
*
Offline Offline

Activity: 16


View Profile
August 12, 2012, 10:09:49 PM
 #3

Question #1: Your wallet is showing that you spent .0005 bitcoins on a transaction. This was paid to the bitcoin miners. The .0003 never really left your wallet. It may have gotten shifted around to other addresses in your wallet internally but all the coins are still there. Your wallet is parsing that transaction you linked in the blockchain as Ins - Outs, that is (8.7634 + 0.0003) - 8.7642 = -.0005

As for the size limit, it was really that your transaction was too small that probably triggered your client to request a transaction fee. The other reason would be the actual physical size in KB or a transaction being large, but your transaction shouldn't have been large in that way because it wasn't very complex.

Question #2: No, you cannot specify which addresses to transfer out of. I'm not even sure there are any clients that allow you to do this, but certainly not in the default client.

Question #3: I believe this was already answered, but I would add that 10 minutes is the goal the system tries to do. The Difficulty is adjusted upwards or downwards every so often to try to make it take 10 minutes. This is to keep the creation of new BTC on pace as designed.
notme
Legendary
*
Offline Offline

Activity: 1848


View Profile
August 12, 2012, 10:19:57 PM
 #4

You CAN spend from a specific address with the default client, just not from the GUI.

See sendfrom and sendmany RPC calls:
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
littleblackhat
Newbie
*
Offline Offline

Activity: 16


View Profile
August 12, 2012, 10:36:13 PM
 #5

notme, I believe the sendfrom and sendmany calls take accounts as input not addresses. One account can contain multiple addresses and coins can be shifted from account to account with the move command. However, I don't believe any of these 3 commands allow for specifying the individual addresses, nor do I think you can transfer an existing address to another account.
notme
Legendary
*
Offline Offline

Activity: 1848


View Profile
August 12, 2012, 10:41:29 PM
 #6

notme, I believe the sendfrom and sendmany calls take accounts as input not addresses. One account can contain multiple addresses and coins can be shifted from account to account with the move command. However, I don't believe any of these 3 commands allow for specifying the individual addresses, nor do I think you can transfer an existing address to another account.

You can easily assign a unique account to a specific address.

https://www.bitcoin.org/bitcoin.pdf
While no idea is perfect, some ideas are useful.
12jh3odyAAaR2XedPKZNCR4X4sebuotQzN
Cataclysmic
Newbie
*
Offline Offline

Activity: 25


View Profile
August 13, 2012, 01:29:31 AM
 #7

The .0003 never really left your wallet.
Are you sure?  If it never left my wallet, how did the transaction end up in the blockchain?

It may have gotten shifted around to other addresses in your wallet internally but all the coins are still there.
Is there any way that I can see which addresses in my wallet the 0.0003 got shifted to and from?

As for the size limit, it was really that your transaction was too small that probably triggered your client to request a transaction fee. The other reason would be the actual physical size in KB or a transaction being large, but your transaction shouldn't have been large in that way because it wasn't very complex.

Thanks for speculating on why I may have had to pay a fee.  I hope the creators of the wallet realize that their error message is not helpful, and that they fix it... actually, I'm going to email them about it right now.  The disregard in the bitcoin community for the usability needs of non-programmers is what I fear may be bitcoin's downfall Sad

Question #2: No, you cannot specify which addresses to transfer out of. I'm not even sure there are any clients that allow you to do this, but certainly not in the default client.

Question #3: I believe this was already answered, but I would add that 10 minutes is the goal the system tries to do. The Difficulty is adjusted upwards or downwards every so often to try to make it take 10 minutes. This is to keep the creation of new BTC on pace as designed.

Thanks for those answers.
Graet
VIP
Legendary
*
Offline Offline

Activity: 980



View Profile WWW
August 13, 2012, 04:23:23 AM
 #8

https://en.bitcoin.it/wiki/Transaction_fees explains fees - bit tricky to put in that little box Wink

the devs are aware of this issue you see
with recent and upcoming changes there will the option for users to choose the fee they pay
as the network gets busier users are also requesting being able to pay higher transaction fees to get higher priority in miners blocks
with the recent increase in transactions on the network some miners are reducing the number of transactions they include in blocks. This can create a backlog where free transactions with low priority can take some time to get accepted into a block and thus its first confirm.

also
when Bitcoin hits ver1.0 I think it might be ready for non-programmers
in the mean time it is beta software and should be treated as such Smiley

oh and I'm not a programmer, the last bit of coding I did was on punchcards at highschool lol. but I have been involved in Bitcoin for around 18months now, a lot of stuff is easier now than it was Cheesy


| Ozcoin Pooled Mining Pty Ltd https://ozcoin.net Double Geometric Reward System https://lc.ozcoin.net for Litecoin mining DGM| https://crowncloud.net VPS and Dedicated Servers for the BTC community
DannyHamilton
Legendary
*
Online Online

Activity: 1988



View Profile
August 13, 2012, 05:45:27 AM
 #9

The .0003 never really left your wallet.
Are you sure?  If it never left my wallet, how did the transaction end up in the blockchain?

It may have gotten shifted around to other addresses in your wallet internally but all the coins are still there.
Is there any way that I can see which addresses in my wallet the 0.0003 got shifted to and from?

You can see the transaction here:
http://blockchain.info/tx-index/15473291/c8bfd253ec0c028087f40bb8df61a1dd4167ed2acb0519e68e6d87bc17403573

1) You own the private key to bitcoin address 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo which had received 8.7642 BTC on 2012-08-09.

2) On 2012-08-12 you asked the client to send 0.0003 BTC with a 0.0005 BTC fee.

3) The client chose to use the coins from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo for the transaction (the current client doesn't allow you to easily choose which address to send the coins from).

4) The client created a transaction that sent all 8.7642 coins from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo (used 8.7642 from that address as the input for the transaction).

5) .0003 of that 8.7642 was payed to the destination address that you chose: 1K563Jeki3qtJrfv8BR6LLeG1ioK13K3td.  If this destination address is in your wallet, then the 0.0003 coins never left your wallet, they just moved from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo to 1K563Jeki3qtJrfv8BR6LLeG1ioK13K3td.

6) 8.7634 BTC of the 8.7642 was payed to a new address that the client added to your wallet, 1KjbJv3gp1MS7mamPgC8KmPf57rGqiwyvi.  This isn't an address that you created to give to others for them to send coins to you, so it doesn't show up in your "receive coins" tab.  But it is an address hidden away in your wallet.  In the future when you send coins, the client can choose to pull coins from this new address. Since this destination is in your wallet, the 8.7642 BTC also never left your wallet, they just moved from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo to 1KjbJv3gp1MS7mamPgC8KmPf57rGqiwyvi.

7) Any remaining coins from the input are kept by the miner that created the block with this transaction in it.  In this case 8.7642 - (8.7634 + 0.0003) = 0.0005.  Therefore the miner gets to keep 0.0005 BTC from this transaction. In this case that would be the person who owns the address 1Baf75Ferj6A7AoN565gCQj9kGWbDMHfN9, as can be seen here: http://blockchain.info/block-index/260167  These are the coins that actually left your wallet and show up in the "transactions" tab in the client.


CIYAM
Legendary
*
Offline Offline

Activity: 1862


Ian Knowles - CIYAM Lead Developer


View Profile WWW
August 13, 2012, 06:25:50 AM
 #10

You can easily assign a unique account to a specific address.

You can but it won't do what you think - when you do a send and include an account label this label is then put into the tx - whether the addresses chosen to be used have a "label" (which looks the same as an account unfortunately) on them is irrelevant.

The getaccount and setaccount commands are actually rather unintuitive as they are only having any affect on the "receive" transactions when you issue a listtransactions command.

As far as I can tell the way that it is working is that your outgoing tx's have the account label included when stored in your wallet but as this is not possible for the incoming ones the setaccount and getaccount commands provide a mapping from an address to an account label and it is this map that is used to work out the "receive" tx's "account".

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
Cataclysmic
Newbie
*
Offline Offline

Activity: 25


View Profile
August 13, 2012, 04:12:29 PM
 #11

when Bitcoin hits ver1.0 I think it might be ready for non-programmers
in the mean time it is beta software and should be treated as such Smiley

oh and I'm not a programmer, the last bit of coding I did was on punchcards at highschool lol. but I have been involved in Bitcoin for around 18months now, a lot of stuff is easier now than it was Cheesy

Whew, I'm glad to hear the usability is improving!

You can see the transaction here:
http://blockchain.info/tx-index/15473291/c8bfd253ec0c028087f40bb8df61a1dd4167ed2acb0519e68e6d87bc17403573

1) You own the private key to bitcoin address 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo which had received 8.7642 BTC on 2012-08-09.

2) On 2012-08-12 you asked the client to send 0.0003 BTC with a 0.0005 BTC fee.

3) The client chose to use the coins from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo for the transaction (the current client doesn't allow you to easily choose which address to send the coins from).

4) The client created a transaction that sent all 8.7642 coins from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo (used 8.7642 from that address as the input for the transaction).

5) .0003 of that 8.7642 was payed to the destination address that you chose: 1K563Jeki3qtJrfv8BR6LLeG1ioK13K3td.  If this destination address is in your wallet, then the 0.0003 coins never left your wallet, they just moved from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo to 1K563Jeki3qtJrfv8BR6LLeG1ioK13K3td.

6) 8.7634 BTC of the 8.7642 was payed to a new address that the client added to your wallet, 1KjbJv3gp1MS7mamPgC8KmPf57rGqiwyvi.  This isn't an address that you created to give to others for them to send coins to you, so it doesn't show up in your "receive coins" tab.  But it is an address hidden away in your wallet.  In the future when you send coins, the client can choose to pull coins from this new address. Since this destination is in your wallet, the 8.7642 BTC also never left your wallet, they just moved from 17dhPor26EjpkcRuEWgzBJPzXuTP9UT1jo to 1KjbJv3gp1MS7mamPgC8KmPf57rGqiwyvi.

7) Any remaining coins from the input are kept by the miner that created the block with this transaction in it.  In this case 8.7642 - (8.7634 + 0.0003) = 0.0005.  Therefore the miner gets to keep 0.0005 BTC from this transaction. In this case that would be the person who owns the address 1Baf75Ferj6A7AoN565gCQj9kGWbDMHfN9, as can be seen here: http://blockchain.info/block-index/260167  These are the coins that actually left your wallet and show up in the "transactions" tab in the client.

Thanks for the detailed explanation.  I wish I could see the current balance in my wallet for every address (including "hidden" addresses).  I think that would have cleared up a lot of the confusion for me earlier on.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 2856


View Profile
August 13, 2012, 06:58:19 PM
 #12

You can easily assign a unique account to a specific address.

sendfrom never tries to send BTC from specific addresses.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
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!