mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
bring back @noble/secp256k1 along with micro-bip32.
This commit is contained in:
9
nip06.js
9
nip06.js
@@ -4,14 +4,11 @@ import {
|
||||
mnemonicToSeedSync,
|
||||
validateMnemonic
|
||||
} from 'micro-bip39'
|
||||
import BIP32Factory from 'bip32'
|
||||
import * as ecc from 'tiny-secp256k1'
|
||||
|
||||
const bip32 = BIP32Factory(ecc)
|
||||
import {HDKey} from 'micro-bip32'
|
||||
|
||||
export function privateKeyFromSeed(seed) {
|
||||
let root = bip32.fromSeed(Buffer.from(seed, 'hex'))
|
||||
return root.derivePath(`m/44'/1237'/0'/0'`).privateKey.toString('hex')
|
||||
let root = HDKey.fromMasterSeed(Buffer.from(seed, 'hex'))
|
||||
return root.derive(`m/44'/1237'/0'/0'`).privateKey.toString('hex')
|
||||
}
|
||||
|
||||
export function seedFromWords(mnemonic) {
|
||||
|
||||
Reference in New Issue
Block a user