@oraichain/multifactors.js
TypeScript icon, indicating that this package has built-in type declarations

2.0.2-beta.0 • Public • Published

Multifactors.js

npm version npm

Introduction

A JS utility library (w/ typescript bindings!) to make calls to the Web3 Multifactors network

The Web3 Multifactors network assumes that n/4 of nodes may be malicious, and n/2 + 1 of the nodes are required for key reconstruction. Given these threshold assumptions, all API calls to the Web3 Mutlfactor nodes need to be checked for consistency while still allowing for early exits in optimistic scenarios where the first n/2 + 1 responses are from honest nodes.

Also, in order to prevent front-running by nodes, a commit-reveal process is also necessary for share retrieval.

This library handles these checks and allows you to query the Web3 Mutlifactor network easily through these APIs:

  • retrieveShares
  • getPublicAddress

Features

  • Typescript compatible. Includes Type definitions
  • All API's return Promises

Installation

Bundling

This module is distributed in 5 formats

  • esm build dist/torusUtils.esm.js in es6 format
  • commonjs build dist/torusUtils.cjs.js in es5 format
  • commonjs build dist/torusUtils-bundled.cjs.js in es5 format with problematic packages bundled (benfits non-webpack users)
  • umd build dist/torusUtils.umd.min.js in es5 format without polyfilling corejs minified
  • nodejs build dist/torusUtils-node.js in es5 format

By default, the appropriate format is used for your specified usecase You can use a different format (if you know what you're doing eg. node) by referencing the correct file

The cjs build is not polyfilled with core-js. It is upto the user to polyfill based on the browserlist they target

Directly in Browser

CDN's serve the non-core-js polyfilled version by default. You can use a different

jsdeliver

<script src="https://cdn.jsdelivr.net/npm/@oraichain/torus.js"></script>

unpkg

<script src="https://unpkg.com/@oraichain/torus.js"></script>

Notes

This is a plugin that works only on the client side. So please register it as a ssr-free plugin.

Package Sidebar

Install

npm i @oraichain/multifactors.js

Weekly Downloads

2

Version

2.0.2-beta.0

License

MIT

Unpacked Size

3.7 MB

Total Files

26

Last publish

Collaborators

  • oraichain_official