Expand description
§Keyvault
Keyvault is a general purpose hierarchical deterministic (HD) generator for asymmetric keys. It is based on the same concepts as a Bitcoin HD-wallet and is built on the same specifications like HD wallets of Bip32, Mnemonic word lists of Bip39 and Purpose fields of Bip43.
Though keyvault is capable of generating wallet addresses as defined in Multi-Account cryptocurrency wallets of Bip44, it is not only an address generator for multiple cryptocurrencies. Keyvault can also derive all the keys you might need in other software stacks and aims to be your all-in-one Swiss Army knife identity manager.
Keyvault can
- use the same seed to derive keys with multiple cipher suites, currently
ed25519
andsecp256k1
- use any purpose field and account hierarchy, not only Bip43 and Bip44
- handle several purposes (i.e. attached subhierarchies) at the same time
- be used from other platforms via its C and WebAssembly bindings
Keyvault was originally created as part of the Mercury communication protocol but being a general-purpose tool it was reused in other components as well, hence was separated into its own repository then finally merged into this monorepository.
This documentation is optimized for reading after it is copied into JSDoc
For more information on this crate and potential usage, see the IOP developer site.
Structs§
- IString
Array - JsBip32
- Entry point to generate extended private keys in a hierarchical deterministic wallet starting from a seed based on the BIP-0032 standard (and the SLIP-0010 for crypto suites other than Secp256k1).
- JsBip39
- Tool for generating, validating and parsing BIP-0039 phrases in different supported languages.
- JsBip44
- Entry point to generate a hierarchical deterministic wallet using the BIP-0044 standard. It is a more structured way to use the same seed for multiple coins, each with multiple accounts, each accounts with a new key for each transaction request. The standard is built on BIP-0043 using the purpose code 44. And BIP-0043 itself uses BIP-0032 to derive all nodes from a single master extended private key.
- JsBip32
Node - In BIP-0032 each extended private key has the same operations, independently from the actual path. This struct represents such an extended private key in a given subtree.
- JsBip32
Public Node - In BIP-0032 a neutered extended private key is an extended public key. This object represents such an extended public key in a given subtree. It is able to do normal (public) derivation, signature verification, creating and validating key identifiers
- JsBip39
Phrase - An intermediate object that represents a BIP39 phrase with a known language
- JsBip44
Account - Represents the private API of a given account of a given coin in the BIP32 tree.
- JsBip44
Coin - Represents a given coin in the BIP32 tree.
- JsBip44
Key - Represents the private API of a key with a given index within a sub-account used on the chain for storing balance or authenticating actions.
- JsBip44
Public Account - Represents the public API of a given account of a given coin in the BIP32 tree.
- JsBip44
Public Key - Represents a public key with a given index within a sub-account used on the chain for verifying signatures or validating key identifiers.
- JsBip44
Public SubAccount - Public API for a sub-account of a given account on a given coin that is either used for external keys (receiving addresses) or internal keys (change addresses). Some implementations do not distinguish these and just always use receiving addresses.
- JsBip44
SubAccount - Private API for a sub-account of a given account on a given coin that is either used for external keys (receiving addresses) or internal keys (change addresses). Some implementations do not distinguish these and just always use receiving addresses.
- JsMKey
Id - Multicipher key id (fingerprint/digest/hash of a public key)
- JsMPrivate
Key - Multicipher private key
- JsMPublic
Key - Multicipher public key
- JsMSignature
- Multicipher signature
- JsMorpheus
- Starting point for deriving all Morpheus related keys in a BIP32 hierarchy. Morpheus uses Ed25519 cipher and currently there are no WASM wrappers for Bip32 nodes with that cipher. Still, Bip32 paths are returned by each object so compatible wallets can derive the same extended private keys.
- JsMorpheus
Kind - Root node of a specific kind of DIDs. The kind used to derive a DID is indistiguishable outside the wallet.
- JsMorpheus
Private Key - The operations on an identifier that require the private key to be available in memory.
- JsMorpheus
Public Key - The operations on an identifier that do not require the private key to be available in memory.
- JsMorpheus
Root - Representation of the root node of the Morpheus subtree in the HD wallet.
- JsSecp
KeyId - Secp256k1 key id (fingerprint/digest/hash of a public key)
- JsSecp
Private Key - Secp256k1 private key
- JsSecp
Public Key - Secp256k1 public key
- JsSecp
Signature - Secp256k1 signature
- JsSeed
- The seed used for BIP32 derivations. A seed cannot be turned back into a phrase, because there is salted hashing involed in creating it from the BIP39 mnemonic phrase.
Traits§
- MapJs
Error - An extension trait on
Result
that helps easy conversion of Rust errors to JavaScript error strings usable by wasm_bindgen - Wraps
- Most WASM types are wrapping a Rust type one-on-one. This trait helps to enforce a convention so that WASM types can easily peek under the hood of other such wrapped WASM types.
- Wraps
Mut - Most WASM types are wrapping a Rust type one-on-one. This trait helps to enforce a convention so that WASM types can easily peek under the hood of other such wrapped WASM types.
Functions§
- all_
network_ names - The list of all network names accepted by {@link validateNetworkName}
- decrypt
- Decrypts the ciphertext with a password. The format of the ciphertext is defined by the {@link encrypt} function. Only the matching password will decrypt the ciphertext.
- encrypt
- Encrypts the plaintext with a password. Make sure the password is not weak. A random nonce is generated for each call so each time the same plaintext is encrypted with the same password, the result is a different ciphertext. The ciphertext returned will be 40 bytes longer than the plaintext.
- err_
to_ js - Converts any error that can be converted into a string into a JavaScript error string usable by wasm_bindgen
- validate_
network_ name - Free function that checks if a string is a valid network name usable as a parameter in some other calls.