nbitcoin
Skill2 starsChanged 10 months agoMITView on GitHub
Utilizes NBitcoin for HD wallet operations (BIP32/39/44). Use when: Creating wallets, deriving keys from mnemonics, working with BIP44 derivation paths, or implementing hierarchical deterministic wallet features.
In this repository79 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- docs/llms-full.txtllms.txt
- llms.txtllms.txt
- aspireSkill
- aspnet-coreSkill
- blazorSkill
- blueprint-builderSkill
- configuring-opentelemetry-dotnetSkill
- coverage-analysisSkill
- coverletSkill
- cryptographySkill
- database-expertSkill
- dockerSkill
- dotnetSkill
- entity-framework-coreSkill
- entity-frameworkSkill
- fluent-assertionsSkill
- frontend-designSkill
- grpcSkill
- jwtSkill
- mcpSkill
- microsoft-extensionsSkill
- migrate-xunit-to-xunit-v3Skill
- minimal-api-file-uploadSkill
- minimal-apisSkill
- mongodbSkill
- moqSkill
- network-bootstrapSkill
- nunitSkill
- optimizing-ef-core-queriesSkill
- playwrightSkill
- postgresqlSkill
- prodexecSkill
- redisSkill
- scalarSkill
- signalrSkill
- sorcha-appSkill
- sorcha-architectureSkill
- sorcha-cliSkill
- sorcha-uiSkill
- speckit-agent-context-updateSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-git-commitSkill
- speckit-git-featureSkill
- speckit-git-initializeSkill
- speckit-git-remoteSkill
- speckit-git-validateSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
- verifiable-credentialsSkill
- walkthrough-builderSkill
- worker-servicesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 99
Use mcp__context7__resolve-library-id to search for "nbitcoin"
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
NBitcoin Skill
NBitcoin provides HD wallet operations in Sorcha through the Sorcha.Wallet.Core project. The codebase wraps NBitcoin types in domain value objects (Mnemonic, DerivationPath) and uses them exclusively for BIP32/39/44 key derivation—NOT for transaction building. Actual signing uses Sorcha.Cryptography (ED25519, P-256, RSA-4096).
Quick Start
Generate a Mnemonic
// src/Core/Sorcha.Wallet.Core/Domain/ValueObjects/Mnemonic.cs
var mnemonic = Mnemonic.Generate(12); // or 24 for higher security
// NEVER log mnemonic.Phrase - use mnemonic.ToString() which returns "Mnemonic(12 words)"Derive Keys at BIP44 Path
// src/Core/Sorcha.Wallet.Core/Services/Implementation/KeyManagementService.cs:62-111
var masterKey = await _keyManagement.DeriveMasterKeyAsync(mnemonic, passphrase);
var path = DerivationPath.CreateBip44(coinType: 0, account: 0, change: 0, addressIndex: 0);
var (privateKey, publicKey) = await _keyManagement.DeriveKeyAtPathAsync(masterKey, path, "ED25519");Validate a Mnemonic
if (Mnemonic.IsValid(userProvidedPhrase))
{
var mnemonic = new Mnemonic(userProvidedPhrase);
}Key Concepts
| Concept | Usage | Example |
Mnemonic | Wraps NBitcoin.Mnemonic | Mnemonic.Generate(12) |
DerivationPath | Wraps NBitcoin.KeyPath | DerivationPath.CreateBip44(0, 0, 0, 0) |
ExtKey | Extended private key | ExtKey.CreateFromSeed(masterKey) |
| System Paths | Sorcha-specific aliases | "sorcha:register-attestation" → "m/44'/0'/0'/0/100" |
| Gap Limit | BIP44: max 20 unused addresses | Enforced in WalletManager.cs:493-508 |
Common Patterns
Wallet Creation Flow
When: User creates a new wallet.
// 1. Generate mnemonic (NEVER store on server)
var mnemonic = Mnemonic.Generate(12);
// 2. Derive master key with optional passphrase
var masterKey = await _keyManagement.DeriveMasterKeyAsync(mnemonic, passphrase);
// 3. Derive first key at m/44'/0'/0'/0/0
var path = DerivationPath.CreateBip44(0, 0, 0, 0);
var (privateKey, publicKey) = await _keyManagement.DeriveKeyAtPathAsync(masterKey, path, algorithm);
// 4. Encrypt private key before storage
var (encryptedKey, keyId) = await _keyManagement.EncryptPrivateKeyAsync(privateKey, string.Empty);System Path Resolution
When: Using Sorcha-specific derivation purposes.
// src/Common/Sorcha.Wallet.Contracts/Constants/SorchaDerivationPaths.cs
var resolvedPath = SorchaDerivationPaths.IsSystemPath(derivationPath)
? SorchaDerivationPaths.ResolvePath(derivationPath) // "sorcha:register-attestation" → "m/44'/0'/0'/0/100"
: derivationPath;See Also
- patterns - Value objects, key derivation, security patterns
- workflows - Wallet creation, recovery, address management
Related Skills
- See the cryptography skill for signing operations (ED25519, P-256, RSA-4096)
- See the dotnet skill for .NET 10 patterns and DI configuration
- See the xunit skill and fluent-assertions skill for testing HD wallet operations
Documentation Resources
Fetch latest NBitcoin documentation with Context7.
How to use Context7:
- Use
mcp__context7__resolve-library-idto search for "nbitcoin" - Query with
mcp__context7__query-docsusing the resolved library ID
Library ID: /metacosa/nbitcoin
Recommended Queries:
- "NBitcoin BIP32 BIP39 BIP44 key derivation"
- "NBitcoin ExtKey master key child derivation"
- "NBitcoin Mnemonic passphrase seed"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

