Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: torusJKL on January 18, 2012, 06:39:51 AM



Title: Send coins from specific address in wallet
Post by: torusJKL on January 18, 2012, 06:39:51 AM
Hi

Is it possible to choose which Bitcoins will be send using Bitcoin-Qt or bitcoind?
E.g. I have 3 addresses in my wallet
A has 1 BTC
B has 2 BTC
C has 1 BTC

I now want to send 1.5 BTC without using the BTCs that are in A or C.

Thanks

Edit: typo I have 2 addresses...


Title: Re: Send coins from specific address in wallet
Post by: kjj on January 18, 2012, 06:53:00 AM
Mind if I ask why you think you want to do this?


Title: Re: Send coins from specific address in wallet
Post by: ThiagoCMC on January 18, 2012, 06:59:41 AM
Money come from address X, and go out using address Y... With Bitcoin 0.4 this is possible, right?!
You just need to change "Your Bitcoin Address" field...
Increasing anonymity...


Title: Re: Send coins from specific address in wallet
Post by: theymos on January 18, 2012, 07:17:35 AM
I'm kind of new at using Bitcoind, but this should work, no?

No. There's no way to do it with the unmodified client.


Title: Re: Send coins from specific address in wallet
Post by: Revalin on January 18, 2012, 11:02:44 AM
fromaccount is an account, which is not the same as an address.  Addresses are things that go in the blockchain.  Accounts are just virtual ledgers within your wallet.

The default client can't spend specific coins, but you can do it with the coderrr fork.  Get it here:  https://bitcointalk.org/index.php?topic=24784.0;all


Title: Re: Send coins from specific address in wallet
Post by: Meni Rosenfeld on January 18, 2012, 11:35:49 AM
Money come from address X, and go out using address Y... With Bitcoin 0.4 this is possible, right?!
You just need to change "Your Bitcoin Address" field...
Increasing anonymity...
That's not how it works.

Mind if I ask why you think you want to do this?
I don't know about the OP but there are plenty of use cases. Personally I'd be more interested in an option to send from any address but a specified one.


Title: Re: Send coins from specific address in wallet
Post by: torusJKL on January 19, 2012, 09:33:26 AM
[...]
The default client can't spend specific coins, but you can do it with the coderrr fork.  Get it here:  https://bitcointalk.org/index.php?topic=24784.0;all

That's what I was looking for.
Thanks.

Mind if I ask why you think you want to do this?

I want to keep my private and my business chains separate.
Somebody I'm doing business with should not automatically know where I spend my money in my private time. Some thins are just private. (has nothing to do with illegal)


Title: Re: Send coins from specific address in wallet
Post by: tlhonmey on January 19, 2012, 07:04:27 PM
The sensible thing to do in that case would be to keep two different wallet files, one for personal, and one for business.  You can use the -datadir parameter for the client to point it at a different folder for storing one or the other.  It takes a bit more disk space, but that's relatively cheap these days, and it's a lot less hassle than trying to keep it all separate manually.



Title: Re: Send coins from specific address in wallet
Post by: Meni Rosenfeld on January 19, 2012, 07:15:51 PM
The sensible thing to do in that case would be to keep two different wallet files, one for personal, and one for business.  You can use the -datadir parameter for the client to point it at a different folder for storing one or the other.  It takes a bit more disk space, but that's relatively cheap these days, and it's a lot less hassle than trying to keep it all separate manually.
That works, but of course the real solution is to use a client software which can handle multiple wallets conveniently, which I believe Armory does.


Title: Re: Send coins from specific address in wallet
Post by: kjj on January 19, 2012, 08:22:12 PM
Mind if I ask why you think you want to do this?

I want to keep my private and my business chains separate.
Somebody I'm doing business with should not automatically know where I spend my money in my private time. Some thins are just private. (has nothing to do with illegal)

If you really want to keep them divided, you'd be better off running two nodes, or using a client that can handle multiple wallet files.

Picking the transactions to redeem by hand or by script is a poor idea.  You are almost certainly losing both anonymity and security, which seems like a poor trade if you are looking for privacy.


Title: Re: Send coins from specific address in wallet
Post by: torusJKL on January 20, 2012, 01:25:04 PM
Mind if I ask why you think you want to do this?

I want to keep my private and my business chains separate.
Somebody I'm doing business with should not automatically know where I spend my money in my private time. Some thins are just private. (has nothing to do with illegal)
If you really want to keep them divided, you'd be better off running two nodes, or using a client that can handle multiple wallet files.
[...]

I don't want to have 2 nodes running.
Is there a client that allows multiple wallet files?


Title: Re: Send coins from specific address in wallet
Post by: Meni Rosenfeld on January 20, 2012, 01:46:05 PM
Mind if I ask why you think you want to do this?

I want to keep my private and my business chains separate.
Somebody I'm doing business with should not automatically know where I spend my money in my private time. Some thins are just private. (has nothing to do with illegal)
If you really want to keep them divided, you'd be better off running two nodes, or using a client that can handle multiple wallet files.
[...]

I don't want to have 2 nodes running.
Is there a client that allows multiple wallet files?
Armory (https://bitcointalk.org/index.php?topic=56424), which is currently in pre-Alpha. Maybe others.


Title: Re: Send coins from specific address in wallet
Post by: deepceleron on January 21, 2012, 05:29:50 PM
If you have a specific address that you need to send coins from, the easiest way is to export the private key for that address with pywallet, and import it into a brand new wallet (either by swapping the wallet file on your existing install, or better, by running a completely different Bitcoin on a virtual machine (virtual PC or VirtualBox). Then payments can only be funded from the balance of that one address. Note that any remaining balance will be sent back to a new hidden address inside the wallet as "change", so if you don't send the full amount, you must continue to use the second copy of the Bitcoin wallet to use the remaining money until your balance is zero.


Title: Re: Send coins from specific address in wallet
Post by: Ente on January 28, 2012, 12:29:26 PM
If you have a specific address that you need to send coins from, the easiest way is to export the private key for that address with pywallet, and import it into a brand new wallet (either by swapping the wallet file on your existing install, or better, by running a completely different Bitcoin on a virtual machine (virtual PC or VirtualBox). Then payments can only be funded from the balance of that one address. Note that any remaining balance will be sent back to a new hidden address inside the wallet as "change", so if you don't send the full amount, you must continue to use the second copy of the Bitcoin wallet to use the remaining money until your balance is zero.

Thats how I would do it too.
Or, find out how much Bitcoins are on which address in your wallet (pywallet is the easiest for that), blockexplorer helps.
If you transfer the exact amount that is on one of your adresses, the client should use that address too. Similar, if only one address has enough funds to do the transaction, the client should use that one (instead of combining several addresses worth).

I use several wallets and keep book about the used addresses in them. PITA, I will read up on multi-wallet-clients right now!

Ente


Title: Re: Send coins from specific address in wallet
Post by: torusJKL on January 28, 2012, 03:46:57 PM
Armory (https://bitcointalk.org/index.php?topic=56424), which is currently in pre-Alpha. Maybe others.

Armory looks very promising.


Title: Re: Send coins from specific address in wallet
Post by: oldbute on August 02, 2014, 04:21:06 AM
Use listunspent find the transactions for the address you want to spend.  Then use createrawtransaction, signrawtransaction, sendrawtransaction  Can do them separate but here is a one liner.  Make sure you give yourself the change and put a fee (inputs - outputs). Probably a better way to parse the signrawtransaction json output but sed works for me

Code:
# bitcoind listunspent
[
    {
        "txid" : "4e415cfe96e5b557ce36be581ab78a43104603ec1c9ad1df6f874943a1d80112",
        "vout" : 0,
        "address" : "moTgwCgQ8XY3C2eVVHdoDupTb1x5PMz2du",
        "scriptPubKey" : "76a9145722efd931fcd4c5515b7b97fbaae74f26c69a5688ac",
        "amount" : 50.00730000,
        "confirmations" : 2
    },
    {
        "txid" : "5579758b854ee488c64a927dba8f58a6e6f1f1f79e543255b34463c16d95619e",
        "vout" : 0,
        "address" : "mtjjE9CdyXZcpwSRPNa9a1FMXLUfBtTWSw",
        "account" : "",
        "scriptPubKey" : "76a914910422711e72aa0685e370d499c0502400e24be688ac",
        "amount" : 1.11110000,
        "confirmations" : 8
    },
    {
        "txid" : "80fd81d3a8edd665c6a85b4f2d0ef064e9e7717b65b3b42b1802e1af2a9084c2",
        "vout" : 0,
        "address" : "n38do8raoFbypesNcz8FCxyjyj6Z7g3J5v",
        "account" : "",
        "scriptPubKey" : "76a914ed1a2c9b4f91a26900c8dca84da7203062f4c20488ac",
        "amount" : 50.00020000,
        "confirmations" : 66812
    }
]

# bitcoind createrawtransaction '[{"txid":"4e415cfe96e5b557ce36be581ab78a43104603ec1c9ad1df6f874943a1d80112", "vout": 0}]' '{"mqWpWo4o7GpyUgQKvpNBd4F372rvrLN4ij": 1.0,"moTgwCgQ8XY3C2eVVHdoDupTb1x5PMz2du": 49.0072}' | xargs bitcoind signrawtransaction | sed -n -e '/hex/p' | sed -e 's/^.*"hex" : "\(.*\)".*$/\1/' | xargs bitcoind sendrawtransaction
ed2d91c4a8f2b578d2d1d6339949ad553b7c719f2402d701eaccf4699f61ff84



Title: Re: Send coins from specific address in wallet
Post by: bitpop on August 02, 2014, 09:13:43 AM
In the future switch to armory, you still need core


Title: Re: Send coins from specific address in wallet
Post by: BookLover on August 02, 2014, 02:54:55 PM
The sensible thing to do in that case would be to keep two different wallet files, one for personal, and one for business.  You can use the -datadir parameter for the client to point it at a different folder for storing one or the other.  It takes a bit more disk space, but that's relatively cheap these days, and it's a lot less hassle than trying to keep it all separate manually.

-wallet=<file> would be more useful in this case.  OP could simply create two shortcuts, one label business and one labeled personal, each one pointing to their respective wallet file.

Source for command line options:https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments (https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments)


Title: Re: Send coins from specific address in wallet
Post by: Abdussamad on August 02, 2014, 07:47:21 PM
Use listunspent find the transactions for the address you want to spend.  Then use createrawtransaction, signrawtransaction, sendrawtransaction  Can do them separate but here is a one liner.  Make sure you give yourself the change and put a fee (inputs - outputs). Probably a better way to parse the signrawtransaction json output but sed works for me

Wut?! No, this is no longer required. You can select inputs using the GUI:

https://bitcoinspakistan.com/blog/whats-new-in-version-0-9-0-of-bitcoin-qt/

See the part about coin control.


Title: Re: Send coins from specific address in wallet
Post by: oldbute on August 02, 2014, 11:00:11 PM
Use listunspent find the transactions for the address you want to spend.  Then use createrawtransaction, signrawtransaction, sendrawtransaction  Can do them separate but here is a one liner.  Make sure you give yourself the change and put a fee (inputs - outputs). Probably a better way to parse the signrawtransaction json output but sed works for me

Wut?! No, this is no longer required. You can select inputs using the GUI:

https://bitcoinspakistan.com/blog/whats-new-in-version-0-9-0-of-bitcoin-qt/

See the part about coin control.

Yeah if you want to be a wus and use GUIs :)  Good to see the easier solutions posted for people.  I posted mine because I was looking how to do it with bitcoind and this thread was what came up in my google search.