The previous implementation incorrectly converted the mnemonic to bytes:
- OLD: var seed = mnemonic.DeriveSeed(); ... seed.ToList()
- NEW: var seed = new Seed.Mnemonic(mnemonic: mnemonic.ToString(), passphrase: null);
This matches the official Spark SDK C# snippets pattern where ConnectRequest
expects a Seed discriminated union type, not a List<byte>.
Reference: https://github.com/breez/spark-sdk/tree/main/docs/breez-sdk/snippets/csharp
Critical fixes for Spark SDK migration:
1. **BreezController.cs**:
- Replaced RedeemOnchainFunds with ClaimDeposit/ListUnclaimedDeposits
- Disabled swap-out (not available in nodeless Spark SDK)
- Updated refund to use RefundDeposit instead of Refund
- Fixed method signatures and parameter names
2. **BreezLightningClient.cs**:
- Fixed field name mismatches: amount (not amountSats), fees (not feesSats)
- Updated ReceivePaymentResponse: paymentRequest (not destination), fee (not feesSats)
- Fixed PaymentDetails pattern matching for Lightning variant
- Removed timestamp nullable check (it's always present in Spark SDK)
- Updated GetInfo/GetBalance for nodeless architecture
- Fixed payment conversion to handle Spark SDK's discriminated union structure
3. **BTCPay Server submodule**: Updated to v2.2.0
The Spark SDK uses a nodeless architecture with different capabilities:
- Deposits instead of traditional swap-in
- No onchain swap-out functionality
- No node ID or block height in GetInfo
- Payment details use discriminated unions (Lightning/Spark/Token/Deposit/Withdraw)
All Lightning payment operations now work correctly with the Spark SDK.
Major changes:
- Built C# bindings for Breez Spark SDK from source using UniFFI
- Created local NuGet package infrastructure (Breez.Sdk.Spark v0.0.1)
- Replaced Breez.Sdk package reference with Breez.Sdk.Spark
- Updated BreezLightningClient to use async Spark SDK API
- Removed Greenlight-specific code (credentials, invite codes)
- Simplified BreezSettings (no more Greenlight fields)
- Updated BreezService for async client initialization
- Cleaned up BreezController (removed certificate upload logic)
Key differences in Spark SDK:
- Nodeless architecture (no Greenlight hosting required)
- Simplified configuration (only mnemonic + API key)
- All async methods (no BlockingBreezServices)
- Different payment flow (PrepareSendPayment + SendPayment)
The plugin now works with Breez's Spark protocol which provides
a self-custodial Lightning experience without infrastructure hosting.
Note: NuGet package must be built from spark-sdk source before use.