New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@toruslabs/torus.js

Package Overview
Dependencies
Maintainers
2
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toruslabs/torus.js

Handle communication with torus nodes

  • 1.0.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
decreased by-67.66%
Maintainers
2
Weekly downloads
 
Created
Source

Torus.js

npm version npm

Introduction

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

The Torus 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 Torus 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 Torus network easily through these APIs:

  • retrieveShares
  • getPublicAddress

Features

  • Typescript compatible
  • All API's return Promises

Getting Started

Add @toruslabs/torus.js to your project:

Needs to be used in conjuction with @toruslabs/fetch-node-details

import FetchNodeDetails from '@toruslabs/fetch-node-details'
import TorusJs from '@toruslabs/torus.js'

const fetchNodeDetails = new FetchNodeDetails()
const TorusJs = new TorusJs()
const verifier = 'google' // any verifier
const verifierId = 'hello@tor.us' // any verifier id
const { torusNodeEndpoints, torusNodePub } = await fetchNodeDetails.getNodeDetails()
const publicAddress = await torus.getPublicAddress(torusNodeEndpoints, torusNodePub, { verifier, verifierId })

Requirements

  • Node 10+

Keywords

FAQs

Package last updated on 25 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc