Go-ethereum: how to import account from Ethereum Wallet

Created on 9 Sep 2016  路  3Comments  路  Source: ethereum/go-ethereum

System information

Geth
Version: 1.5.0-unstable
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.5.1
OS: linux
GOPATH=
GOROOT=/usr/lib/go

Steps to reproduce the behaviour

I export account from Ethereum Wallet
this file look like this
{"address":"c8edeb20dfb59ef196cf0515e9acc74c4fa3ad77","crypto":{"cipher":"aes-128-ctr","ciphertext":"XXX","cipherparams":{"iv":"XXX"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"XXX"},"mac":"XXX"},"id":"XXX","version":3}

I use geth account import key
but
Fatal: Failed to load the private key: encoding/hex: invalid byte: U+007B '{'

Plz help me
Thanks.

Most helpful comment

Just copy it into your keystore folder. Import is meant to load an unencrypted private key. You have a nice final encrypted key file so just copy :)

All 3 comments

Just copy it into your keystore folder. Import is meant to load an unencrypted private key. You have a nice final encrypted key file so just copy :)

What ^^ said, the keystore directories are:
mainnet: $HOME/.ethereum/keystore
testnet: $HOME/.ethereum/testnet/keystore

I'm writing a utility so it has to import using the command only.
Is there a possibility of adding the feature for import of an encrypted file ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VoR0220 picture VoR0220  路  3Comments

VenusHu picture VenusHu  路  3Comments

vogelito picture vogelito  路  3Comments

JMaxU picture JMaxU  路  3Comments

ysqi picture ysqi  路  3Comments