Bitcoin Forum
May 22, 2024, 05:46:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Deamon sent part of balance to a new generates address  (Read 604 times)
ShopemNL (OP)
Legendary
*
Offline Offline

Activity: 1025
Merit: 1001



View Profile WWW
April 13, 2015, 06:48:37 AM
 #1

Hello,

I have a weird issue with my bitcoin deamon..

When i want to sent bitcoin to a outside deamon wallet address it sends the amount of bitcoin to the address i want but it takes a part of the balance to a new generates address

It doesnt mather if i use sendfrom of sendtoaddress.

Example 'https://blockchain.info/tx/5db0cf9b34bae795941848c151d08b1103e30b2f2e4e3525144617e3862072be'

The 0.01 BTC = the amount needed to be sent to the outside deamon wallet address
The 0.078 BTC = the amount the deamon sents to a new generated address within the deamon wallet.

What i want is this, i got a main account with one address for example '1KPiumRccmRzHyypjJ3mASZfnVXJiqfFXa' this account is called 'Demo'.
I want to sent 0.01 BTC to an address for example '1HRzoMXwHmmU7WQ3RjhU7kk51CWFQDZaep'

I want to sent 0.01 BTC to an outside deamon address with the following;
Code:
$bitcoin->sendfrom('Demo','1HRzoMXwHmmU7WQ3RjhU7kk51CWFQDZaep','0.01',3);

But everytime i do it doesnt mather if i do it per script or in de ssh using bitcoin-cli it does the problem shown above..



English is not my main language so the spelling might be wrong..

shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
April 13, 2015, 06:53:59 AM
 #2

Its change. The input[1] you are using is 0.089 bitcoin worth. You have to use all of those 0.089 bitcoin if you create a transaction. The client handles this for you, because the alternative is that you send 0.01 and pay the rest as fee.


[1] https://blockchain.info/tx/5db0cf9b34bae795941848c151d08b1103e30b2f2e4e3525144617e3862072be?show_adv=true

Im not really here, its just your imagination.
ShopemNL (OP)
Legendary
*
Offline Offline

Activity: 1025
Merit: 1001



View Profile WWW
April 13, 2015, 06:58:02 AM
Last edit: April 13, 2015, 09:57:20 AM by ShopemNL
 #3

Its change. The input[1] you are using is 0.089 bitcoin worth. You have to use all of those 0.089 bitcoin if you create a transaction. The client handles this for you, because the alternative is that you send 0.01 and pay the rest as fee.


[1] https://blockchain.info/tx/5db0cf9b34bae795941848c151d08b1103e30b2f2e4e3525144617e3862072be?show_adv=true

I understand so with sendfrom it will always take the whole balance out of the account, generates a new address puts the change on that address. Is there any way to keep the change on the account your sending from?

// Edit Got the solution
1) Generate new address
2) Give address from 1) an account name (like ordernumber)
3) Move amount needed from main wallet to the account made in 2)
4) sendfrom account 2 the amount, after that the address you created will be empty

// Edit 2 : Solution does not work. It does check the balance of account 2 and takes the amount in it (so it is empty after transaction), but it keeps sending from an address in an other account and generating a new address where it puts the rest on.

tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
April 13, 2015, 02:55:10 PM
 #4

Its change. The input[1] you are using is 0.089 bitcoin worth. You have to use all of those 0.089 bitcoin if you create a transaction. The client handles this for you, because the alternative is that you send 0.01 and pay the rest as fee.


[1] https://blockchain.info/tx/5db0cf9b34bae795941848c151d08b1103e30b2f2e4e3525144617e3862072be?show_adv=true

I understand so with sendfrom it will always take the whole balance out of the account, generates a new address puts the change on that address. Is there any way to keep the change on the account your sending from?

// Edit Got the solution
1) Generate new address
2) Give address from 1) an account name (like ordernumber)
3) Move amount needed from main wallet to the account made in 2)
4) sendfrom account 2 the amount, after that the address you created will be empty

// Edit 2 : Solution does not work. It does check the balance of account 2 and takes the amount in it (so it is empty after transaction), but it keeps sending from an address in an other account and generating a new address where it puts the rest on.


I may be wrong, but I believe that if you use createrawtransaction and sendrawtransaction then you can specify the change address as one of the outputs and if you just use your original address as that change address then you'll avoid the client creating new change addresses for you.
ShopemNL (OP)
Legendary
*
Offline Offline

Activity: 1025
Merit: 1001



View Profile WWW
April 13, 2015, 03:07:55 PM
 #5

Thank you for your reply, i believe the only answer is indeed to create a rawtransaction.

DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
April 13, 2015, 04:02:33 PM
 #6

Accounts and addresses in the bitcoin daemon (and Bitcoin Core) don't work the way you've assumed that they do.

Addresses aren't accounts.  Outputs don't belong to accounts.

You can attach an address to an account if you want the account to be updated whenever bitcoins are SENT TO that address. However, bitcoin doesn't include a concept of sending FROM an address. The transaction output that was received at that address is not locked to the account, it gets mixed in with all the other outputs in the wallet.  It's just like going to a bank and making a deposit with cash.  When you give them your account number and deposit the cash,  the amount that you deposit is added to your account balance, but that physical currency gets mixed in with all the rest of the currency in the bank.

Later, when you return to the bank and take some physical currency back out, you'll get the same amount of currency, but not the exact same pieces of paper that you deposited.  Then your account balance will be updated to indicate that you have access to less money.  The account you are trying to use is the same. When you create a transaction (with the user interface, or with sendfrom, or with sendtoaddress, or anything other than createrawtransaction) to use some of the bitcoins, the account will be updated with the new balace, but the outputs that are spent won't necessarily be the same ones that that were received when the amount was added to the balance in the first place.

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!