npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pqc-mnemonic

v0.1.1

Published

BIP-39 mnemonic library with ECDSA, PQC, and hybrid address schemes

Readme

PQC-Mnemonic

BIP-39 니모닉을 사용하여 ECDSA-only, PQC-only, 하이브리드 주소를 생성하는 TypeScript 라이브러리입니다.

특징

  • BIP-39 니모닉 지원: 표준 니모닉 생성 및 검증
  • 다양한 주소 체계: ECDSA-only, PQC-only, 하이브리드 지원
  • 모듈화된 설계: 주소 체계를 모듈처럼 교체 가능
  • 동일 인덱스 지원: 같은 니모닉과 인덱스로 모든 주소 타입 생성 가능

설치

npm install pqc-mnemonic

사용법

니모닉 단어 수 선택 (12단어/24단어)

BIP-39 니모닉은 엔트로피 강도에 따라 단어 수가 결정됩니다:

  • 12단어 (128비트 엔트로피): 기본값, 대부분의 사용 사례에 충분

    • 보안 수준: 2^128 조합 (약 3.4 × 10^38)
    • 입력 편의성: 더 짧고 기억하기 쉬움
    • 권장: 일반적인 지갑 사용
  • 24단어 (256비트 엔트로피): 더 높은 보안 수준

    • 보안 수준: 2^256 조합 (약 1.2 × 10^77)
    • 입력 편의성: 더 길지만 더 안전
    • 권장: 고가치 자산이나 장기 보관이 필요한 경우

참고: 두 경우 모두 seed는 64바이트(512비트)로 동일하게 생성됩니다. 차이는 엔트로피의 무작위성 강도입니다.

import { generateMnemonic, createWallet } from 'pqc-mnemonic';

// 12단어 니모닉 생성 (기본값, 128비트)
const mnemonic12 = generateMnemonic(); // 또는 generateMnemonic(128)
console.log(mnemonic12); // 12개 단어

// 24단어 니모닉 생성 (256비트)
const mnemonic24 = generateMnemonic(256);
console.log(mnemonic24); // 24개 단어

// 12단어로 지갑 생성 (기본값)
const wallet12 = createWallet();
console.log(wallet12.mnemonic.split(' ').length); // 12개 단어

// 24단어로 지갑 생성 (256비트 엔트로피)
const wallet24 = createWallet({ mnemonicStrength: 256 });
console.log(wallet24.mnemonic.split(' ').length); // 24개 단어

기본 사용

import { createWallet, restoreWallet } from 'pqc-mnemonic';

// 새 지갑 생성
const wallet = createWallet();

// 니모닉 확인
console.log(wallet.mnemonic);

// 주소 생성 (인덱스 0)
const addressInfo = wallet.getAddress(0);
console.log(addressInfo.address);

ECDSA-only 주소 체계

import { createWallet, ECDSAOnlyScheme } from 'pqc-mnemonic';

const wallet = createWallet({
    addressScheme: new ECDSAOnlyScheme("m/44'/0'/0'"),
});

const addressInfo = wallet.getAddress(0);
// addressInfo.ecdsaKeyPair 사용

PQC-only 주소 체계

import { createWallet, PQCONlyScheme } from 'pqc-mnemonic';

const wallet = createWallet({
    addressScheme: new PQCONlyScheme('pqc-keygen'),
});

const addressInfo = wallet.getAddress(0);
// addressInfo.pqcKeyPair 사용

하이브리드 주소 체계 (기본값)

import { createWallet, HybridScheme } from 'pqc-mnemonic';

const wallet = createWallet({
    addressScheme: new HybridScheme("m/44'/0'/0'", 'pqc-hybrid'),
});

const addressInfo = wallet.getAddress(0);
// addressInfo.ecdsaKeyPair와 addressInfo.pqcKeyPair 모두 사용 가능

니모닉으로 지갑 복구

import { restoreWallet } from 'pqc-mnemonic';

const mnemonic = 'your twelve word mnemonic phrase here...';
const wallet = restoreWallet(mnemonic);

// 같은 인덱스로 모든 주소 타입 생성 가능
const addressInfo = wallet.getAddress(0);

주소 체계 커스터마이징

주소 체계가 바뀔 수 있으므로 AddressScheme 또는 HybridAddressScheme 인터페이스를 구현하여 교체할 수 있습니다:

import { AddressScheme, KeyPair, Address } from 'pqc-mnemonic';

class CustomAddressScheme implements AddressScheme {
    readonly name = 'custom';

    deriveKeyPair(seed: Uint8Array, index: number): KeyPair {
        // 커스텀 키 파생 로직
    }

    publicKeyToAddress(publicKey: Uint8Array): Address {
        // 커스텀 주소 생성 로직
    }

    validateAddress(address: Address): boolean {
        // 커스텀 주소 검증 로직
    }
}

const wallet = createWallet({
    addressScheme: new CustomAddressScheme(),
});

API

니모닉 관련

  • generateMnemonic(strength?: number): string - 새 니모닉 생성
    • strength: 엔트로피 비트 수 (128=12단어, 256=24단어, 기본값: 128)
    • 지원 값: 128, 160, 192, 224, 256
  • validateMnemonic(mnemonic: string): boolean - 니모닉 검증
  • mnemonicToSeed(mnemonic: string, passphrase?: string): Uint8Array - 니모닉에서 seed 생성

지갑 관련

  • createWallet(options?: WalletOptions): Wallet - 새 지갑 생성
    • options.mnemonicStrength: 니모닉 엔트로피 비트 수 (128=12단어, 256=24단어, 기본값: 128)
    • options.addressScheme: 주소 체계 (기본값: HybridScheme)
    • options.bip44Path: BIP-44 경로 (기본값: "m/44'/0'/0'")
    • options.pqcDomain: PQC 도메인 분리 문자열 (기본값: "pqc-domain")
  • restoreWallet(mnemonic: string, options?: WalletOptions): Wallet - 니모닉으로 지갑 복구
  • wallet.getAddress(index: number): AddressInfo - 인덱스별 주소 생성

라이선스

MIT