brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
bitcoin-libraries-scure-btc-signer@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.
Independent GitHub snapshot · Automated classification · Original documentation governs
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.
npm install @scure/btc-signer
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...
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();
const tr = btc.p2tr(internalPubkey);
console.log(tr.address); // bc1p...
@scure/bip32 — HD derivation.@scure/bip39 — mnemonic.@noble/curves — secp256k1 (used internally).See bitcoinjs-lib/SKILL.md for comparison.