Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@s1seven/js-bigchaindb-key-derivation

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@s1seven/js-bigchaindb-key-derivation

Key derivation for BigChainDB

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

key-derivation

Heavily inspired by stellar-hd-wallet. Complies to BIP44 and SLIP10.

Usage

TODO: DEMONSTRATE API

const BigChainWallet = require('@s1seven/js-bigchain-key-derivation');

TODOs

Account discovery

In an extra module ?

async accountDiscovery(account: number | string, index: number, attempt = 0): Promise<boolean> {
  const conn = new Connection(this.networkUrl);
  const publicKey = this.getPublicKey(index, 'base58');
  // ? only check unspent ?
  const unspentTransactions = await conn.listOutputs(publicKey, false);
  const spentTransactions = await conn.listOutputs(publicKey, true);
  const transactions = [...unspentTransactions, ...spentTransactions];
  if (transactions.length) {
    return false;
  }
  if (!transactions.length) {
    return this.accountDiscovery(account, (index += 1), (attempt += 1));
  }
  if (attempt === 20) {
    return true;
  }
  return false;
}
  • add third property if keypair has unspent transaction ?
  • check that previous account has transaction history

DER / KeyObject / PEM encoding

  • Add missing alg to export as DER/PEM/Keyobject X25519 private key

Keywords

FAQs

Package last updated on 22 Feb 2021

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