Nbitcoin

From claude-dev-suite/claude-dev-suite · View interactive version

Nbitcoin is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. 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 to use this skill

Skill file

NBitcoin

The .NET / C# Bitcoin library by Nicolas Dorier. Powers BTCPay

Server, NBXplorer, and many enterprise .NET integrations.

Repo: github.com/MetacoSA/NBitcoin.

Install

dotnet add package NBitcoin

Quick example

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

Companion projects

Use cases

Common pitfalls

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.