Skip to content

Latest commit

 

History

History
75 lines (61 loc) · 2.66 KB

README.md

File metadata and controls

75 lines (61 loc) · 2.66 KB

Vault

Secure storage for private keys and sensitive data, designed to protect your most critical assets in web3.0.

Getting started

make vault/setup

Running

make vault/start/dev

Testing

# Run all tests
make vault/test

make vault/test/type
make vault/test/unit
make vault/test/integration
make vault/test/e2e

Terminology

  • Mnemonic: A mnemonic is a group of easy to remember words that can be used to deterministically generate wallets.
  • Seed: Is a binary key obtained from a mnemonic. It is obtained by using PBKDF2 function on the mnemonic. You can generate different rootKey from the same seed.
  • Root Key: A Root Key (or Master Key) is a cryptographic key calculated from a seed, using an EC algorithm. Most common algorithm is "Secp256k1" (used by Bitcoin and Ethereum chains). Solana uses "Ed25519". A Root Key should not be used for on chain operation. It serves its purpose as a parent for children privateKey.
  • Private Key:: Is the private key material used to do on chain action, such as signing transactions. It is deterministically generated by deriving a rootKey on a path. Vault also offers the capability to import a privateKey, if it was previously encrypted using an encryptionKey
  • Encryption Key: Is an RSA key used by the vault in import operations. Any private material imported to the Vault must be encrypted using the currently generated RSA Encryption Key public material. You can generate a new key by calling POST /encryption-keys. It will generate a new encryption key pair, and return the public key for user to encrypt with.
  • Account: It is the abstraction around a privateKey used on chain. It is to be understood as defined in bip32 specification. It can be the child of a wallet if it was generated in the vault using POST /wallets/derive, or it can be imported alone through POST /accounts/import.
  • Wallet: It is a structure that organizes a collection of accounts. It's the abstraction around a rootKey. The same relationship that applies to rootKey and privateKeys applies to wallet and account. A wallet is a parent for children accounts.

If you want a better understanding of the concepts above, you can read bip32, bip39, and bip44.

Formatting

make vault/format
make vault/lint

make vault/format/check
make vault/lint/check