Bitcoin Forum
October 22, 2017, 07:25:16 PM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Interesting accidental feature of bitcoind  (Read 913 times)
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1358


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
October 17, 2012, 04:37:17 PM
 #1

I thought I would point out an accidental feature of bitcoind - or at least bitcoind with a minor modification.

I make no secret of the fact that I like storing my bitcoins on paper wallets instead of in online wallets, and that I own a handheld USB bar code scanner that helps me do that movement.

One thing I always do when I download a new version of bitcoind is I find the code for the "importprivkey" command and knick out the code that causes a full block chain rescan after importing each key.  I simply comment it out and recompile.  This is so I can import large batches of private keys, and then shut down bitcoind and do a single rescan to catch them all.  (this also helps if I, for example, am doing a wallet recovery where I have 100+ private keys to import).

In the past, I would often modify the rescan command to take an argument: -rescan=180000 (for example) would start the rescan from block 180000, saving time if I knew I was only importing recently received payments.  Ever since I switched my bitcoin machine to using an SSD, it's been fast enough to not be worth the bother, but others might benefit from this same modification.

So anyway... I have noticed that if I import a private key to which I have already sent bitcoins from that same wallet, that bitcoind sees the funds without needing a rescan.  This feature is actually a nice unintended benefit, because it means that I can move my coins from my hotwallet on to paper, and then put them back in for immediate use whenever I want.

I figure someone might explain "yes, this works because the wallet is always scanned for transactions belonging to it, and the existence of a 'send' transaction from the wallet meets the criteria and results in the match" (assuming that's actually the case).

Another thing I might point out is that the "sendmany" command has two flaws, at least in the version of bitcoind I'm using.  First, unlike "sendtoaddress", it demands that I wait 6 confirmations before sending coins that I sent to myself.  (I often send coins to myself to consolidate txid's into one, because I like my Casascius Coins to appear in block explorers as being funded by a single address rather than a hodgepodge of customer payment addresses).  Second, the fact that sendmany requires an "account" to send from is a little bit annoying, and there ought to be a way to just put a value there to mean "send from any/all accounts".  This second thing mainly gets in others' way rather than mine (since my incoming funds are sourced through private key imports, they always have an account ID of an empty string, and can all be spent just by specifying "" as the account name).

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
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!