This package has been deprecated

Author message:

this package has been deprecated

@s1seven/js-bigchaindb-key-derivation
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @s1seven/js-bigchaindb-key-derivation

Weekly Downloads

1

Version

0.2.0

License

Apache-2.0

Unpacked Size

255 kB

Total Files

35

Last publish

Collaborators

  • christophbuehler
  • eamon0989
  • s1seven-service
  • stiebitzhofer