Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- 'global.json'
- 'nuget.config'
- 'NuGet.config'
# NSpark (the Elenpay/nspark fork, git submodule), which the Spark client is built from
# NSpark (the Lunar-Rails/nspark fork, git submodule), which the Spark client is built from
- 'vendor/**'
- '.gitmodules'
# build/e2e harness that exercises the above
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/spark-dev-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
env:
OPEN_SSP_REPOSITORY: benthecarman/open-ssp
OPEN_SSP_SHA: 89525792d65d7e0f7092e9f6d66b5082c00e48ca
IMAGE_PREFIX: ghcr.io/elenpay/nodeguard-spark-dev
IMAGE_PREFIX: ghcr.io/lunar-rails/nodeguard-spark-dev

jobs:
build:
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
matrix:
image: [ operator, ldk-server, ssp ]
env:
IMAGE: ghcr.io/elenpay/nodeguard-spark-dev-${{ matrix.image }}
IMAGE: ghcr.io/lunar-rails/nodeguard-spark-dev-${{ matrix.image }}
steps:
- uses: actions/download-artifact@v8.0.2
with:
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
url = https://github.com/C-Otto/rebalance-lnd
[submodule "remote-signer"]
path = remote-signer
url = https://github.com/Elenpay/Nodeguard-Remote-Signer
url = https://github.com/Lunar-Rails/Nodeguard-Remote-Signer
branch = develop
[submodule "vendor/nspark"]
path = vendor/nspark
url = https://github.com/Elenpay/nspark.git
url = https://github.com/Lunar-Rails/nspark.git
branch = main
2 changes: 1 addition & 1 deletion .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ update-protos:
# Submodules #
##############

REMOTE_SIGNER_URL := 'https://github.com/Elenpay/Nodeguard-Remote-Signer'
REMOTE_SIGNER_URL := 'https://github.com/Lunar-Rails/Nodeguard-Remote-Signer'
REMOTE_SIGNER_DIR := 'remote-signer'

# Add the Remote Signer submodule, or initialize it on a fresh clone
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Pull requests are the best way to propose changes to the codebase. We actively w
## Any contributions you make will be under the AGPL Software License
In short, when you submit code changes, your submissions are understood to be under the same [AGPL License](http://choosealicense.com/licenses/agpl-3.0/) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](https://github.com/elenpay/nodeguard/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/elenpay/nodeguard/issues); it's that easy!
## Report bugs using Github's [issues](https://github.com/Lunar-Rails/NodeGuard/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/Lunar-Rails/NodeGuard/issues); it's that easy!

## Write bug reports with detail, background, and sample code
Here's an example:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# NodeGuard
![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/Elenpay/NodeGuard)
![GitHub](https://img.shields.io/github/license/Elenpay/NodeGuard)
[![Unit tests](https://github.com/Elenpay/NodeGuard/actions/workflows/dotnet.yml/badge.svg)](https://github.com/Elenpay/NodeGuard/actions/workflows/dotnet.yml)
[![Docker image build](https://github.com/Elenpay/NodeGuard/actions/workflows/docker.yaml/badge.svg)](https://github.com/Elenpay/NodeGuard/actions/workflows/docker.yaml)
![GitHub release (release name instead of tag name)](https://img.shields.io/github/v/release/Lunar-Rails/NodeGuard)
![GitHub](https://img.shields.io/github/license/Lunar-Rails/NodeGuard)
[![Unit tests](https://github.com/Lunar-Rails/NodeGuard/actions/workflows/dotnet.yml/badge.svg)](https://github.com/Lunar-Rails/NodeGuard/actions/workflows/dotnet.yml)
[![Docker image build](https://github.com/Lunar-Rails/NodeGuard/actions/workflows/docker.yaml/badge.svg)](https://github.com/Lunar-Rails/NodeGuard/actions/workflows/docker.yaml)

<p align="center">
<img src="nodeguard.png">
Expand All @@ -15,13 +15,13 @@ Current features of NodeGuard are the following:

- Asynchronous channel funding leveraging cold multisig wallets and hot wallets
- Multisig wallet creation and import (BIP39), only segwit for now
- Liquidity automation by settings rules in tandem with [NodeGuard liquidator](https://github.com/Elenpay/liquidator)
- Optional remote signing through [NodeGuard Remote Signer](https://github.com/Elenpay/Nodeguard-Remote-Signer) functions for channel funding transactions, separating the NodeGuard keys from the actual software
- Liquidity automation by settings rules in tandem with [NodeGuard liquidator](https://github.com/Lunar-Rails/ep-liquidator)
- Optional remote signing through [NodeGuard Remote Signer](https://github.com/Lunar-Rails/Nodeguard-Remote-Signer) functions for channel funding transactions, separating the NodeGuard keys from the actual software
- Automatic sweeping of funds in lightning nodes to avoid having funds on the node hot wallets
- Channel management
- Channel creation interception with returning address to multisig wallets to avoid having funds on hot wallets
- Support for hardware wallets to sign the PSBTs for channel funding transactions
- Minimalistic in-browser wallet with [NodeGuard Companion](https://github.com/Elenpay/Nodeguards-Companion) to ease signing of transactions and wallet creation
- Minimalistic in-browser wallet with [NodeGuard Companion](https://github.com/Lunar-Rails/Nodeguards-Companion) to ease signing of transactions and wallet creation
- In-browser notification systems for channel approvals
- Two-factor authentication
- Manual and automated Swap Outs (Loop, 40swap and [Spark](docs/spark-swaps.md))
Expand Down
4 changes: 2 additions & 2 deletions THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ its license in its package metadata.

## NSpark

- Path: [vendor/nspark](vendor/nspark/), a git submodule of the Elenpay fork
<https://github.com/Elenpay/nspark> of <https://github.com/orklabs/nspark>.
- Path: [vendor/nspark](vendor/nspark/), a git submodule of the Lunar-Rails fork
<https://github.com/Lunar-Rails/nspark> of <https://github.com/orklabs/nspark>.
- License: MIT, Copyright (c) 2026 OrkLabs S.A.S. and NSpark contributors. The full text is in
`vendor/nspark/LICENSE`.
- NSpark's own dependencies are listed in `vendor/nspark/THIRD_PARTY_NOTICES.md`.
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include:
services:
nbxplorer:
restart: unless-stopped
# Must carry the POST form of the custom selectutxos endpoint (Elenpay/NBXplorer): NodeGuard moves
# Must carry the POST form of the custom selectutxos endpoint (Lunar-Rails/ep-nbxplorer): NodeGuard moves
# the ignored-outpoint list into a request body once it outgrows the request line, and a GET-only
# build answers 405 there. LargeIgnoreListCoinSelectionE2ETests probes the route and names this pin
# when it is missing. TODO before merging the POST transport: repin to the IMMUTABLE tag of the
Expand Down
12 changes: 6 additions & 6 deletions docker/spark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ The images are built from open-ssp commit `89525792d65d7e0f7092e9f6d66b5082c00e4

| Image | Built from | License |
|---|---|---|
| `ghcr.io/elenpay/nodeguard-spark-dev-operator` | open-ssp `vendor/spark` (benthecarman's fork of [buildonspark/spark](https://github.com/buildonspark/spark)) | Apache-2.0 |
| `ghcr.io/elenpay/nodeguard-spark-dev-ldk-server` | open-ssp `vendor/ldk-server` ([lightningdevkit/ldk-server](https://github.com/lightningdevkit/ldk-server)) | MIT or Apache-2.0 |
| `ghcr.io/elenpay/nodeguard-spark-dev-ssp` | open-ssp `ssp.Dockerfile` | MIT |
| `ghcr.io/lunar-rails/nodeguard-spark-dev-operator` | open-ssp `vendor/spark` (benthecarman's fork of [buildonspark/spark](https://github.com/buildonspark/spark)) | Apache-2.0 |
| `ghcr.io/lunar-rails/nodeguard-spark-dev-ldk-server` | open-ssp `vendor/ldk-server` ([lightningdevkit/ldk-server](https://github.com/lightningdevkit/ldk-server)) | MIT or Apache-2.0 |
| `ghcr.io/lunar-rails/nodeguard-spark-dev-ssp` | open-ssp `ssp.Dockerfile` | MIT |

[docker-compose.yml](docker-compose.yml) refers to them by the tag `open-ssp-<commit>`. Each can be overridden with `SPARK_OPERATOR_IMAGE`, `SPARK_LDK_SERVER_IMAGE` and `SPARK_SSP_IMAGE`.

Expand All @@ -54,9 +54,9 @@ git clone --recurse-submodules https://github.com/benthecarman/open-ssp ~/open-s
cd ~/open-ssp && git checkout 89525792d65d7e0f7092e9f6d66b5082c00e48ca && git submodule update --init --recursive
SPARK_ADMIN_TOKEN=x SSP_IMAGE=open-ssp:regtest-local \
docker compose -f docker-compose.regtest.yml build spark-operator-0 ldk-server ssp
docker tag open-ssp-spark-operator:regtest ghcr.io/elenpay/nodeguard-spark-dev-operator:open-ssp-89525792d65d
docker tag open-ssp-ldk-server:regtest ghcr.io/elenpay/nodeguard-spark-dev-ldk-server:open-ssp-89525792d65d
docker tag open-ssp:regtest-local ghcr.io/elenpay/nodeguard-spark-dev-ssp:open-ssp-89525792d65d
docker tag open-ssp-spark-operator:regtest ghcr.io/lunar-rails/nodeguard-spark-dev-operator:open-ssp-89525792d65d
docker tag open-ssp-ldk-server:regtest ghcr.io/lunar-rails/nodeguard-spark-dev-ldk-server:open-ssp-89525792d65d
docker tag open-ssp:regtest-local ghcr.io/lunar-rails/nodeguard-spark-dev-ssp:open-ssp-89525792d65d
```

The configuration in [config/](config/) and [setup-spark.sh](setup-spark.sh) is adapted from open-ssp's e2e setup (MIT).
6 changes: 3 additions & 3 deletions docker/spark/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x-spark: &spark

x-spark-operator: &spark-operator
<<: *spark
image: ${SPARK_OPERATOR_IMAGE:-ghcr.io/elenpay/nodeguard-spark-dev-operator:open-ssp-89525792d65d}
image: ${SPARK_OPERATOR_IMAGE:-ghcr.io/lunar-rails/nodeguard-spark-dev-operator:open-ssp-89525792d65d}
Comment thread
markettes marked this conversation as resolved.
Resolved
depends_on:
bitcoind:
condition: service_started
Expand Down Expand Up @@ -99,7 +99,7 @@ services:

spark-ldk-server:
<<: *spark
image: ${SPARK_LDK_SERVER_IMAGE:-ghcr.io/elenpay/nodeguard-spark-dev-ldk-server:open-ssp-89525792d65d}
image: ${SPARK_LDK_SERVER_IMAGE:-ghcr.io/lunar-rails/nodeguard-spark-dev-ldk-server:open-ssp-89525792d65d}
depends_on:
bitcoind:
condition: service_started
Expand Down Expand Up @@ -131,7 +131,7 @@ services:

spark-ssp:
<<: *spark
image: ${SPARK_SSP_IMAGE:-ghcr.io/elenpay/nodeguard-spark-dev-ssp:open-ssp-89525792d65d}
image: ${SPARK_SSP_IMAGE:-ghcr.io/lunar-rails/nodeguard-spark-dev-ssp:open-ssp-89525792d65d}
depends_on:
spark-operator-0: { condition: service_started }
spark-operator-1: { condition: service_started }
Expand Down
4 changes: 2 additions & 2 deletions docs/spark-swaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Spark is a swap-out provider next to Loop and 40swap. A node moves Lightning liq

NodeGuard is not a Spark wallet product. A Spark wallet is transit only: each swap's sats leave in an exit of their own leaves, and the guardrails below alert when sats stay behind.

The Spark client is the [NSpark](https://github.com/orklabs/nspark) .NET SDK, from the [Elenpay fork](https://github.com/Elenpay/nspark) in `vendor/nspark` (a git submodule). By default, on mainnet, the operators are Lightspark, Breez and Flashnet (2-of-3) and the SSP is Lightspark's.
The Spark client is the [NSpark](https://github.com/orklabs/nspark) .NET SDK, from the [Lunar-Rails fork](https://github.com/Lunar-Rails/nspark) in `vendor/nspark` (a git submodule). By default, on mainnet, the operators are Lightspark, Breez and Flashnet (2-of-3) and the SSP is Lightspark's.

## How a swap runs

Expand Down Expand Up @@ -52,7 +52,7 @@ So the exposure is the sats in transit, while they are on Spark. That is why a S
`SPARK_SIGNER` sets where the Spark keys live:

- **`wallet`** (the default; temporary). Spark wallets are created on the Wallets page's Spark tab (or with `CreateSparkWallet`), and each node is given the Spark wallet its swaps pass through. Their keys are hot: see [Spark wallets](#spark-wallets-temporary).
- **`remote`**. One Spark wallet, whose keys stay in the remote signer Lambda under its `/spark/` routes, serves every node; see the [remote signer README](https://github.com/Elenpay/Nodeguard-Remote-Signer#spark-signing). Its keys come from the seed with master fingerprint `SPARK_SEED_FINGERPRINT`, at Spark account `SPARK_ACCOUNT` (`m/8797555'/account'/…`). NodeGuard calls `/spark/info` at startup. It uses the signer only if the signer reports the same contract version and a policy for exactly NodeGuard's operators, threshold and SSP, and serves the expected Spark identity:
- **`remote`**. One Spark wallet, whose keys stay in the remote signer Lambda under its `/spark/` routes, serves every node; see the [remote signer README](https://github.com/Lunar-Rails/Nodeguard-Remote-Signer#spark-signing). Its keys come from the seed with master fingerprint `SPARK_SEED_FINGERPRINT`, at Spark account `SPARK_ACCOUNT` (`m/8797555'/account'/…`). NodeGuard calls `/spark/info` at startup. It uses the signer only if the signer reports the same contract version and a policy for exactly NodeGuard's operators, threshold and SSP, and serves the expected Spark identity:
- On the first successful handshake, NodeGuard saves the identity the signer serves (table `SparkSignerIdentities`, one row per `SPARK_SEED_FINGERPRINT` and `SPARK_ACCOUNT`), logs a warning with it and audits it. Every later handshake must serve the same identity: swaps record the identity that received them, and a signer serving another would leave them unable to exit. Watch the logs on the first start in remote mode, and compare the saved identity with the seed ceremony's `verify --spark-account` when convenient.
- `SPARK_IDENTITY_PUBKEY` is optional. When set, the signer must serve it from the first handshake on, and it must agree with the saved identity.
- To accept another identity for the same seed and account on purpose, first move the Spark balance out (see [Rotating or retiring the Spark seed](#rotating-or-retiring-the-spark-seed)), then delete the saved row and restart NodeGuard:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/elenpay/nodeguard
module github.com/lunar-rails/nodeguard

go 1.25.0

Expand Down
2 changes: 1 addition & 1 deletion src/NodeGuard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</ItemGroup>

<ItemGroup>
<!-- Spark client: NSpark from the Elenpay/nspark fork (git submodule), with Lightspark's spark-frost native library -->
<!-- Spark client: NSpark from the Lunar-Rails/nspark fork (git submodule), with Lightspark's spark-frost native library -->
<ProjectReference Include="..\vendor\nspark\src\NSpark.RemoteSigner\NSpark.RemoteSigner.csproj" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Services/NBXplorerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public async Task<UTXOChanges> GetUTXOsByLimitAsync(DerivationStrategyBase deriv
// Kestrel's 8KB MaxRequestLineSize and NBXplorer answered 414 — which the callers
// swallow into a degraded selection. The body limit is 30MB, roughly 3,662x the
// room, so the list no longer has a practical ceiling.
// NOTE: this requires an NBXplorer serving POST /selectutxos (Elenpay/NBXplorer#18).
// NOTE: this requires an NBXplorer serving POST /selectutxos (Lunar-Rails/ep-nbxplorer#18).
// Against an older build every call answers 405 and coin selection degrades.
var response = await _httpClient.PostAsync(url,
JsonContent.Create(new { ignoreOutpoints }), cancellation);
Expand Down
Loading