.NET bindings and high-level library for libbitcoinkernel, providing access to Bitcoin Core's consensus and validation logic.
This library uses libbitcoinkernel which is in an experimental state, do not use for production purposes.
BitcoinKernel.NET brings Bitcoin Core's robust consensus engine to .NET applications through a clean, idiomatic C# API. Built on top of libbitcoinkernel, it provides everything from low-level P/Invoke bindings to high-level abstractions for common Bitcoin operations.
| Package | Version | Description |
|---|---|---|
| BitcoinKernel | 0.1.0 | High-level API with fluent builder pattern |
| BitcoinKernel.Core | 0.1.0 | Managed wrappers and native bindings |
dotnet add package BitcoinKernelor
dotnet add package BitcoinKernel.CoreThe library is organized in three layers:
- BitcoinKernel.Interop - P/Invoke bindings to libbitcoinkernel (bundled, not published separately)
- BitcoinKernel.Core - Managed C# wrappers with automatic memory management
- BitcoinKernel - High-level facade with fluent API
┌─────────────────────────────┐
│ BitcoinKernel │ ← Fluent API, simple usage
│ (Facade Layer) │
└─────────────┬───────────────┘
│
┌─────────────▼───────────────┐
│ BitcoinKernel.Core │ ← Managed wrappers, IDisposable
│ (Wrapper Layer) │
└─────────────┬───────────────┘
│
┌─────────────▼───────────────┐
│ BitcoinKernel.Interop │ ← P/Invoke bindings
│ (Binding Layer) │
└─────────────┬───────────────┘
│
┌─────────────▼───────────────┐
│ libbitcoinkernel │ ← Native C library
│ (Bitcoin Core) │
└─────────────────────────────┘
Explore the examples directory for complete working samples:
- BasicUsage - Getting started with the high-level API
- BlockProcessing - Block validation and chain management
- .NET 9.0 SDK or later
git clone https://github.com/janb84/BitcoinKernel.NET.git
cd BitcoinKernel.NET
dotnet builddotnet testThis package includes pre-built libbitcoinkernel binaries for:
- macOS (x64, ARM64)
- others will follow
For other platforms, for now, you'll need to build libbitcoinkernel from the Bitcoin Core repository.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built on libbitcoinkernel from Bitcoin Core
Note: This library provides access to Bitcoin Core's consensus engine. The libbitcoinkernel and this package is stil experimental and not ready for production use.