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

Keystore generation #50

Closed
ceres3idoo opened this issue Feb 28, 2019 · 0 comments
Closed

Keystore generation #50

ceres3idoo opened this issue Feb 28, 2019 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@ceres3idoo
Copy link
Contributor

ceres3idoo commented Feb 28, 2019

📝 Feature

As a user I want to generate my personal keystore file using a cli command.

📖 Details

The command should be:

eidoo-hybrid-exchange-cli ethereum-wallet key-generate
--keystore-file-path The destination file path where keystore will be stored
[--hd-path] The derivation path used to retrieve the private key from seed. (default: m/44'/60'/0/0)

so you need to type your seed (12 words) and after that you have to insert a password (used to build the keystore json file).

The output will be a json file strucred as follows:

{
    "address": "fakeAddress",
    "crypto": {
        "cipher": "aes-128-ctr",
        "ciphertext": "fakeChyper",
        "cipherparams": {
            "iv": "fakeIv"
        },
        "mac": "fakeMac",
        "kdf": "scrypt",
        "kdfparams": {
            "dklen": 32,
            "n": 262144,
            "r": 1,
            "p": 8,
            "salt": "fakesalt"
        }
    },
    "id": "f99105b6-ef46-418c-9811-13a4f6004b70",
    "version": 3
}

Under the hood will be used keythereum dump generating a keystore file.

const options = const options = {
  kdf: "scrypt",
  cipher: "aes-128-ctr",
  kdfparams: {
    c: 262144,
    dklen: 32,
    prf: "hmac-sha256"
  }
}
// privateKey retrieved from hd_path and mnemonic
const iv = randomBytes
const salt = randomBytes
const result = keythereum.dump(password, privateKey, salt, iv, options)
@ceres3idoo ceres3idoo added the enhancement New feature or request label Feb 28, 2019
@ceres3idoo ceres3idoo added this to the CLI v1.0 milestone Feb 28, 2019
@andreafspeziale andreafspeziale changed the title Key store generation Keystore generation Mar 1, 2019
@ceres3idoo ceres3idoo self-assigned this Mar 1, 2019
ceres3idoo added a commit that referenced this issue Mar 1, 2019
@ceres3idoo ceres3idoo removed their assignment Mar 1, 2019
andreafspeziale added a commit that referenced this issue Mar 1, 2019
andreafspeziale added a commit that referenced this issue Mar 1, 2019
andreafspeziale added a commit that referenced this issue Mar 1, 2019
@andreafspeziale andreafspeziale added Refactor Refactoring code and removed Refactor Refactoring code labels Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants