electrum icon indicating copy to clipboard operation
electrum copied to clipboard

validateaddress doesn't work on imported addresses

Open AbdussamadA opened this issue 13 years ago • 4 comments

Validateaddress doesn't work on addresses of imported private keys. I want to see the public key behind my imported private key so I tried to use validateaddress but it wouldn't work:

Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/electrum_gui/gui_classic.py", line 1278, in return lambda *args: apply( f, (method, args, self.password_dialog )) File "/usr/local/lib/python2.7/site-packages/electrum/commands.py", line 92, in _run result = apply(f,args) File "/usr/local/lib/python2.7/site-packages/electrum/commands.py", line 164, in validateaddress out['pubkey'] = self.wallet.get_public_key(addr) File "/usr/local/lib/python2.7/site-packages/electrum/wallet.py", line 216, in get_public_key return self.sequences[account].get_pubkey( sequence ) KeyError: -1

AbdussamadA avatar Jun 10 '13 17:06 AbdussamadA

Could you explain what you are doing to create this error?

I tried replicating this by going to a imported key, right clicking it and pressing "private key". This however worked fine for my key.

maran avatar Jun 17 '13 18:06 maran

I am running the validateaddress command in the electrum console so that I can see the public key of my imported private key. So:

validateaddress( '1importedprivatekeyaddrr' )

AbdussamadA avatar Jun 17 '13 23:06 AbdussamadA

there is no easy way to fix this; the public key can only be derived from the private key (requiring the user's password) maybe in the future the wallet should store public keys instead of addresses; it would generally be more efficient

ecdsa avatar Aug 17 '13 23:08 ecdsa

I fixed the traceback, but it won't display the public key.

ecdsa avatar Sep 15 '13 13:09 ecdsa