Skip to content

Releases: nGoline/NLightning

Release NLightning.Domain v1.1.0

22 Sep 18:54
e0433a1

Choose a tag to compare

What's Changed

  • Fix behavior when connection drops by @nGoline in #56
  • Allow for extensible BitcoinNetwork by @nGoline in #57

Full Changelog: bolt11-v4.0.0...domain-v1.1.0

Release NLightning.Infrastructure.Bitcoin v0.0.1

18 Jun 21:17
d7e4eec

Choose a tag to compare

What's Changed

Initial release for NLightning.Infrastructure.Bitcoin

NLightning.Infrastructure.Bitcoin is a dedicated component within the NLightning ecosystem, providing essential
Bitcoin-specific infrastructure services for Lightning Network implementations in . NET. This library focuses on
integrating Bitcoin functionalities, leveraging the NBitcoin library.

Related PRs

Release NLightning.Infrastructure v1.0.0

18 Jun 21:14
d7e4eec

Choose a tag to compare

What's Changed

This version captures the major refactoring effort where Bitcoin-specific functionalities were moved to a dedicated NLightning.Infrastructure.Bitcoin package, and the core infrastructure was updated with new services and breaking changes to improve modularity and robustness.

🚀 Added

  • Implemented TcpService and its interface ITcpService for handling TCP connections.
  • Introduced TransportService to manage the underlying transport layer.
  • Added PeerDisconnectedEventArgs for domain-level peer disconnection events.
  • Added NewPeerConnectedEventArgs for transport-layer new peer connection events.
  • Introduced Role enum (Initiator, Responder) to provide clarity in the handshake process.
  • Added implicit operators to SecureMemory for easier Span<byte> and ReadOnlySpan<byte> conversion.
  • Added targets for bundling LibsodiumJs and its dependencies into blazorSodium.bundle.js for NLightning.Infrastructure.Blazor.

🔧 Modified

  • Split the original Peer responsibilities into PeerService and PeerCommunicationService to better separate peer lifecycle management from communication.
  • Signatures for cryptographic methods in NativeCryptoProvider, including AeadChaCha20Poly1305IetfEncrypt and AeadChaCha20Poly1305IetfDecrypt, were updated for clarity and consistency.
  • Methods InsertSecret and DeriveOldSecret in SecretStorageService now use the domain-specific Secret type for improved type safety.
  • Constructors and methods within handshake components were adjusted to align with protocol updates.

⚠️ Breaking Changes

  • Removed direct dependencies on NBitcoin and NBitcoin.Secp256k1. Projects consuming NLightning.Infrastructure that relied on these packages transitively must now reference NLightning.Infrastructure.Bitcoin or add direct references themselves.
  • Moved core components to NLightning.Infrastructure.Bitcoin:
    • Cryptographic classes: NLightningContext, Ecdh, Ripemd160, and KeyPair.
    • Utility class Bech32Encoder.
    • Service KeyDerivationService.
  • The legacy peer management system (including Peer, IPeer, PeerFactory, PeerManager) has been removed and superseded by the new PeerService architecture.
  • As detailed in the "Modified" section, changes to method signatures in NativeCryptoProvider and SecretStorageService are breaking.
  • The modification to the PubKey property in PeerAddress to use a domain-specific type constitutes a breaking change.
  • Removed PingPongServiceFactory.cs and the CommitmentNumber.cs data model.

Related PRs

Full Changelog: infrastructure-v0.0.2...infrastructure-v1.0.0

Release NLightning.Domain v1.0.0

18 Jun 21:23
d7e4eec

Choose a tag to compare

What's Changed

This release marks a major refactoring of the NLightning.Domain layer. The focus has been on establishing a robust and abstract core by refining channel management, standardizing protocol messages, and decoupling the domain from external libraries.

The primary goal of these changes is to create a solid foundation for building advanced Lightning Network features with clear separation of concerns.

🚀 Added

  • Internal Domain Primitives: Introduced new value objects for Bitcoin concepts (e.g., TxId, BitcoinScript, CompactPubKey, Secret) to abstract away dependencies on external libraries like NBitcoin.
  • Rich Channel Models: Added comprehensive models for core channel components, including ChannelModel, ChannelKeySetModel, and detailed configuration objects like ChannelConfig and ChannelBasepoints.
  • Standardized Factories and Services: Introduced new factories (ChannelFactory, CommitmentTransactionModelFactory) and service interfaces (ILightningSigner, ICommitmentKeyDerivationService) to support the new domain models.
  • Protocol Message Handling: Added new factories and interfaces for creating and serializing protocol messages, promoting consistency.
  • The BitReader and BitWriter utilities were moved from NLightning.Common to become part of the core domain logic.

🔧 Modified

  • Protocol Message Restructuring: Core messages like OpenChannel1Message and their payloads were updated with dedicated properties and modern TLV field support.
  • Domain Primitive Enhancements: Made significant updates to LightningMoney for arithmetic operations and improved feature handling in FeatureSet.
  • Widespread Reorganization: To improve structure, many types and interfaces were moved to more specific namespaces (e.g., NLightning.Domain/Channels, NLightning.Domain/Bitcoin, NLightning.Domain/Protocol). Service interfaces were moved to dedicated Interfaces sub-namespaces.

⚠️ Breaking Changes

  • Removed NBitcoin Dependency: The direct package reference to NBitcoin has been removed. Consumers relying on NBitcoin types must now add a direct reference or adapt to the new abstractions provided in NLightning.Domain.Bitcoin.*.
  • Core Type Relocations:
    • Channel has been renamed to ChannelModel.
    • Network is now BitcoinNetwork.
    • ChannelId, ChannelState, ShortChannelId, and many other types have been moved to more specific sub-namespaces. This will require updates to using statements.
  • Interface Removals and Moves:
    • Interfaces like ICommitmentTransactionFactory and IFundingTransactionFactory have been removed.
    • Key interfaces like IMessageFactory and ISecureKeyManager have been moved to the NLightning.Domain.Protocol.Interfaces namespace.
  • The extensive refactoring and addition of new types have resulted in breaking changes to method signatures, constructors, and properties across the domain layer.

Related PRs

Full Changelog: domain-v0.0.1...domain-v1.0.0

Release NLightning.Bolt11 v4.0.0

18 Jun 21:05
d7e4eec

Choose a tag to compare

What's Changed

This release enhances invoice robustness by introducing a dedicated validation service and stricter field checks. It also improves API consistency and strengthens null-safety across the library.

🚀 Added

  • A new InvoiceValidationService has been introduced for more robust validation during the invoice decoding process.
  • Error handling is now more descriptive, with detailed ArgumentException messages for missing or invalid fields.
  • Enhanced null-safety with [DisallowNull] attributes applied to key properties like PaymentHash, PaymentSecret, and PayeePubKey.
  • Improved nullability annotations for the TaggedFieldList.TryGet<T> method using [MaybeNullWhen(false)].

🔧 Modified

  • The TaggedFieldList.Add method now validates fields before they are added.
  • Validation for several tagged fields has been made stricter:
    • DescriptionTaggedField now correctly validates the description's length in bytes.
    • DescriptionHashTaggedField, PaymentHashTaggedField, and PaymentSecretTaggedField now treat all-zero or all-one hash values as invalid.

⚠️ Breaking Changes

  • The Invoice constructors were changed to accept a BitcoinNetwork object instead of Network to align better with the NLightning domain.

New Contributors

Related PRs

Full Changelog: bolt11-v3.0.1...bolt11-v4.0.0