Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

bip32 implementation for Nano currency

License

NotificationsYou must be signed in to change notification settings

go-faast/bip32-nano

Repository files navigation

ABIP32 compatible library for the Nano currency written in TypeScript with transpiled JavaScript committed to git. Based on the implementation bysuperdarkbit which is based on thisBIP32-ED25519 spec.

This library attempts to conform the theBIP32Interface defined by thebitcoinjs bip32 library.

The following are intentional deviations or incompatabilities:

  • BIP32Interface.toWIF is not supported because Nano does not use WIF for private keys
  • xprv's are 109 bytes instead of the standard 78 bytes in order to include the full 512 bit private key that is needed for BIP32-ED25519
  • xpub's are 77 bytes instead of the standard 78 bytes because byte 45 is no longer needed to indicate whether the public key is compressed. ED25519 public keys are always compressed.
  • BIP32-ED25519 requires a master secret such that it's SHA512 hash has the third highest bit of the first 32 bytes unset. In order to be compatible with all existing seeds, a conforming master secret is discovered by iterating over 32 bit integersi starting from 0 untilSHA512(i, seed) meets the requirements.

TODO

  • Update tests
  • Change bip32 public/private version number

Example

TypeScript

import*asbip32from'bip32-nano';import{BIP32Interface}from'bip32-nano';letnode:BIP32Interface=bip32.fromBase58('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi');letchild:BIP32Interface=node.derivePath('m/0/0');// ...

NodeJS

letbip32=require('bip32-nano')letnode=bip32.fromBase58('xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi')letchild=node.derivePath('m/0/0')// ...

LICENSEMIT

About

bip32 implementation for Nano currency

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp