archway-network / cli

Develop WASM smart contracts with the Archway network developer CLI
https://docs.archway.io
Apache License 2.0
44 stars 21 forks source link

refactor(accounts): Mnemonic management and secret storage #211

Closed eliasmpw closed 1 year ago

eliasmpw commented 1 year ago

Description

For improved security, the keyring should store only a single HDPath with its pub/private keys instead of the root secret (mnemonic). If one private key is compromised, the user will lose only one account instead of all accounts available for a single mnemonic.

Technical Details

We must move the accounts management from the DirectSecp256k1HdWallet class to DirectSecp256k1Wallet. ​

Storing the keys

​ The private and pub keys should be stored in this structure (OS, File, etc.): ​

{
  "address": "archway1...",
  "name": 'my-key-name',
  "type": "local",
  "pubkey": {
    "type": "tendermint/PubKeySecp256k1",
    "value": "AplBM7..."
  },
  "privkey": "<serialized private key>"
}
aelesbao commented 1 year ago

Resolved on #218 and #235