@arc76/bitcoin
v1.6.2026080407
Published
Deterministic ARC76 account derivation for Bitcoin (native SegWit / bech32 addresses). https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0076.md
Downloads
387
Maintainers
Readme
@arc76/bitcoin
Deterministic ARC76 account derivation for Bitcoin.
Usage
npm i @arc76/bitcoin --saveimport * as bitcoin from "bitcoinjs-lib";
import { getAccount, getEmailAccount } from "@arc76/bitcoin";
const account = await getAccount(password); // slot 0, an ECPair keypair
const { address } = bitcoin.payments.p2wpkh({ pubkey: Buffer.from(account.publicKey) });
const wif = account.toWIF();
const emailAccount = await getEmailAccount(email, password);getAccount/getEmailAccount return an ecpair ECPairInterface, not a ready-made address —
use bitcoinjs-lib's payments.p2wpkh(...) (native SegWit / bech32, bc1..., the current
standard Bitcoin address type) to derive the address, and .toWIF() for the private key in
Wallet Import Format.
Please use a password of at least 50 characters for real accounts — the account's security is entirely the password's security.
⚠️ Same-curve chains share the literal same private key.
@arc76/bitcoin,@arc76/bitcoincash, and@arc76/ethereumderive the identical secp256k1 private key from the same password/email/slot — leaking the key on one of those chains leaks it on all of them. Use a different password (orslot) per chain if you need isolation.
