Title: bitcoind - adding addresses without private key? Post by: when on August 28, 2012, 06:37:19 PM OK, so the blockchain isn't up to date yet:
x@x:~/.bitcoin$ bitcoind getblockcount 142994 And I can't add an obviously bad address to an account x@x:~/.bitcoin$ bitcoind setaccount 1badbadbad invalid error: {"code":-5,"message":"Invalid bitcoin address"} And I can add a new one: x@x:~/.bitcoin$ bitcoind getnewaddress 16sVKyzots4SfrEUAoaeHEtJRVjbuhMdFK x@x:~/.bitcoin$ bitcoind setaccount 16sVKyzots4SfrEUAoaeHEtJRVjbuhMdFK test But I can also add an address that I don't own to the accounts list (Satoshi's original genesis block, which I obviously don't have the key for): x@x:~/.bitcoin$ bitcoind setaccount 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa test x@x:~/.bitcoin$:bitcoind listreceivedbyaddress 0 true [ { "address" : "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "account" : "test", "amount" : 0.00000000, "confirmations" : 0 } ] Why doesn't the client throw out addresses that you try to add to the wallet without having the private key for them? Title: Re: bitcoind - adding addresses without private key? Post by: Stephen Gornick on August 28, 2012, 08:01:06 PM Why doesn't the client throw out addresses that you try to add to the wallet without having the private key for them? An ecommerce site might want to run a bitcoind instance to provide access to the API for receiving transactions but no spending is possible. This dramatically decreases the risk should a security breach occur, as there is much less an attacker can do. So by allowing addresses with no private key lets the bitcoind do everything except spend. Title: Re: bitcoind - adding addresses without private key? Post by: arsenische on October 13, 2012, 02:25:50 PM Quote So by allowing addresses with no private key lets the bitcoind do everything except spend. I tried to do something useful with bitcoind without private key, but failed: Code: $ ./bitcoind setaccount 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa satoshi So it doesn't seem like adding address without a private key is useful. Or am I doing it wrong? Title: Re: bitcoind - adding addresses without private key? Post by: Stephen Gornick on October 15, 2012, 09:23:46 PM So it doesn't seem like adding address without a private key is useful. Or am I doing it wrong? You aren't adding an address to the wallet though. Quote setaccount changes the account associated with an existing address. - http://en.bitcoin.it/wiki/Accounts_explained#Accounts_and_Receiving_Addresses So the problem is that the address doesn't exist in the wallet already, right? The only way to add it is to import the private key (and rescan), and then it is no longer a watching only wallet. You can roll your own monitoring for a list of bitcoin addresses from activity on the blockchain using Raw Transactions (new in the Bitcoin.org client v0.7). Armory has the concept of a watching only wallet: - http://bitcoinarmory.com/index.php/using-offline-wallets-in-armory Title: Re: bitcoind - adding addresses without private key? Post by: arsenische on October 23, 2012, 08:26:18 PM Thank you, Stephen!
|