Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6346773
lnd+lncfg: Refactor `RemoteSigner` Config
ViktorT-11 Dec 9, 2024
c20f7ec
multi: correct `DefaultRemoteSignerRPCTimeout` docs
ViktorT-11 May 20, 2024
b1c241d
lnd: add new `remotesigner` macaroon entity
ViktorT-11 Aug 23, 2024
0fc2be9
walletrpc: add `SignCoordinatorStreams` RPC
ViktorT-11 May 14, 2024
6099b2f
rpcwallet: add `RemoteSignerConnection` interface
ViktorT-11 May 14, 2024
f765378
rpcwallet: add `OutboundConnection` implementation
ViktorT-11 May 14, 2024
8300a78
rpcwallet: add `RemoteSignerConnectionBuilder`
ViktorT-11 May 14, 2024
dd6c22d
rpcwallet: use `RemoteSignerConnection` in RPCKeyRing
ViktorT-11 May 14, 2024
0abee62
lnd: refactor `createLivenessMonitor` signature
ViktorT-11 Dec 17, 2024
3b14b9a
multi: use `RemoteSignerConnection` for health check
ViktorT-11 May 14, 2024
ef758fc
multi: Add `watchonlynode` Namespace to `Config`
ViktorT-11 Dec 6, 2024
5984600
rpcwallet: add `RemoteSignerClient` struct
ViktorT-11 May 14, 2024
154e80e
f - rpcwallet: use GoroutineManager in remote signer signer client
ViktorT-11 Oct 31, 2024
4c3f1fc
rpcwallet: Add `RemoteSignerClientBuilder`
ViktorT-11 Sep 1, 2024
96d9931
lnd: add `RemoteSignerClient` instance on startup
ViktorT-11 May 14, 2024
8cada15
lncfg: allow `watchonlynode.enable`
ViktorT-11 Dec 6, 2024
14d5df9
conf: add `remotesigner.allowinboundconnection`
ViktorT-11 Dec 6, 2024
a76e0d7
rpcwallet: add `SignCoordinator` struct
ViktorT-11 May 14, 2024
5a32da9
rpcwallet: add `InboundConnection` implementation
ViktorT-11 Dec 6, 2024
27f8698
lnrpc: add `AllowRemoteSigner` `WalletState` proto
ViktorT-11 May 14, 2024
74b8620
rpcperms: allow some RPCs before `rpcActive` state
ViktorT-11 May 14, 2024
44bc886
rpcperms: fix `SetServerActive` function docs typo
ViktorT-11 May 14, 2024
954434d
multi: enable `RpcServer` before dependencies exist
ViktorT-11 May 14, 2024
fe0102f
multi: add `RemoteSignerConnection` to walletrpc conf
ViktorT-11 May 14, 2024
9f921c0
walletrpc: implement `SignCoordinatorStreams` RPC
ViktorT-11 May 14, 2024
9c27d9e
multi: populate `RemoteSignerConnection` ref early
ViktorT-11 May 28, 2024
efbdbd3
f - multi: populate `RemoteSignerConnection` ref early
ViktorT-11 Dec 5, 2024
b7fdc95
multi: add `ReadySignal` to `WalletController`
ViktorT-11 May 14, 2024
1843a84
lnd: await remote signer connection on startup
ViktorT-11 May 28, 2024
85dac1a
multi: allow `remotesigner.allowinboundconnection`
ViktorT-11 Dec 6, 2024
89d3aa4
docs: add outbound signer to remote signing docs
ViktorT-11 May 13, 2024
0965a46
docs: update release notes
ViktorT-11 Oct 31, 2024
8a978da
lntest: separate creation/start of watch-only node
ViktorT-11 May 14, 2024
ae363fe
itest: fix testRemoteSignerRandomSeedOutbound typo
ViktorT-11 Mar 21, 2025
6f73f7c
itest: add outbound remote signer itests
ViktorT-11 May 14, 2024
9e6f4c2
itest: add testOutboundRSMacaroonEnforcement itest
ViktorT-11 Aug 28, 2024
0df1fa3
itest: wrap deriveCustomScopeAccounts at 80 chars
ViktorT-11 May 17, 2024
f169c2d
rpcwallet: allow remote signer to reconnect
ViktorT-11 Mar 21, 2025
b89ea08
multi: allow 0 `startuptimeout` value
ViktorT-11 Feb 6, 2026
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
23 changes: 19 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,15 @@ type Config struct {

RPCMiddleware *lncfg.RPCMiddleware `group:"rpcmiddleware" namespace:"rpcmiddleware"`

// RemoteSigner defines how to connect to a remote signer node. If this
// is enabled, the node acts as a watch-only node in a remote signer
// setup.
RemoteSigner *lncfg.RemoteSigner `group:"remotesigner" namespace:"remotesigner"`

// WatchOnlyNode defines how to connect to a watch-only node. If this is
// enabled, the node acts as a remote signer in a remote signer setup.
WatchOnlyNode *lncfg.WatchOnlyNode `group:"watchonlynode" namespace:"watchonlynode"`

Sweeper *lncfg.Sweeper `group:"sweeper" namespace:"sweeper"`

Htlcswitch *lncfg.Htlcswitch `group:"htlcswitch" namespace:"htlcswitch"`
Expand Down Expand Up @@ -757,10 +764,9 @@ func DefaultConfig() Config {
ChannelCommitBatchSize: defaultChannelCommitBatchSize,
CoinSelectionStrategy: defaultCoinSelectionStrategy,
KeepFailedPaymentAttempts: defaultKeepFailedPaymentAttempts,
RemoteSigner: &lncfg.RemoteSigner{
Timeout: lncfg.DefaultRemoteSignerRPCTimeout,
},
Sweeper: lncfg.DefaultSweeperConfig(),
RemoteSigner: lncfg.DefaultRemoteSignerCfg(),
WatchOnlyNode: lncfg.DefaultWatchOnlyNodeCfg(),
Sweeper: lncfg.DefaultSweeperConfig(),
Htlcswitch: &lncfg.Htlcswitch{
MailboxDeliveryTimeout: htlcswitch.DefaultMailboxDeliveryTimeout,
QuiescenceTimeout: lncfg.DefaultQuiescenceTimeout,
Expand Down Expand Up @@ -1790,6 +1796,14 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
)
}

// Validate that the node isn't configured as both a remote signer and a
// watch-only node.
if cfg.RemoteSigner.Enable && cfg.WatchOnlyNode.Enable {
return nil, fmt.Errorf("cannot be configured as both a " +
"watchonly node and a remote signer node " +
"simultaneously")
}

// Validate the subconfigs for workers, caches, and the tower client.
err = lncfg.Validate(
cfg.Workers,
Expand All @@ -1800,6 +1814,7 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
cfg.HealthChecks,
cfg.RPCMiddleware,
cfg.RemoteSigner,
cfg.WatchOnlyNode,
cfg.Sweeper,
cfg.Htlcswitch,
cfg.Invoices,
Expand Down
42 changes: 37 additions & 5 deletions config_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -867,28 +867,57 @@ func (d *RPCSignerWalletImpl) BuildChainControl(
partialChainControl *chainreg.PartialChainControl,
walletConfig *btcwallet.Config) (*chainreg.ChainControl, func(), error) {

// Keeps track of both the remote signer and the chain control clean up
// functions.
var (
cleanUpTasks []func()
cleanUp = func() {
for i := len(cleanUpTasks) - 1; i >= 0; i-- {
cleanUpTasks[i]()
}
}
)

walletController, err := btcwallet.New(
*walletConfig, partialChainControl.Cfg.BlockCache,
)
if err != nil {
err := fmt.Errorf("unable to create wallet controller: %w", err)
d.logger.Error(err)
return nil, nil, err
return nil, cleanUp, err
}

remoteSignerConnBuilder := rpcwallet.NewRemoteSignerConnectionBuilder(
d.DefaultWalletImpl.cfg.RemoteSigner,
)

// Create the remote signer connection instance.
remoteSignerConn, err := remoteSignerConnBuilder.Build(
context.Background(),
)
if err != nil {
err := fmt.Errorf("unable to set up remote signer: %w", err)
d.logger.Error(err)

return nil, cleanUp, err
}

cleanUpTasks = append(cleanUpTasks, remoteSignerConn.Stop)

baseKeyRing := keychain.NewBtcWalletKeyRing(
walletController.InternalWallet(), walletConfig.CoinType,
)

rpcKeyRing, err := rpcwallet.NewRPCKeyRing(
baseKeyRing, walletController,
d.DefaultWalletImpl.cfg.RemoteSigner, walletConfig.NetParams,
remoteSignerConn, walletConfig.NetParams,
)
if err != nil {
err := fmt.Errorf("unable to create RPC remote signing wallet "+
"%v", err)
d.logger.Error(err)
return nil, nil, err

return nil, cleanUp, err
}

// Create, and start the lnwallet, which handles the core payment
Expand All @@ -907,15 +936,18 @@ func (d *RPCSignerWalletImpl) BuildChainControl(

// We've created the wallet configuration now, so we can finish
// initializing the main chain control.
activeChainControl, cleanUp, err := chainreg.NewChainControl(
activeChainControl, ccCleanUp, err := chainreg.NewChainControl(
lnWalletConfig, rpcKeyRing, partialChainControl,
)
if err != nil {
err := fmt.Errorf("unable to create chain control: %w", err)
d.logger.Error(err)
return nil, nil, err

return nil, cleanUp, err
}

cleanUpTasks = append(cleanUpTasks, ccCleanUp)

return activeChainControl, cleanUp, nil
}

Expand Down
11 changes: 11 additions & 0 deletions docs/release-notes/release-notes-0.21.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
specify a list of inputs to use as transaction inputs via the new
`inputs` field in `EstimateFeeRequest`.

* [SignCoordinatorStreams](https://github.com/lightningnetwork/lnd/pull/8754)
allows a remote signer to connect to the lnd node, if the
`remotesigner.allowinboundconnection` cfg value has been set to `true`.

## lncli Additions

* The `estimatefee` command now supports the `--utxos` flag to specify explicit
Expand All @@ -107,9 +111,16 @@
This applies to both funders and fundees, with the ability to override the
value during channel opening or acceptance.

<<<<<<< HEAD
* Rename [experimental endorsement signal](https://github.com/lightning/blips/blob/a833e7b49f224e1240b5d669e78fa950160f5a06/blip-0004.md)
to [accountable](https://github.com/lightningnetwork/lnd/pull/10367) to match
the latest [proposal](https://github.com/lightning/blips/pull/67).
=======
* [Added](https://github.com/lightningnetwork/lnd/pull/8754) support for a new
remote signer type `outbound`, which makes an outbound connection to the
watch-only node, instead of requiring on an inbound connection from the
watch-only node.
>>>>>>> 39f496b44 (docs: update release notes)

## RPC Updates

Expand Down
Loading
Loading