Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get Keystore by PrivateKeyData ? #19

Closed
skywinder opened this issue Sep 5, 2018 · 5 comments
Closed

How to get Keystore by PrivateKeyData ? #19

skywinder opened this issue Sep 5, 2018 · 5 comments
Assignees

Comments

@skywinder
Copy link
Collaborator

skywinder commented Sep 5, 2018

From @QA411 on September 3, 2018 8:46

How to get Keystore by PrivateKeyData ? Keystore eg:

{
  "address": "f13445645b52f597ca92e6f7c9987b16bc07ddb6",
  "crypto": {
    "cipher": "aes-128-ctr",
    "cipherparams": {
      "iv": "9ade19530af3e29106ed908bb46f3041"
    },
    "ciphertext": "d6236558690e5e9952ead703a4bc5bbe17a49cf47e8d8b4896fc46149c79586e",
    "kdf": "scrypt",
    "kdfparams": {
      "dklen": 32,
      "n": 4096,
      "p": 6,
      "r": 8,
      "salt": "127c2275de524cc6bd7ce21f804882d7aded732a77b5875026b56b97b1b1305a"
    },
    "mac": "288313bb2bb4ceccfa53f81e5c2803f45992222d3da74b94aa38e2a219088063"
  },
  "id": "e2092a8b-68bd-4801-bc3e-555e5dfc0878",
  "version": 3
}

Copied from original issue: BANKEX/web3swift#220

@shamatar
Copy link
Contributor

shamatar commented Sep 6, 2018

I think it was answered in #9

@QA411
Copy link

QA411 commented Sep 10, 2018

oh,thanks. but, How to get EthereumKeystoreV3 by PrivateKeyData or PrivateKeyString ? I want Export keystore json only by PrivateKeyData.

@shamatar
Copy link
Contributor

If you have a private key (64 hex symbols), then you should just initialize EthereumKeystoreV3 with a private key (first convert your hex string to Data) and password, and then export EthereumKeystoreV3 as JSON

@robegamesios
Copy link

hi, can you create a Bip32Keystore using the privateKey? I see this function available for creating EthereumKeystoreV3 using privateKey but not for Bip32Keystore. thanks

@BaldyAsh
Copy link
Collaborator

@robegamesios HI. You can't create BIP32 keystore with private key, because it can be created using only passphrase, which is seed to private key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants