Crate iop_keyvault_wasm

Source
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 and secp256k1
  • 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§

IStringArray
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.
JsBip32Node
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.
JsBip32PublicNode
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
JsBip39Phrase
An intermediate object that represents a BIP39 phrase with a known language
JsBip44Account
Represents the private API of a given account of a given coin in the BIP32 tree.
JsBip44Coin
Represents a given coin in the BIP32 tree.
JsBip44Key
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.
JsBip44PublicAccount
Represents the public API of a given account of a given coin in the BIP32 tree.
JsBip44PublicKey
Represents a public key with a given index within a sub-account used on the chain for verifying signatures or validating key identifiers.
JsBip44PublicSubAccount
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.
JsBip44SubAccount
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.
JsMKeyId
Multicipher key id (fingerprint/digest/hash of a public key)
JsMPrivateKey
Multicipher private key
JsMPublicKey
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.
JsMorpheusKind
Root node of a specific kind of DIDs. The kind used to derive a DID is indistiguishable outside the wallet.
JsMorpheusPrivateKey
The operations on an identifier that require the private key to be available in memory.
JsMorpheusPublicKey
The operations on an identifier that do not require the private key to be available in memory.
JsMorpheusRoot
Representation of the root node of the Morpheus subtree in the HD wallet.
JsSecpKeyId
Secp256k1 key id (fingerprint/digest/hash of a public key)
JsSecpPrivateKey
Secp256k1 private key
JsSecpPublicKey
Secp256k1 public key
JsSecpSignature
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§

MapJsError
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.
WrapsMut
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.