![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
slip32
Advanced tools
Readme
ts-slip32 is a typescript implementation of the SLIP-0032 extended serialization format for BIP-32 wallets.
From npm:
npm install slip32
From git:
git clone https://github.com/witnet/ts-slip32.git
cd ts-slip32
yarn
yarn build
The main two functions are described in slip32.d.ts
:
/**
* Import key from Slip32 format
* @param {string} slip32
* @returns {{keyPath: KeyPath; extendedKey: ExtendedKey<PrivateKey | PublicKey>}}
*/
export declare const importKeyFromSlip32: (slip32: string) => {
keyPath: number[];
extendedKey: ExtendedKey<PrivateKey | PublicKey>;
};
/**
* Export key to Slip32 format
* @param {KeyPath} keyPath
* @param {ExtendedKey<PrivateKey> | ExtendedKey<PublicKey>} extendedKey
* @returns {string}
*/
export declare const exportKeyToSlip32: (keyPath: number[], extendedKey: ExtendedKey<PrivateKey | PublicKey>) => string;
The aforementioned functions use the following interfaces and types, defined in keys.d.ts
:
/**
* Key interface
* The buffer should have a length of 32 bytes
*/
export interface Key {
bytes: Uint8Array;
}
/**
* Chain code (32 bytes)
*/
export declare type ChainCode = Uint8Array;
/**
* Private Key (33 bytes)
*/
export interface PrivateKey extends Key {
type: "private";
}
/**
* Public Key (33 bytes)
*/
export interface PublicKey extends Key {
type: "public";
}
/**
* Extended keys, as introduced by BIP-0032, pair a key with a chain code
*/
export declare type ExtendedKey<Key> = {
key: Key;
chainCode: ChainCode;
};
import * as Slip32 from "slip32"
const keyToImport = "xprv1qxqqqqqq78qr7hlewyyfzt74vasa87k63pu7g9e6hfzlzrdyh0v5k8zfw9sqpsyv7vcejeyzcpkm85jel7vmujlhpquzf4f3sh3nry0w0n4jh7t0jhc039"
// Import key as {keyPath: KeyPath, extendedKey: ExtendedKey<PrivateKey | PublicKey>}
const importedKey = Slip32.importKeyFromSlip32(keyToImport)
// Export key as string
const exportedKey = Slip32.exportKeyToSlip32(importedKey.keyPath, importedKey.extendedKey)
This library is free and open-source software released under the MIT license.
FAQs
Typescript implementation of the SLIP-0032 extended serialization format for BIP-32 wallets
The npm package slip32 receives a total of 3 weekly downloads. As such, slip32 popularity was classified as not popular.
We found that slip32 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.