bitcoin-libraries-scure-btc-signer

v2026.09.24

@scure/btc-signer: modern audited Bitcoin signer in TypeScript. Pure functional, minimal dependencies, browser-friendly. USE WHEN: building modern web/mobile Bitcoin apps, evaluating bitcoinjs-lib alternative.

GitHub
安装命令
npx skhub add claude-dev-suite/bitcoin-libraries-scure-btc-signer
Markdown
SKILL.md

@scure/btc-signer

Modern Bitcoin library by Paul Miller (paulmillr.com). Audited by Trail of Bits. Smaller, cleaner API than bitcoinjs-lib.

Repo: github.com/paulmillr/scure-btc-signer.

Install

npm install @scure/btc-signer

Quick examples

Address generation

import * as btc from "@scure/btc-signer";
import { hex } from "@scure/base";

const sk = hex.decode("000...01");
const pk = btc.utils.privateAdd(sk, sk);   // example
const addr = btc.WIF().encode(sk);   // WIF
const p2wpkh = btc.p2wpkh(secp.getPublicKey(sk));
console.log(p2wpkh.address);   // bc1q...

PSBT

const tx = new btc.Transaction();
tx.addInput({
    txid: "...",
    index: 0,
    witnessUtxo: { script: spk, amount: 100000n },
});
tx.addOutputAddress(destAddr, 99000n, btc.NETWORK);
tx.sign(sk);
tx.finalize();
const rawTx = tx.extract();

Taproot

const tr = btc.p2tr(internalPubkey);
console.log(tr.address);   // bc1p...

Companion

  • @scure/bip32 — HD derivation.
  • @scure/bip39 — mnemonic.
  • @noble/curves — secp256k1 (used internally).

Compared

See bitcoinjs-lib/SKILL.md for comparison.

Use cases

  • Modern browser wallets (smaller bundle).
  • React Native (better browser-compat than bitcoinjs-lib).
  • Server apps wanting audited library.

Common pitfalls

  • Newer ecosystem; some integrations not yet ported.
  • BigInt used throughout; older browsers need polyfill.

See also

发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

MIT

源路径

skills/bitcoin/libraries/scure-btc-signer

默认分支

main

最新提交

9496306

Tree SHA

fe4e2f1