Skip to content
Skills Library
Programming · Building & coding

bitcoin-libraries-nbitcoin

/bitcoin-libraries-nbitcoin

NBitcoin: comprehensive .NET / C# Bitcoin library. Used by BTCPay Server, NBXplorer, many .NET tools. Tx, Script, PSBT, BIP32, HW wallet integration. USE WHEN: building .NET Bitcoin apps, integrating with BTCPay ecosystem.

Licence
MIT
Last repository change
21.10.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

NBitcoin: comprehensive .NET / C# Bitcoin library. Used by BTCPay Server, NBXplorer, many .NET tools. Tx, Script, PSBT, BIP32, HW wallet integration. USE WHEN: building .NET Bitcoin apps, integrating with BTCPay ecosystem.

Original author description

NBitcoin: comprehensive .NET / C# Bitcoin library. Used by BTCPay Server, NBXplorer, many .NET tools. Tx, Script, PSBT, BIP32, HW wallet integration. USE WHEN: building .NET Bitcoin apps, integrating with BTCPay ecosystem.

How it works

  1. Install
  2. Quick example
  3. Features
  4. Companion projects
  5. Use cases
  6. Common pitfalls
  7. See also
Original SKILL.md headings · 68 lines, 188 words
SKILL.md preview
---
name: bitcoin-libraries-nbitcoin
description: |
  NBitcoin: comprehensive .NET / C# Bitcoin library. Used by BTCPay
  Server, NBXplorer, many .NET tools. Tx, Script, PSBT, BIP32, HW
  wallet integration.
  USE WHEN: building .NET Bitcoin apps, integrating with BTCPay
  ecosystem.
allowed-tools: Read, Grep, Glob
---

# NBitcoin

The .NET / C# Bitcoin library by Nicolas Dorier. Powers BTCPay
Server, NBXplorer, and many enterprise .NET integrations.

Repo: `github.com/MetacoSA/NBitcoin`.

## Install

```bash
dotnet add package NBitcoin
```

## Quick example

```csharp
using NBitcoin;

var network = Network.Main;
var key = new Key();   // random
var addr = key.PubKey.GetAddress(ScriptPubKeyType.Segwit, network);
Console.WriteLine(addr);   // bc1q...

// Tx
var tx = network.CreateTransaction();
tx.Inputs.Add(new TxIn(new OutPoint(...), null));
tx.Outputs.Add(new TxOut(Money.Coins(0.001m), addr));

// PSBT
var psbt = PSBT.FromTransaction(tx, network);
psbt.AddCoins(prevOuts);
psbt.SignAll(ScriptPubKeyType.Segwit, key);
var finalTx = psbt.Finalize().ExtractTransaction();
```

## Features

- Full tx + script support, all output types.
- BIP32/39 HD wallets.
- PSBT (BIP174).
- Taproot, miniscript, descriptors.
- HW wallet integration via HWI subprocess.
- Lightning (BOLT11) decode.
- RPC client.
- Custom networks (Bitcoin Cash, Liquid, etc.).

## Companion projects

- **NBXplorer** — wallet management on top of NBitcoin.
- **BTCPay Server** — uses NBitcoin extensively.

## Use cases

- .NET enterprise Bitcoin integration.
- BTCPay plugin development.
- Windows-native Bitcoin tools.

## Common pitfalls

- API surface large; some patterns vary across versions.
- Cross-platform: .NET Core for Linux/Mac; otherwise Windows.

## See also

- [../../infrastructure/btcpay/SKILL.md](../../infrastructure/btcpay/SKILL.md)
- [../../protocol/psbt/SKILL.md](../../protocol/psbt/SKILL.md)

Versions

The database has no other skills named bitcoin-libraries-nbitcoin.

Database snapshot: 13.11.2026 · package version c82ed1299e00 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95bitcoin-libraries-bitcoinjs-lib
    bitcoinjs-lib: TypeScript/JavaScript Bitcoin library. Tx, Script, Address, key types, PSBT, BIP32. Browser + Node. USE WHEN: building Bitcoin apps in JS/TS, server or browser.
  • 95bitcoin-libraries-rust-bitcoin
    rust-bitcoin: Rust crate for Bitcoin primitives. Tx, Block, Script, Address, Network, key types, PSBT, BIP32. Foundation for BDK, LDK, miniscript-rs. USE WHEN: building Bitcoin apps in Rust, parsing/constructing txs, working with addresses + scripts.
  • 85sodax-wallet-sdk-core-bitcoin
    Granular skill for the @sodax/wallet-sdk-core v2 Bitcoin wallet provider only — `BitcoinWalletProvider` (PSBT signing via bitcoinjs-lib + ecpair + bip322-js). Use when a backend / Node script / CI / bot / non-React browser flow needs to instantiate a Bitcoin provider directly…
  • 100senior-bitcoin-auditor
    Provides senior-level security auditing guidance for Bitcoin smart contracts including Taproot/Script, PSBT, UTXO management, Lightning Network, DLCs, and Bitcoin L2 protocols. Use when auditing Bitcoin contract code, PSBT builders, settlement engines, Lightning integrations, or…
  • 100bitcoin-proofs
    Verify Bitcoin transactions from Clarity: transaction parsing, Merkle proofs (clarity-bitcoin, Clarity 6 natives), BTC payment checks, replay protection, sBTC settlement. Use when a contract must react to a Bitcoin payment.
  • 100clarity-bitcoin-proofs
    Verify Bitcoin transactions from Clarity: transaction parsing, Merkle proofs (clarity-bitcoin, Clarity 6 natives), BTC payment checks, replay protection, sBTC settlement. Use when a contract must react to a Bitcoin payment.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.