NLightning.Infrastructure.Blazor 0.0.1

Suggested Alternatives

NLightning.Infrastructure.Blazor 0.0.2

Additional Details

This package doesn't work with Blazor WebAssembly Apps using the framework `net9.0`. Please install the latest version to publish Blazor WebAssembly Apps.

There is a newer version of this package available.
See the version list below for details.
dotnet add package NLightning.Infrastructure.Blazor --version 0.0.1
                    
NuGet\Install-Package NLightning.Infrastructure.Blazor -Version 0.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NLightning.Infrastructure.Blazor" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NLightning.Infrastructure.Blazor" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="NLightning.Infrastructure.Blazor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NLightning.Infrastructure.Blazor --version 0.0.1
                    
#r "nuget: NLightning.Infrastructure.Blazor, 0.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NLightning.Infrastructure.Blazor@0.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NLightning.Infrastructure.Blazor&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=NLightning.Infrastructure.Blazor&version=0.0.1
                    
Install as a Cake Tool

NLightning.Infrastructure

NLightning.Infrastructure is a core component of the NLightning ecosystem, providing essential infrastructure services for Lightning Network implementations in .NET. This library serves as a bridge between the application and domain layers and external dependencies.

Features

  • Cross-platform cryptographic operations with support for:
    • Native environments (AOT/Native) using BouncyCastle and Argon2
    • Server/desktop environments using libsodium
    • Blazor WebAssembly using JavaScript interop and libsodium.js
  • Bitcoin and Lightning Network integration via NBitcoin
  • DNS resolution capabilities
  • Comprehensive logging support

Installation

Install the package from NuGet:

dotnet add package NLightning.Infrastructure

Configuration

NLightning.Infrastructure automatically adapts to your build environment:

  • For AOT/Native builds, it uses BouncyCastle and Argon2
  • For standard .NET applications, it uses libsodium
  • For Blazor WebAssembly, it provides JavaScript interoperability

Blazor WebAssembly Setup

When using in a Blazor WebAssembly project, you need to initialize the crypto provider:

using NLightning.Infrastructure.Crypto.Providers.JS;

// Initialize before starting the app
await BlazorCryptoProvider.InitializeBlazorCryptoProviderAsync();

await builder.Build().RunAsync();

Usage

NLightning.Infrastructure is primarily used by other NLightning components, but you can also use it directly for:

// Crypto operations, networking, and other infrastructure services
// Detailed documentation coming soon

Dependencies

  • NBitcoin and NBitcoin.Secp256k1 for Bitcoin operations
  • Cryptographic libraries (BouncyCastle, Argon2, or libsodium depending on environment)
  • DnsClient for DNS resolution
  • Microsoft.Extensions.Logging for logging infrastructure
  • NLightning.Application
  • NLightning.Common
  • NLightning.Domain
  • NLightning.Bolt11
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NLightning.Infrastructure.Blazor:

Package Downloads
NLightning.Bolt11.Blazor

A Bitcoin Lightning Invoice Decoder/Encoder implemented in C#

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 141 6/18/2025
0.0.2 151 5/21/2025
0.0.1 238 5/20/2025 0.0.1 is deprecated because it has critical bugs.

Initial release of NLightning.Infrastructure library.