Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@ledgerhq/hw-app-btc

Latest version: v13.0.0-nightly.20261125083912

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
npm package Publisher: gbrahm-ledger, ldg-github-ci, ledger-releaser, phenry-ledger, sergii-shkolin, vbouzon
633 Stars
501 Forks
57 Versions
77.9K Downloads
TypeScript Repo language

Scan summary

@ledgerhq/hw-app-btc was last scanned on 25 Nov 2026 at version 13.0.0-nightly.20261125083912. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 57 versions; the latest 5 were published within 5 days (21–25 Nov 2026).
  • Findings: No rules fired in version 13.0.0-nightly.20261125083912.
  • Downloads: 77,862 downloads.

Versions

57 versions published
Versions and the rules that fired in each
VersionPublishedStatus
13.0.0-nightly.20261125083912 LATEST 25 Nov 2026 No rules fired
13.0.0-nightly.20261125020400 25 Nov 2026 No rules fired
12.4.0 24 Nov 2026 No rules fired
12.4.0-nightly.20261124020210 24 Nov 2026 Not shown
12.4.0-nightly.20261121020412 21 Nov 2026 Not shown

No rules fired in 13.0.0-nightly.20261125083912

Findings

Findings for v13.0.0-nightly.20261125083912. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 13.0.0-nightly.20261125083912; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

GitHub, Ledger Devs Discord, Developer Portal

@ledgerhq/hw-app-btc

[!WARNING] Status: DEPRECATED — Replaced by the Device Management Kit (DMK). Migrate to @ledgerhq/device-signer-kit-bitcoin.

Ledger Hardware Wallet BTC JavaScript bindings. Also supports many altcoins.


Are you adding Ledger support to your software wallet?

You may be using this package to communicate with the Bitcoin Nano App.

For a smooth and quick integration:

  • See the developers’ documentation on the Developer Portal and
  • Go on Discord to chat with developer support and the developer community.

API

Table of Contents
  • bippath
  • deriveChildPublicKey
    • Parameters
  • Btc
    • Parameters
    • Examples
    • getWalletXpub
      • Parameters
    • getWalletPublicKey
      • Parameters
      • Examples
    • signMessage
      • Parameters
      • Examples
    • createPaymentTransaction
      • Parameters
      • Examples
    • signPsbtBuffer
      • Parameters
    • signP2SHTransaction
      • Parameters
      • Examples
    • splitTransaction
      • Parameters
      • Examples
    • serializeTransactionOutputs
      • Parameters
      • Examples
    • getTrustedInput
      • Parameters
    • getTrustedInputBIP143
      • Parameters
  • BtcNew
    • getWalletXpub
      • Parameters
    • getWalletPublicKey
      • Parameters
    • createPaymentTransaction
      • Parameters
    • signPsbtBuffer
      • Parameters
    • signMessage
      • Parameters
  • descrTemplFrom
    • Parameters
  • BtcOld
    • getWalletPublicKey
      • Parameters
      • Examples
    • createPaymentTransaction
      • Parameters
      • Examples
  • CreateTransactionArg
    • Properties
  • AddressFormat
  • computeTaprootOutputKey
    • Parameters
  • AccountType
    • spendingCondition
      • Parameters
    • setInput
      • Parameters
    • setOwnOutput
      • Parameters
    • getDescriptorTemplate
  • SingleKeyAccount
  • getTaprootOutputKey
    • Parameters
  • AppClient
    • Parameters
  • ClientCommandInterpreter
    • Parameters
  • MerkelizedPsbt
    • Parameters
  • Merkle
    • Parameters
  • MerkleMap
    • Parameters
  • WalletPolicy
    • Parameters
  • extract
    • Parameters
  • finalize
    • Parameters
  • clearFinalizedInput
    • Parameters
  • writePush
    • Parameters
  • serializeTransactionOutputs
    • Parameters
    • Examples
  • SignP2SHTransactionArg
    • Properties
  • determineAccountType
    • Parameters
  • getDerivationAccessors
    • Parameters
  • checkElementBip32Derivation
    • Parameters
  • extractAccountPath
    • Parameters
  • checkOutputBip32Derivation
    • Parameters
  • getScriptPubKeyFromNonWitnessUtxo
    • Parameters
  • getInputScriptPubKey
    • Parameters
  • fixDerivationFingerprints
    • Parameters
  • setElementBip32DerivationData
    • Parameters
  • populateMissingBip32Derivations
    • Parameters
  • determineInputScriptType
    • Parameters
  • analyzeInput
    • Parameters
  • analyzeAllInputs
    • Parameters
  • deserializePsbt
    • Parameters
  • createWalletPolicy
    • Parameters
  • createProgressCallback
    • Parameters
  • finalizePsbtAndExtract
    • Parameters
  • KnownAddressDerivationsMap
  • SignPsbtBufferOptions
    • knownAddressDerivations
  • DerivationElementType
  • DerivationAccessors
  • ScriptType
  • splitSaplingPart
    • Parameters
  • splitOrchardPart
    • Parameters
  • TransactionInput
  • TransactionOutput
  • Transaction
  • SaplingData
bippath

BIP32 Path Handling for Bitcoin Wallets

This file provides utility functions to handle BIP32 paths, which are commonly used in hierarchical deterministic (HD) wallets. It includes functions to convert BIP32 paths to and from different formats, extract components from extended public keys (xpubs), manipulate path elements, and derive child public keys locally (for non-hardened derivation).

deriveChildPublicKey

Derives a child public key from a parent public key using BIP32 non-hardened derivation. This allows deriving child keys locally without device interaction.

Parameters
  • parentPubkey Buffer The parent compressed public key (33 bytes)
  • parentChaincode Buffer The parent chaincode (32 bytes)
  • index number The child index (must be non-hardened, i.e., < 0x80000000)
  • Throws any Error if attempting hardened derivation or invalid inputs

Returns {pubkey: Buffer, chaincode: Buffer} The derived child public key and chaincode

Btc

Bitcoin API.

Parameters
  • transport The transport layer used for communication.
  • scrambleKey This parameter is deprecated and no longer needed.
  • currency The currency to use, defaults to "bitcoin".
Examples
import Btc from "@ledgerhq/hw-app-btc";
const btc = new Btc({ transport, currency: "bitcoin" });
getWalletXpub

Get an XPUB with a ledger device

Parameters
  • arg {path: string, xpubVersion: number} derivation parameter* path: a BIP 32 path of the account level. (e.g. The derivation path 84'/0'/0' follows the purpose' / coin_type' / account' standard, with purpose=84, coin_type=0, account=0)
    • xpubVersion: the XPUBVersion of the coin used. (refer to @domain/entity-currency-crypto for the XPUBVersion value if needed)

Returns Promise\<string> XPUB of the account

getWalletPublicKey
Parameters
  • path string a BIP 32 path (i.e. the purpose’ / coin_type’ / account’ / change / address_index standard)

  • opts {verify: boolean?, format: AddressFormat?}?

  • options an object with optional these fields:* verify (boolean) whether ask user to confirm the address on the device

    • format ("legacy" | "p2sh" | "bech32" | "bech32m" | "cashaddr") to use different bitcoin address formatter.NB The normal usage is to use:* legacy format with 44' paths

    • p2sh format with 49' paths

    • bech32 format with 84' paths

    • bech32m format with 86' paths

    • cashaddr in case of Bitcoin Cash

Examples
btc.getWalletPublicKey("44'/0'/0'/0/0").then(o => o.bitcoinAddress)
btc.getWalletPublicKey("49'/0'/0'/0/0", { format: "p2sh" }).then(o => o.bitcoinAddress)

Returns Promise\<{publicKey: string, bitcoinAddress: string, chainCode: string}>

signMessage

You can sign a message according to the Bitcoin Signature format and retrieve v, r, s given the message and the BIP 32 path of the account to sign.

Parameters
Examples
btc.signMessage("44'/60'/0'/0'/0", Buffer.from("test").toString("hex")).then(function(result) {
var v = result['v'] + 27 + 4;
var signature = Buffer.from(v.toString(16) + result['r'] + result['s'], 'hex').toString('base64');
console.log("Signature : " + signature);
}).catch(function(ex) {console.log(ex);});

Returns Promise\<{v: number, r: string, s: string}>

createPaymentTransaction

To sign a transaction involving standard (P2PKH) inputs, call createTransaction with the following parameters

Parameters
  • arg CreateTransactionArg
  • inputs is an array of [ transaction, output_index, optional redeem script, optional sequence ] where* transaction is the previously computed transaction object for this UTXO
    • output_index is the output in the transaction used as input for this UTXO (counting from 0)
    • redeem script is the optional redeem script to use when consuming a Segregated Witness input
    • sequence is the sequence number to use for this input (when using RBF), or non present
  • associatedKeysets is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
  • changePath is an optional BIP 32 path pointing to the path to the public key used to compute the change address
  • outputScriptHex is the hexadecimal serialized outputs of the transaction to sign, including leading vararg voutCount
  • lockTime is the optional lockTime of the transaction to sign, or default (0)
  • sigHashType is the hash type of the transaction to sign, or default (all)
  • segwit is an optional boolean indicating wether to use segwit or not. This includes wrapped segwit.
  • additionals list of additionnal options* "bech32" for spending native segwit outputs
    • "bech32m" for spending segwit v1+ outputs
    • "abc" for bch
    • "gold" for btg
    • "decred" for decred
    • "zcash" for zcash
    • "bipxxx" for using BIPxxx
    • "sapling" to indicate a zec transaction is supporting sapling (to be set over block 419200)
  • expiryHeight is an optional Buffer for zec overwinter / sapling Txs
  • useTrustedInputForSegwit trust inputs for segwit transactions. If app version >= 1.4.0 this should be true.
Examples
btc.createTransaction({
inputs: [ [tx1, 1] ],
associatedKeysets: ["0'/0/0"],
outputScriptHex: "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
}).then(res => ...);

Returns Promise\<string> the signed transaction ready to be broadcast

signPsbtBuffer

Signs a PSBT buffer using the Bitcoin app (new protocol).

  • If the PSBT is v2, it is deserialized directly.
  • If the PSBT is v0, it is converted to v2 internally.
  • The account type (legacy, wrapped segwit, native segwit, taproot) is inferred from PSBT data when possible, or from the provided options.

Note: All internal inputs (inputs that can be signed by the device) must belong to the same account and use the same account type. Mixed input types or inputs from different accounts are not supported and will throw an error.

Parameters
  • psbtBuffer Buffer Raw PSBT buffer (v0 or v2) to be signed.

  • options SignPsbtBufferOptions Signing configuration.

    • options.finalizePsbt Whether to finalize the PSBT after signing. If true, the returned tx is a fully signed transaction ready for broadcast.
    • options.accountPath BIP32 account path (for example, "m/84'/0'/0'"). Required. Used to populate missing BIP32 derivation information when the PSBT lacks it, and as the signing account path.
    • options.addressFormat Explicit address format to use when the account type cannot be inferred from the PSBT ("legacy", "p2sh", "bech32", or "bech32m").
    • options.onDeviceSignatureRequested Callback when signature is about to be requested from device.
    • options.onDeviceSignatureGranted Callback when the first signature is granted by device.
    • options.onDeviceStreaming Callback to track signing progress with index and total.
    • options.knownAddressDerivations Map from scriptPubKey hash (hex) to { pubkey, path }. Required. Built by the caller from the wallet's known addresses (receive/change).

Returns Promise\<{psbt: Buffer, tx: string?}> An object containing:* psbt: the serialized PSBT (with signatures; finalized if finalizePsbt is true).

  • tx: the fully signed transaction hex string, only when finalizePsbt is true; omitted when not finalizing.
signP2SHTransaction

To obtain the signature of multisignature (P2SH) inputs, call signP2SHTransaction_async with the folowing parameters

Parameters
  • arg SignP2SHTransactionArg
  • inputs is an array of [ transaction, output_index, redeem script, optional sequence ] where* transaction is the previously computed transaction object for this UTXO
    • output_index is the output in the transaction used as input for this UTXO (counting from 0)
    • redeem script is the mandatory redeem script associated to the current P2SH input
    • sequence is the sequence number to use for this input (when using RBF), or non present
  • associatedKeysets is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
  • outputScriptHex is the hexadecimal serialized outputs of the transaction to sign
  • lockTime is the optional lockTime of the transaction to sign, or default (0)
  • sigHashType is the hash type of the transaction to sign, or default (all)
Examples
btc.signP2SHTransaction({
inputs: [ [tx, 1, "52210289b4a3ad52a919abd2bdd6920d8a6879b1e788c38aa76f0440a6f32a9f1996d02103a3393b1439d1693b063482c04bd40142db97bdf139eedd1b51ffb7070a37eac321030b9a409a1e476b0d5d17b804fcdb81cf30f9b99c6f3ae1178206e08bc500639853ae"] ],
associatedKeysets: ["0'/0/0"],
outputScriptHex: "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac"
}).then(result => ...);

Returns Promise\<Array\<string>> the signed transaction ready to be broadcast

splitTransaction

For each UTXO included in your transaction, create a transaction object from the raw serialized version of the transaction used in this UTXO.

Parameters
  • transactionHex string a raw hexadecimal serialized transaction
  • isSegwitSupported (boolean | null | undefined) is a boolean indicating if the segwit is supported (optional, default false)
  • hasExtraData is a boolean (komodo, zencash and zcash include extraData in their transactions, others don't) (optional, default false)
  • additionals Array\<string> list of additionnal options (optional, default [])
Examples

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @ledgerhq/hw-app-btc

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

PHP2Shell, Day 5 93.6% of Measurable Instances Still Unpatched (1)
Vulnerability Insights

PHP2Shell, Day 5: The Panic Hasn’t Turned Into Patching

Frame 2085668439 (1)
Group 1261154229