lightning 5.14.0 → 5.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +16 -2
- package/grpc/protos/chainnotifier.proto +5 -3
- package/grpc/protos/lightning.proto +6 -1
- package/grpc/protos/signer.proto +308 -0
- package/index.js +6 -0
- package/lnd_methods/index.js +6 -0
- package/lnd_methods/info/get_route_to_destination.js +8 -0
- package/lnd_methods/macaroon/methods.json +13 -0
- package/lnd_methods/offchain/get_failed_payments.js +3 -1
- package/lnd_methods/offchain/get_payments.js +3 -1
- package/lnd_methods/offchain/get_pending_payments.js +2 -0
- package/lnd_methods/peers/add_external_socket.d.ts +20 -0
- package/lnd_methods/peers/index.d.ts +4 -0
- package/lnd_methods/peers/remove_external_socket.d.ts +20 -0
- package/lnd_methods/peers/update_alias.d.ts +11 -0
- package/lnd_methods/peers/update_color.d.ts +11 -0
- package/lnd_methods/signer/begin_group_signing_session.d.ts +33 -0
- package/lnd_methods/signer/begin_group_signing_session.js +144 -0
- package/lnd_methods/signer/end_group_signing_session.d.ts +21 -0
- package/lnd_methods/signer/end_group_signing_session.js +102 -0
- package/lnd_methods/signer/index.d.ts +3 -0
- package/lnd_methods/signer/index.js +6 -0
- package/lnd_methods/signer/update_group_signing_session.d.ts +23 -0
- package/lnd_methods/signer/update_group_signing_session.js +110 -0
- package/lnd_responses/index.js +2 -0
- package/lnd_responses/rpc_attempt_htlc_as_attempt.js +39 -5
- package/lnd_responses/rpc_group_session_as_session.js +51 -0
- package/lnd_responses/rpc_payment_as_payment.js +6 -0
- package/package.json +6 -6
- package/test/lnd_methods/info/test_get_route_to_destination.js +15 -0
- package/test/lnd_methods/offchain/test_get_payments.js +2 -0
- package/test/lnd_methods/signer/test_begin_group_signing_session.js +134 -0
- package/test/lnd_methods/signer/test_diffie_hellman_compute_secret.js +3 -1
- package/test/lnd_methods/signer/test_end_group_signing_session.js +93 -0
- package/test/lnd_methods/signer/test_update_group_signing_session.js +108 -0
- package/test/lnd_responses/test_rpc_attempt_htlc_as_attempt.js +19 -3
- package/test/lnd_responses/test_rpc_group_session_as_session.js +79 -0
- package/test/lnd_responses/test_rpc_payment_as_payment.js +5 -1
- package/test/typescript/add_external_socket.test-d.ts +14 -0
- package/test/typescript/begin_group_signing_session.test-d.ts +60 -0
- package/test/typescript/end_group_signing_session.test-d.ts +32 -0
- package/test/typescript/remove_external_socket.test-d.ts +14 -0
- package/test/typescript/update_alias.test-d.ts +14 -0
- package/test/typescript/update_color.test-d.ts +14 -0
- package/test/typescript/update_group_signing_session.test-d.ts +29 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 5.15.2
|
|
4
|
+
|
|
5
|
+
- `getFailedPayments`, `getPayments`, `getPendingPayments`: Remove
|
|
6
|
+
`confirmed_at` date when a payment is not confirmed, add `created_at` and
|
|
7
|
+
`failed_at` dates for attempt start and attempt failed dates.
|
|
8
|
+
|
|
9
|
+
## 5.15.0
|
|
10
|
+
|
|
11
|
+
- `beginGroupSigningSession`: Add method to start a MuSig2 signing session
|
|
12
|
+
- `endGroupSigningSession`: Add method to complete a MuSig2 signing session
|
|
13
|
+
- `updateGroupSigningSession`: Add method to add nonces to a MuSig2 session
|
|
14
|
+
|
|
3
15
|
## 5.14.0
|
|
4
16
|
|
|
5
17
|
- `getRouteToDestination`, `isDestinationPayable`, `pay`,
|
package/README.md
CHANGED
|
@@ -24,8 +24,8 @@ Methods for working with the Lightning Network
|
|
|
24
24
|
https://github.com/stackernews/stacker.news
|
|
25
25
|
- [Suredbits API](https://suredbits.com/) -
|
|
26
26
|
https://github.com/Suredbits/sb-api-lnd
|
|
27
|
-
- [Synonym
|
|
28
|
-
https://github.com/synonymdev/
|
|
27
|
+
- [Synonym Blocktank server](https://synonym.to) -
|
|
28
|
+
https://github.com/synonymdev/blocktank-server/
|
|
29
29
|
- [Tarnhelm](https://www.tarnhelm.app/) - https://github.com/bkiac/tarnhelm
|
|
30
30
|
- [tbtcswaps](https://tbtcswaps.com/) -
|
|
31
31
|
https://github.com/keep-community/tbtcswaps
|
|
@@ -66,9 +66,13 @@ To access unauthenticated methods like the wallet unlocker, use
|
|
|
66
66
|
|
|
67
67
|
## Methods
|
|
68
68
|
|
|
69
|
+
- [addExternalSocket](https://github.com/alexbosworth/ln-service#addexternalsocket):
|
|
70
|
+
Add a new LN p2p network socket to node advertisement
|
|
69
71
|
- [addPeer](https://github.com/alexbosworth/ln-service#addpeer): Connect to a new peer
|
|
70
72
|
- [authenticatedLndGrpc](https://github.com/alexbosworth/ln-service#authenticatedlndgrpc):
|
|
71
73
|
Instantiate connection to authenticated lnd methods.
|
|
74
|
+
- [beginGroupSigningSession](https://github.com/alexbosworth/ln-service#begingroupsigningsession):
|
|
75
|
+
Start a new MuSig2 signing session
|
|
72
76
|
- [broadcastChainTransaction](https://github.com/alexbosworth/ln-service#broadcastchaintransaction):
|
|
73
77
|
Publish an on-chain transaction to the network.
|
|
74
78
|
- [cancelHodlInvoice](https://github.com/alexbosworth/ln-service#cancelhodlinvoice): Cancel an
|
|
@@ -111,6 +115,8 @@ To access unauthenticated methods like the wallet unlocker, use
|
|
|
111
115
|
Remove a connected watchtower
|
|
112
116
|
- [enableChannel](https://github.com/alexbosworth/ln-service#enablechannel): Signal forwarding
|
|
113
117
|
enabled towards a peer.
|
|
118
|
+
- [endGroupSigningSession](https://github.com/alexbosworth/ln-service#endgroupsigningsession):
|
|
119
|
+
End a MuSig2 signing session
|
|
114
120
|
- [fundPendingChannels](https://github.com/alexbosworth/ln-service#fundpendingchannels):
|
|
115
121
|
Provide a signed funding source for opening channels.
|
|
116
122
|
- [fundPsbt](https://github.com/alexbosworth/ln-service#fundpsbt): Make a PSBT with funds and
|
|
@@ -235,6 +241,8 @@ To access unauthenticated methods like the wallet unlocker, use
|
|
|
235
241
|
Attempt to recover channel funds from a specific channel backup.
|
|
236
242
|
- [recoverFundsFromChannels](https://github.com/alexbosworth/ln-service#recoverfundsfromchannels):
|
|
237
243
|
Attempt to recover funds from multiple channels using a multiple channel backup.
|
|
244
|
+
- [removeExternalSocket](https://github.com/alexbosworth/ln-service#removeexternalsocket):
|
|
245
|
+
Remove a LN p2p network socket from the node advertisement
|
|
238
246
|
- [removePeer](https://github.com/alexbosworth/ln-service#removepeer): Disconnect from a
|
|
239
247
|
connected peer.
|
|
240
248
|
- [requestChainFeeIncrease](https://github.com/alexbosworth/ln-service#requestchainfeeincrease):
|
|
@@ -313,10 +321,16 @@ To access unauthenticated methods like the wallet unlocker, use
|
|
|
313
321
|
UTXO to allow it to be selected for spending again.
|
|
314
322
|
- [unlockWallet](https://github.com/alexbosworth/ln-service#unlockwallet): Decrypt the wallet and
|
|
315
323
|
start the daemon
|
|
324
|
+
- [updateAlias](https://github.com/alexbosworth/ln-service#updatealias):
|
|
325
|
+
Update the advertised node alias
|
|
316
326
|
- [updateChainTransaction](https://github.com/alexbosworth/ln-service#updatechaintransaction):
|
|
317
327
|
Edit the metadata of an on-chain transaction record.
|
|
328
|
+
- [updateColor](https://github.com/alexbosworth/ln-service#updatecolor):
|
|
329
|
+
Update the advertised node color
|
|
318
330
|
- [updateConnectedWatchtower](https://github.com/alexbosworth/ln-service#updateconnectedwatchtower):
|
|
319
331
|
Edit the settings on an added watchtower
|
|
332
|
+
- [updateGroupSigningSession](https://github.com/alexbosworth/ln-service#updategroupsigningsession):
|
|
333
|
+
Update a MuSig2 signing session with nonces and get a partial signature
|
|
320
334
|
- [updatePathfindingSettings](https://github.com/alexbosworth/ln-service#updatepathfindingsettings):
|
|
321
335
|
Edit the configuration for routing calculations
|
|
322
336
|
- [updateRoutingFees](https://github.com/alexbosworth/ln-service#updateroutingfees): Set the
|
|
@@ -12,9 +12,11 @@ service ChainNotifier {
|
|
|
12
12
|
registers an intent for a client to be notified once a confirmation request
|
|
13
13
|
has reached its required number of confirmations on-chain.
|
|
14
14
|
|
|
15
|
-
A
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
A confirmation request must have a valid output script. It is also possible
|
|
16
|
+
to give a transaction ID. If the transaction ID is not set, a notification
|
|
17
|
+
is sent once the output script confirms. If the transaction ID is also set,
|
|
18
|
+
a notification is sent once the output script confirms in the given
|
|
19
|
+
transaction.
|
|
18
20
|
*/
|
|
19
21
|
rpc RegisterConfirmationsNtfn (ConfRequest) returns (stream ConfEvent);
|
|
20
22
|
|
|
@@ -1809,6 +1809,11 @@ message GetInfoResponse {
|
|
|
1809
1809
|
announcements and invoices.
|
|
1810
1810
|
*/
|
|
1811
1811
|
map<uint32, Feature> features = 19;
|
|
1812
|
+
|
|
1813
|
+
/*
|
|
1814
|
+
Indicates whether the HTLC interceptor API is in always-on mode.
|
|
1815
|
+
*/
|
|
1816
|
+
bool require_htlc_interceptor = 21;
|
|
1812
1817
|
}
|
|
1813
1818
|
|
|
1814
1819
|
message GetRecoveryInfoRequest {
|
|
@@ -2766,7 +2771,7 @@ message Hop {
|
|
|
2766
2771
|
TLV format. Note that if any custom tlv_records below are specified, then
|
|
2767
2772
|
this field MUST be set to true for them to be encoded properly.
|
|
2768
2773
|
*/
|
|
2769
|
-
bool tlv_payload = 9;
|
|
2774
|
+
bool tlv_payload = 9 [deprecated = true];
|
|
2770
2775
|
|
|
2771
2776
|
/*
|
|
2772
2777
|
An optional TLV record that signals the use of an MPP payment. If present,
|
package/grpc/protos/signer.proto
CHANGED
|
@@ -62,6 +62,86 @@ service Signer {
|
|
|
62
62
|
hashed with sha256, resulting in the final key length of 256bit.
|
|
63
63
|
*/
|
|
64
64
|
rpc DeriveSharedKey (SharedKeyRequest) returns (SharedKeyResponse);
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
MuSig2CombineKeys (experimental!) is a stateless helper RPC that can be used
|
|
68
|
+
to calculate the combined MuSig2 public key from a list of all participating
|
|
69
|
+
signers' public keys. This RPC is completely stateless and deterministic and
|
|
70
|
+
does not create any signing session. It can be used to determine the Taproot
|
|
71
|
+
public key that should be put in an on-chain output once all public keys are
|
|
72
|
+
known. A signing session is only needed later when that output should be
|
|
73
|
+
_spent_ again.
|
|
74
|
+
|
|
75
|
+
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
|
|
76
|
+
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
|
|
77
|
+
releases. Backward compatibility is not guaranteed!
|
|
78
|
+
*/
|
|
79
|
+
rpc MuSig2CombineKeys (MuSig2CombineKeysRequest)
|
|
80
|
+
returns (MuSig2CombineKeysResponse);
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
MuSig2CreateSession (experimental!) creates a new MuSig2 signing session
|
|
84
|
+
using the local key identified by the key locator. The complete list of all
|
|
85
|
+
public keys of all signing parties must be provided, including the public
|
|
86
|
+
key of the local signing key. If nonces of other parties are already known,
|
|
87
|
+
they can be submitted as well to reduce the number of RPC calls necessary
|
|
88
|
+
later on.
|
|
89
|
+
|
|
90
|
+
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
|
|
91
|
+
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
|
|
92
|
+
releases. Backward compatibility is not guaranteed!
|
|
93
|
+
*/
|
|
94
|
+
rpc MuSig2CreateSession (MuSig2SessionRequest)
|
|
95
|
+
returns (MuSig2SessionResponse);
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
MuSig2RegisterNonces (experimental!) registers one or more public nonces of
|
|
99
|
+
other signing participants for a session identified by its ID. This RPC can
|
|
100
|
+
be called multiple times until all nonces are registered.
|
|
101
|
+
|
|
102
|
+
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
|
|
103
|
+
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
|
|
104
|
+
releases. Backward compatibility is not guaranteed!
|
|
105
|
+
*/
|
|
106
|
+
rpc MuSig2RegisterNonces (MuSig2RegisterNoncesRequest)
|
|
107
|
+
returns (MuSig2RegisterNoncesResponse);
|
|
108
|
+
|
|
109
|
+
/*
|
|
110
|
+
MuSig2Sign (experimental!) creates a partial signature using the local
|
|
111
|
+
signing key that was specified when the session was created. This can only
|
|
112
|
+
be called when all public nonces of all participants are known and have been
|
|
113
|
+
registered with the session. If this node isn't responsible for combining
|
|
114
|
+
all the partial signatures, then the cleanup flag should be set, indicating
|
|
115
|
+
that the session can be removed from memory once the signature was produced.
|
|
116
|
+
|
|
117
|
+
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
|
|
118
|
+
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
|
|
119
|
+
releases. Backward compatibility is not guaranteed!
|
|
120
|
+
*/
|
|
121
|
+
rpc MuSig2Sign (MuSig2SignRequest) returns (MuSig2SignResponse);
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
MuSig2CombineSig (experimental!) combines the given partial signature(s)
|
|
125
|
+
with the local one, if it already exists. Once a partial signature of all
|
|
126
|
+
participants is registered, the final signature will be combined and
|
|
127
|
+
returned.
|
|
128
|
+
|
|
129
|
+
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
|
|
130
|
+
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
|
|
131
|
+
releases. Backward compatibility is not guaranteed!
|
|
132
|
+
*/
|
|
133
|
+
rpc MuSig2CombineSig (MuSig2CombineSigRequest)
|
|
134
|
+
returns (MuSig2CombineSigResponse);
|
|
135
|
+
|
|
136
|
+
/*
|
|
137
|
+
MuSig2Cleanup (experimental!) allows a caller to clean up a session early in
|
|
138
|
+
cases where it's obvious that the signing session won't succeed and the
|
|
139
|
+
resources can be released.
|
|
140
|
+
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
|
|
141
|
+
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
|
|
142
|
+
releases. Backward compatibility is not guaranteed!
|
|
143
|
+
*/
|
|
144
|
+
rpc MuSig2Cleanup (MuSig2CleanupRequest) returns (MuSig2CleanupResponse);
|
|
65
145
|
}
|
|
66
146
|
|
|
67
147
|
message KeyLocator {
|
|
@@ -264,4 +344,232 @@ message SharedKeyRequest {
|
|
|
264
344
|
message SharedKeyResponse {
|
|
265
345
|
// The shared public key, hashed with sha256.
|
|
266
346
|
bytes shared_key = 1;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
message TweakDesc {
|
|
350
|
+
/*
|
|
351
|
+
Tweak is the 32-byte value that will modify the public key.
|
|
352
|
+
*/
|
|
353
|
+
bytes tweak = 1;
|
|
354
|
+
|
|
355
|
+
/*
|
|
356
|
+
Specifies if the target key should be converted to an x-only public key
|
|
357
|
+
before tweaking. If true, then the public key will be mapped to an x-only
|
|
358
|
+
key before the tweaking operation is applied.
|
|
359
|
+
*/
|
|
360
|
+
bool is_x_only = 2;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
message TaprootTweakDesc {
|
|
364
|
+
/*
|
|
365
|
+
The root hash of the tapscript tree if a script path is committed to. If
|
|
366
|
+
the MuSig2 key put on chain doesn't also commit to a script path (BIP-0086
|
|
367
|
+
key spend only), then this needs to be empty and the key_spend_only field
|
|
368
|
+
below must be set to true. This is required because gRPC cannot
|
|
369
|
+
differentiate between a zero-size byte slice and a nil byte slice (both
|
|
370
|
+
would be serialized the same way). So the extra boolean is required.
|
|
371
|
+
*/
|
|
372
|
+
bytes script_root = 1;
|
|
373
|
+
|
|
374
|
+
/*
|
|
375
|
+
Indicates that the above script_root is expected to be empty because this
|
|
376
|
+
is a BIP-0086 key spend only commitment where only the internal key is
|
|
377
|
+
committed to instead of also including a script root hash.
|
|
378
|
+
*/
|
|
379
|
+
bool key_spend_only = 2;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
message MuSig2CombineKeysRequest {
|
|
383
|
+
/*
|
|
384
|
+
A list of all public keys (serialized in 32-byte x-only format!)
|
|
385
|
+
participating in the signing session. The list will always be sorted
|
|
386
|
+
lexicographically internally. This must include the local key which is
|
|
387
|
+
described by the above key_loc.
|
|
388
|
+
*/
|
|
389
|
+
repeated bytes all_signer_pubkeys = 1;
|
|
390
|
+
|
|
391
|
+
/*
|
|
392
|
+
A series of optional generic tweaks to be applied to the the aggregated
|
|
393
|
+
public key.
|
|
394
|
+
*/
|
|
395
|
+
repeated TweakDesc tweaks = 2;
|
|
396
|
+
|
|
397
|
+
/*
|
|
398
|
+
An optional taproot specific tweak that must be specified if the MuSig2
|
|
399
|
+
combined key will be used as the main taproot key of a taproot output
|
|
400
|
+
on-chain.
|
|
401
|
+
*/
|
|
402
|
+
TaprootTweakDesc taproot_tweak = 3;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
message MuSig2CombineKeysResponse {
|
|
406
|
+
/*
|
|
407
|
+
The combined public key (in the 32-byte x-only format) with all tweaks
|
|
408
|
+
applied to it. If a taproot tweak is specified, this corresponds to the
|
|
409
|
+
taproot key that can be put into the on-chain output.
|
|
410
|
+
*/
|
|
411
|
+
bytes combined_key = 1;
|
|
412
|
+
|
|
413
|
+
/*
|
|
414
|
+
The raw combined public key (in the 32-byte x-only format) before any tweaks
|
|
415
|
+
are applied to it. If a taproot tweak is specified, this corresponds to the
|
|
416
|
+
internal key that needs to be put into the witness if the script spend path
|
|
417
|
+
is used.
|
|
418
|
+
*/
|
|
419
|
+
bytes taproot_internal_key = 2;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
message MuSig2SessionRequest {
|
|
423
|
+
/*
|
|
424
|
+
The key locator that identifies which key to use for signing.
|
|
425
|
+
*/
|
|
426
|
+
KeyLocator key_loc = 1;
|
|
427
|
+
|
|
428
|
+
/*
|
|
429
|
+
A list of all public keys (serialized in 32-byte x-only format!)
|
|
430
|
+
participating in the signing session. The list will always be sorted
|
|
431
|
+
lexicographically internally. This must include the local key which is
|
|
432
|
+
described by the above key_loc.
|
|
433
|
+
*/
|
|
434
|
+
repeated bytes all_signer_pubkeys = 2;
|
|
435
|
+
|
|
436
|
+
/*
|
|
437
|
+
An optional list of all public nonces of other signing participants that
|
|
438
|
+
might already be known.
|
|
439
|
+
*/
|
|
440
|
+
repeated bytes other_signer_public_nonces = 3;
|
|
441
|
+
|
|
442
|
+
/*
|
|
443
|
+
A series of optional generic tweaks to be applied to the the aggregated
|
|
444
|
+
public key.
|
|
445
|
+
*/
|
|
446
|
+
repeated TweakDesc tweaks = 4;
|
|
447
|
+
|
|
448
|
+
/*
|
|
449
|
+
An optional taproot specific tweak that must be specified if the MuSig2
|
|
450
|
+
combined key will be used as the main taproot key of a taproot output
|
|
451
|
+
on-chain.
|
|
452
|
+
*/
|
|
453
|
+
TaprootTweakDesc taproot_tweak = 5;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
message MuSig2SessionResponse {
|
|
457
|
+
/*
|
|
458
|
+
The unique ID that represents this signing session. A session can be used
|
|
459
|
+
for producing a signature a single time. If the signing fails for any
|
|
460
|
+
reason, a new session with the same participants needs to be created.
|
|
461
|
+
*/
|
|
462
|
+
bytes session_id = 1;
|
|
463
|
+
|
|
464
|
+
/*
|
|
465
|
+
The combined public key (in the 32-byte x-only format) with all tweaks
|
|
466
|
+
applied to it. If a taproot tweak is specified, this corresponds to the
|
|
467
|
+
taproot key that can be put into the on-chain output.
|
|
468
|
+
*/
|
|
469
|
+
bytes combined_key = 2;
|
|
470
|
+
|
|
471
|
+
/*
|
|
472
|
+
The raw combined public key (in the 32-byte x-only format) before any tweaks
|
|
473
|
+
are applied to it. If a taproot tweak is specified, this corresponds to the
|
|
474
|
+
internal key that needs to be put into the witness if the script spend path
|
|
475
|
+
is used.
|
|
476
|
+
*/
|
|
477
|
+
bytes taproot_internal_key = 3;
|
|
478
|
+
|
|
479
|
+
/*
|
|
480
|
+
The two public nonces the local signer uses, combined into a single value
|
|
481
|
+
of 66 bytes. Can be split into the two 33-byte points to get the individual
|
|
482
|
+
nonces.
|
|
483
|
+
*/
|
|
484
|
+
bytes local_public_nonces = 4;
|
|
485
|
+
|
|
486
|
+
/*
|
|
487
|
+
Indicates whether all nonces required to start the signing process are known
|
|
488
|
+
now.
|
|
489
|
+
*/
|
|
490
|
+
bool have_all_nonces = 5;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
message MuSig2RegisterNoncesRequest {
|
|
494
|
+
/*
|
|
495
|
+
The unique ID of the signing session those nonces should be registered with.
|
|
496
|
+
*/
|
|
497
|
+
bytes session_id = 1;
|
|
498
|
+
|
|
499
|
+
/*
|
|
500
|
+
A list of all public nonces of other signing participants that should be
|
|
501
|
+
registered.
|
|
502
|
+
*/
|
|
503
|
+
repeated bytes other_signer_public_nonces = 3;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
message MuSig2RegisterNoncesResponse {
|
|
507
|
+
/*
|
|
508
|
+
Indicates whether all nonces required to start the signing process are known
|
|
509
|
+
now.
|
|
510
|
+
*/
|
|
511
|
+
bool have_all_nonces = 1;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
message MuSig2SignRequest {
|
|
515
|
+
/*
|
|
516
|
+
The unique ID of the signing session to use for signing.
|
|
517
|
+
*/
|
|
518
|
+
bytes session_id = 1;
|
|
519
|
+
|
|
520
|
+
/*
|
|
521
|
+
The 32-byte SHA256 digest of the message to sign.
|
|
522
|
+
*/
|
|
523
|
+
bytes message_digest = 2;
|
|
524
|
+
|
|
525
|
+
/*
|
|
526
|
+
Cleanup indicates that after signing, the session state can be cleaned up,
|
|
527
|
+
since another participant is going to be responsible for combining the
|
|
528
|
+
partial signatures.
|
|
529
|
+
*/
|
|
530
|
+
bool cleanup = 3;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
message MuSig2SignResponse {
|
|
534
|
+
/*
|
|
535
|
+
The partial signature created by the local signer.
|
|
536
|
+
*/
|
|
537
|
+
bytes local_partial_signature = 1;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
message MuSig2CombineSigRequest {
|
|
541
|
+
/*
|
|
542
|
+
The unique ID of the signing session to combine the signatures for.
|
|
543
|
+
*/
|
|
544
|
+
bytes session_id = 1;
|
|
545
|
+
|
|
546
|
+
/*
|
|
547
|
+
The list of all other participants' partial signatures to add to the current
|
|
548
|
+
session.
|
|
549
|
+
*/
|
|
550
|
+
repeated bytes other_partial_signatures = 2;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
message MuSig2CombineSigResponse {
|
|
554
|
+
/*
|
|
555
|
+
Indicates whether all partial signatures required to create a final, full
|
|
556
|
+
signature are known yet. If this is true, then the final_signature field is
|
|
557
|
+
set, otherwise it is empty.
|
|
558
|
+
*/
|
|
559
|
+
bool have_all_signatures = 1;
|
|
560
|
+
|
|
561
|
+
/*
|
|
562
|
+
The final, full signature that is valid for the combined public key.
|
|
563
|
+
*/
|
|
564
|
+
bytes final_signature = 2;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
message MuSig2CleanupRequest {
|
|
568
|
+
/*
|
|
569
|
+
The unique ID of the signing session that should be removed/cleaned up.
|
|
570
|
+
*/
|
|
571
|
+
bytes session_id = 1;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
message MuSig2CleanupResponse {
|
|
267
575
|
}
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const {addExternalSocket} = require('./lnd_methods');
|
|
2
2
|
const {addPeer} = require('./lnd_methods');
|
|
3
3
|
const {authenticatedLndGrpc} = require('./lnd_grpc');
|
|
4
|
+
const {beginGroupSigningSession} = require('./lnd_methods');
|
|
4
5
|
const {broadcastChainTransaction} = require('./lnd_methods');
|
|
5
6
|
const {cancelHodlInvoice} = require('./lnd_methods');
|
|
6
7
|
const {cancelPendingChannel} = require('./lnd_methods');
|
|
@@ -24,6 +25,7 @@ const {disableChannel} = require('./lnd_methods');
|
|
|
24
25
|
const {disconnectWatchtower} = require('./lnd_methods');
|
|
25
26
|
const {emitGrpcEvents} = require('./lnd_gateway');
|
|
26
27
|
const {enableChannel} = require('./lnd_methods');
|
|
28
|
+
const {endGroupSigningSession} = require('./lnd_methods');
|
|
27
29
|
const {fundPendingChannels} = require('./lnd_methods');
|
|
28
30
|
const {fundPsbt} = require('./lnd_methods');
|
|
29
31
|
const {getAccessIds} = require('./lnd_methods');
|
|
@@ -133,6 +135,7 @@ const {updateAlias} = require('./lnd_methods');
|
|
|
133
135
|
const {updateChainTransaction} = require('./lnd_methods');
|
|
134
136
|
const {updateColor} = require('./lnd_methods');
|
|
135
137
|
const {updateConnectedWatchtower} = require('./lnd_methods');
|
|
138
|
+
const {updateGroupSigningSession} = require('./lnd_methods');
|
|
136
139
|
const {updatePathfindingSettings} = require('./lnd_methods');
|
|
137
140
|
const {updateRoutingFees} = require('./lnd_methods');
|
|
138
141
|
const {verifyAccess} = require('./lnd_methods');
|
|
@@ -145,6 +148,7 @@ module.exports = {
|
|
|
145
148
|
addExternalSocket,
|
|
146
149
|
addPeer,
|
|
147
150
|
authenticatedLndGrpc,
|
|
151
|
+
beginGroupSigningSession,
|
|
148
152
|
broadcastChainTransaction,
|
|
149
153
|
cancelHodlInvoice,
|
|
150
154
|
cancelPendingChannel,
|
|
@@ -166,6 +170,7 @@ module.exports = {
|
|
|
166
170
|
disableChannel,
|
|
167
171
|
disconnectWatchtower,
|
|
168
172
|
enableChannel,
|
|
173
|
+
endGroupSigningSession,
|
|
169
174
|
diffieHellmanComputeSecret,
|
|
170
175
|
emitGrpcEvents,
|
|
171
176
|
fundPendingChannels,
|
|
@@ -277,6 +282,7 @@ module.exports = {
|
|
|
277
282
|
updateColor,
|
|
278
283
|
updateChainTransaction,
|
|
279
284
|
updateConnectedWatchtower,
|
|
285
|
+
updateGroupSigningSession,
|
|
280
286
|
updatePathfindingSettings,
|
|
281
287
|
updateRoutingFees,
|
|
282
288
|
verifyAccess,
|
package/lnd_methods/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const {addExternalSocket} = require('./peers');
|
|
2
2
|
const {addPeer} = require('./peers');
|
|
3
|
+
const {beginGroupSigningSession} = require('./signer');
|
|
3
4
|
const {broadcastChainTransaction} = require('./onchain');
|
|
4
5
|
const {cancelHodlInvoice} = require('./invoices');
|
|
5
6
|
const {cancelPendingChannel} = require('./onchain');
|
|
@@ -22,6 +23,7 @@ const {diffieHellmanComputeSecret} = require('./signer');
|
|
|
22
23
|
const {disableChannel} = require('./offchain');
|
|
23
24
|
const {disconnectWatchtower} = require('./offchain');
|
|
24
25
|
const {enableChannel} = require('./offchain');
|
|
26
|
+
const {endGroupSigningSession} = require('./signer');
|
|
25
27
|
const {fundPendingChannels} = require('./onchain');
|
|
26
28
|
const {fundPsbt} = require('./onchain');
|
|
27
29
|
const {getAccessIds} = require('./macaroon');
|
|
@@ -129,6 +131,7 @@ const {updateAlias} = require('./peers');
|
|
|
129
131
|
const {updateChainTransaction} = require('./onchain');
|
|
130
132
|
const {updateColor} = require('./peers');
|
|
131
133
|
const {updateConnectedWatchtower} = require('./offchain');
|
|
134
|
+
const {updateGroupSigningSession} = require('./signer');
|
|
132
135
|
const {updatePathfindingSettings} = require('./offchain');
|
|
133
136
|
const {updateRoutingFees} = require('./offchain');
|
|
134
137
|
const {verifyAccess} = require('./macaroon');
|
|
@@ -140,6 +143,7 @@ const {verifyMessage} = require('./message');
|
|
|
140
143
|
module.exports = {
|
|
141
144
|
addExternalSocket,
|
|
142
145
|
addPeer,
|
|
146
|
+
beginGroupSigningSession,
|
|
143
147
|
broadcastChainTransaction,
|
|
144
148
|
cancelHodlInvoice,
|
|
145
149
|
cancelPendingChannel,
|
|
@@ -162,6 +166,7 @@ module.exports = {
|
|
|
162
166
|
disableChannel,
|
|
163
167
|
disconnectWatchtower,
|
|
164
168
|
enableChannel,
|
|
169
|
+
endGroupSigningSession,
|
|
165
170
|
fundPendingChannels,
|
|
166
171
|
fundPsbt,
|
|
167
172
|
getAccessIds,
|
|
@@ -269,6 +274,7 @@ module.exports = {
|
|
|
269
274
|
updateChainTransaction,
|
|
270
275
|
updateColor,
|
|
271
276
|
updateConnectedWatchtower,
|
|
277
|
+
updateGroupSigningSession,
|
|
272
278
|
updatePathfindingSettings,
|
|
273
279
|
updateRoutingFees,
|
|
274
280
|
verifyAccess,
|
|
@@ -129,6 +129,14 @@ module.exports = (args, cbk) => {
|
|
|
129
129
|
return cbk([400, 'ExpectedLndApiObjectToGetRouteToDestination']);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
if (!!args.outgoing_channel) {
|
|
133
|
+
try {
|
|
134
|
+
chanNumber({channel: args.outgoing_channel});
|
|
135
|
+
} catch (err) {
|
|
136
|
+
return cbk([400, 'ExpectedStandardFormatChannelIdForOutChannel']);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
132
140
|
if (!!args.total_mtokens && !args.payment) {
|
|
133
141
|
return cbk([400, 'ExpectedTotalMtokensWithPaymentIdentifier']);
|
|
134
142
|
}
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
"method": "ConnectPeer",
|
|
8
8
|
"type": "default"
|
|
9
9
|
},
|
|
10
|
+
"beginGroupSigningSession": {
|
|
11
|
+
"depends_on": ["getPublicKey"],
|
|
12
|
+
"method": "MuSig2CreateSession",
|
|
13
|
+
"type": "signer"
|
|
14
|
+
},
|
|
10
15
|
"broadcastChainTransaction": {
|
|
11
16
|
"method": "PublishTransaction",
|
|
12
17
|
"type": "wallet"
|
|
@@ -87,6 +92,10 @@
|
|
|
87
92
|
"method": "UpdateChanStatus",
|
|
88
93
|
"type": "router"
|
|
89
94
|
},
|
|
95
|
+
"endGroupSigningSession": {
|
|
96
|
+
"methods": ["MuSig2Cleanup", "MuSig2CombineSig"],
|
|
97
|
+
"type": "signer"
|
|
98
|
+
},
|
|
90
99
|
"fundPendingChannels": {
|
|
91
100
|
"method": "FundingStateStep",
|
|
92
101
|
"type": "default"
|
|
@@ -514,6 +523,10 @@
|
|
|
514
523
|
"methods": ["AddTower", "RemoveTower"],
|
|
515
524
|
"type": "tower_client"
|
|
516
525
|
},
|
|
526
|
+
"updateGroupSigningSession": {
|
|
527
|
+
"methods": ["MuSig2RegisterNonces", "MuSig2Sign"],
|
|
528
|
+
"type": "signer"
|
|
529
|
+
},
|
|
517
530
|
"updatePathfindingSettings": {
|
|
518
531
|
"method": "SetMissionControlConfig",
|
|
519
532
|
"type": "router"
|
|
@@ -56,7 +56,9 @@ const type = 'default';
|
|
|
56
56
|
message: <Error Message String>
|
|
57
57
|
}
|
|
58
58
|
[index]: <Payment Add Index Number>
|
|
59
|
-
[confirmed_at]: <Payment
|
|
59
|
+
[confirmed_at]: <Payment Attempt Succeeded At ISO 8601 Date String>
|
|
60
|
+
created_at: <Attempt Was Started At ISO 8601 Date String>
|
|
61
|
+
[failed_at]: <Payment Attempt Failed At ISO 8601 Date String>
|
|
60
62
|
is_confirmed: <Payment Attempt Succeeded Bool>
|
|
61
63
|
is_failed: <Payment Attempt Failed Bool>
|
|
62
64
|
is_pending: <Payment Attempt is Waiting For Resolution Bool>
|
|
@@ -55,7 +55,9 @@ const type = 'default';
|
|
|
55
55
|
message: <Error Message String>
|
|
56
56
|
}
|
|
57
57
|
[index]: <Payment Add Index Number>
|
|
58
|
-
[confirmed_at]: <Payment
|
|
58
|
+
[confirmed_at]: <Payment Attempt Succeeded At ISO 8601 Date String>
|
|
59
|
+
created_at: <Attempt Was Started At ISO 8601 Date String>
|
|
60
|
+
[failed_at]: <Payment Attempt Failed At ISO 8601 Date String>
|
|
59
61
|
is_confirmed: <Payment Attempt Succeeded Bool>
|
|
60
62
|
is_failed: <Payment Attempt Failed Bool>
|
|
61
63
|
is_pending: <Payment Attempt is Waiting For Resolution Bool>
|
|
@@ -57,6 +57,8 @@ const type = 'default';
|
|
|
57
57
|
}
|
|
58
58
|
[index]: <Payment Add Index Number>
|
|
59
59
|
[confirmed_at]: <Payment Confirmed At ISO 8601 Date String>
|
|
60
|
+
created_at: <Attempt Was Started At ISO 8601 Date String>
|
|
61
|
+
[failed_at]: <Payment Attempt Failed At ISO 8601 Date String>
|
|
60
62
|
is_confirmed: <Payment Attempt Succeeded Bool>
|
|
61
63
|
is_failed: <Payment Attempt Failed Bool>
|
|
62
64
|
is_pending: <Payment Attempt is Waiting For Resolution Bool>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript/shared';
|
|
5
|
+
|
|
6
|
+
export type AddExternalSocketArgs = AuthenticatedLightningArgs<{
|
|
7
|
+
/** Add Socket Address String */
|
|
8
|
+
socket: string;
|
|
9
|
+
}>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Add a new advertised p2p socket address
|
|
13
|
+
*
|
|
14
|
+
* Note: this method is not supported in LND versions 0.14.3 and below
|
|
15
|
+
*
|
|
16
|
+
* Requires LND built with `peersrpc` build tag
|
|
17
|
+
*
|
|
18
|
+
* Requires `peers:write` permissions
|
|
19
|
+
*/
|
|
20
|
+
export const addExternalSocket: AuthenticatedLightningMethod<AddExternalSocketArgs>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export * from './add_external_socket';
|
|
1
2
|
export * from './add_peer';
|
|
2
3
|
export * from './get_peers';
|
|
4
|
+
export * from './remove_external_socket';
|
|
3
5
|
export * from './remove_peer';
|
|
4
6
|
export * from './subscribe_to_peers';
|
|
7
|
+
export * from './update_alias';
|
|
8
|
+
export * from './update_color';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript/shared';
|
|
5
|
+
|
|
6
|
+
export type RemoveExternalSocketArgs = AuthenticatedLightningArgs<{
|
|
7
|
+
/** Remove Socket Address String */
|
|
8
|
+
socket: string;
|
|
9
|
+
}>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Remove an existing advertised p2p socket address
|
|
13
|
+
*
|
|
14
|
+
* Note: this method is not supported in LND versions 0.14.3 and below
|
|
15
|
+
*
|
|
16
|
+
* Requires LND built with `peersrpc` build tag
|
|
17
|
+
*
|
|
18
|
+
* Requires `peers:write` permissions
|
|
19
|
+
*/
|
|
20
|
+
export const removeExternalSocket: AuthenticatedLightningMethod<RemoveExternalSocketArgs>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript/shared';
|
|
5
|
+
|
|
6
|
+
export type UpdateAliasArgs = AuthenticatedLightningArgs<{
|
|
7
|
+
/** Node Alias String */
|
|
8
|
+
node: string;
|
|
9
|
+
}>;
|
|
10
|
+
|
|
11
|
+
export const updateAlias: AuthenticatedLightningMethod<UpdateAliasArgs>;
|