Expand description

This module provides WASM bindings to functionality needed in a client application using the IOP Stack™. Network related asynchronous code is provided in the TypeScript part of the SDK and is not done from these WASM bindings.

Structs

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).

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.

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

Tool for generating, validating and parsing BIP-0039 phrases in different supported languages.

An intermediate object that represents a BIP39 phrase with a known language

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.

Represents the private API of a given account of a given coin in the BIP32 tree.

Represents a given coin in the BIP32 tree.

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.

Represents the public API of a given account of a given coin in the BIP32 tree.

Represents a public key with a given index within a sub-account used on the chain for verifying signatures or validating key identifiers.

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.

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.

An object representing a valid DID. This identifier can be used to look up a DID document on multiple blockchains. Without any on-chain SSI transactions, there will be a single key that can update and impersonate the DID, which has the default key identifier.

Parameters of a Hydra account added to a {@link Vault}

Represents a Hydra account in a given vault.

Private keys of a Hydra account in a vault.

Public keys of a Hydra account in a vault.

Thin adapter around {@link SecpPrivateKey} for signing Hydra transactions.

Builder for core Hydra transactions on a given network.

Builder object for creating and signing a JWT (JSON Web Token) with or without an associated content.

Parser for reading a JWT (JSON Web Token) from a string and validate its content and signature.

Multicipher key id (fingerprint/digest/hash of a public key)

Multicipher private key

Multicipher public key

Multicipher signature

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.

Builder for a {@link IMorpheusAsset}.

Root node of a specific kind of DIDs. The kind used to derive a DID is indistiguishable outside the wallet.

Builder for operations on a given DID. These operations can be later added to a {@link MorpheusOperationSigner} even for different DIDs, so the operations can be signed by a multicipher {@link PrivateKey} that has update rights on these DIDs.

Builder object for collecting SSI operations into a bundle signed by a single multicipher {@link PrivateKey} that has update rights on all DIDs being altered in those operations.

Represents the Morpheus subtree in a given vault.

Private keys of the Morpheus subtree in a vault.

The operations on an identifier that require the private key to be available in memory.

Private keys for a given DID kind in the Morpheus subtree in a vault.

Public keys of the Morpheus subtree in a vault.

The operations on an identifier that do not require the private key to be available in memory.

Public keys for a given DID kind in the Morpheus subtree in a vault.

Representation of the root node of the Morpheus subtree in the HD wallet.

An object representing a single SSI operation on a single DID. This operation is not yet signed by a key with update rights on the DID document, and therefore needs to be added to a {@link MorpheusOperationSigner}

A set of SSI operations already signed by a key that had update rights on all DIDs altered by the operations.

Builder for SSI Hydra transactions.

Secp256k1 key id (fingerprint/digest/hash of a public key)

Secp256k1 private key

Secp256k1 public key

Secp256k1 signature

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.

Binary data signed by a multicipher key.

JSON signed by a multicipher key. Since the signature is done on a digest created by {@link digestJson}, the same signature can be validated against different selectively revealed JSON documents.

A single issue found while validating against a DID document.

All issues found while validating against a DID document.

This object provides a safe serialization format for an in-rest encoded vault file for the IOP Stack™.

Traits

An extension trait on Result that helps easy conversion of Rust errors to JavaScript error strings usable by wasm_bindgen

An extension trait on Result that helps easy conversion of Rust errors to JavaScript error strings usable by wasm_bindgen

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.

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

The list of all network names accepted by {@link validateNetworkName}

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.

Calculates the digest of a JSON document. Since this digest is calculated by recursively replacing sub-objects with their digest, it is possible to selectively reveal parts of the document using {@link selectiveDigestJson}

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.

Converts any error that can be converted into a string into a JavaScript error string usable by wasm_bindgen

Converts any error that can be converted into a string into a JavaScript error string usable by wasm_bindgen

Returns a canonical string representation of a JSON document, in which any sub-objects not explicitly listed in the second argument are collapsed to their digest. The format of the second argument is inspired by JQ basic filters and these are some examples:

This function provides a canonical string for any JSON document. Order of the keys in objects, whitespace and unicode normalization are all taken care of, so document that belongs to a single digest is not malleable.

Free function that checks if a string is a valid network name usable as a parameter in some other calls.

You should protect scalar values and easy-to-guess lists by replacing them with an object that has an extra “nonce” property, which has enough entropy. List of all countries, cities in a country, streets in a city are all easy to enumerate for a brute-fore attack.