ln-service 59.6.0 → 59.7.0
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 +7 -0
- package/README.md +36 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 59.7.0
|
|
4
|
+
|
|
5
|
+
- `signBytes`: Add `tag` to sign a BIP-340 tagged hash of the bytes with a
|
|
6
|
+
`schnorr` signature
|
|
7
|
+
- `verifyBytesSignature`: Add `tag` to verify a `schnorr` signature over a
|
|
8
|
+
BIP-340 tagged hash of the bytes
|
|
9
|
+
|
|
3
10
|
## 59.6.0
|
|
4
11
|
|
|
5
12
|
- `payViaRoutes`, `subscribeToPayViaRoutes`: Add support for routes into
|
package/README.md
CHANGED
|
@@ -5441,11 +5441,14 @@ Requires `signer:generate` permission
|
|
|
5441
5441
|
|
|
5442
5442
|
`schnorr` signature type is not supported on LND 0.15.0 and below
|
|
5443
5443
|
|
|
5444
|
+
`tag` is not supported on LND 0.17.5 and below and requires `schnorr` type
|
|
5445
|
+
|
|
5444
5446
|
{
|
|
5445
5447
|
key_family: <Key Family Number>
|
|
5446
5448
|
key_index: <Key Index Number>
|
|
5447
|
-
lnd: <Authenticated LND
|
|
5449
|
+
lnd: <Authenticated LND API Object>
|
|
5448
5450
|
preimage: <Bytes To Hash and Sign Hex Encoded String>
|
|
5451
|
+
[tag]: <BIP-340 Tagged Hash Tag UTF8 String>
|
|
5449
5452
|
[type]: <Signature Type String>
|
|
5450
5453
|
}
|
|
5451
5454
|
|
|
@@ -5466,6 +5469,16 @@ const {signature} = await signBytes({
|
|
|
5466
5469
|
key_index: 0,
|
|
5467
5470
|
preimage: '00',
|
|
5468
5471
|
});
|
|
5472
|
+
|
|
5473
|
+
// Get a schnorr signature over a BIP-340 tagged hash of the preimage
|
|
5474
|
+
const tagged = await signBytes({
|
|
5475
|
+
lnd,
|
|
5476
|
+
key_family: 6,
|
|
5477
|
+
key_index: 0,
|
|
5478
|
+
preimage: '00',
|
|
5479
|
+
tag: 'BIP0322-signed-message',
|
|
5480
|
+
type: 'schnorr',
|
|
5481
|
+
});
|
|
5469
5482
|
```
|
|
5470
5483
|
|
|
5471
5484
|
### signChainAddressMessage
|
|
@@ -8054,11 +8067,14 @@ Requires `signer:read` permission
|
|
|
8054
8067
|
|
|
8055
8068
|
Validating `schnorr` signatures is unsupported in LND 0.15.0 and below
|
|
8056
8069
|
|
|
8070
|
+
`tag` is not supported on LND 0.17.5 and below
|
|
8071
|
+
|
|
8057
8072
|
{
|
|
8058
8073
|
lnd: <Authenticated LND API Object>
|
|
8059
8074
|
preimage: <Message Preimage Bytes Hex Encoded String>
|
|
8060
8075
|
public_key: <Signature Valid For Public Key Hex String>
|
|
8061
8076
|
signature: <Signature Hex String>
|
|
8077
|
+
[tag]: <BIP-340 Tagged Hash Tag UTF8 String>
|
|
8062
8078
|
}
|
|
8063
8079
|
|
|
8064
8080
|
@returns via cbk or Promise
|
|
@@ -8083,6 +8099,25 @@ const validity = await verifyBytesSignature({
|
|
|
8083
8099
|
signature,
|
|
8084
8100
|
public_key: (await getIdentity({lnd})).public_key,
|
|
8085
8101
|
});
|
|
8102
|
+
|
|
8103
|
+
// Sign a BIP-340 tagged hash of the preimage with a schnorr signature
|
|
8104
|
+
const tagged = await signBytes({
|
|
8105
|
+
lnd,
|
|
8106
|
+
preimage,
|
|
8107
|
+
key_family: 6,
|
|
8108
|
+
key_index: 0,
|
|
8109
|
+
tag: 'BIP0322-signed-message',
|
|
8110
|
+
type: 'schnorr',
|
|
8111
|
+
});
|
|
8112
|
+
|
|
8113
|
+
// Verify the tagged hash signature using the x-only public key
|
|
8114
|
+
const taggedValidity = await verifyBytesSignature({
|
|
8115
|
+
lnd,
|
|
8116
|
+
preimage,
|
|
8117
|
+
public_key: (await getIdentity({lnd})).public_key.slice(2),
|
|
8118
|
+
signature: tagged.signature,
|
|
8119
|
+
tag: 'BIP0322-signed-message',
|
|
8120
|
+
});
|
|
8086
8121
|
```
|
|
8087
8122
|
|
|
8088
8123
|
### verifyChainAddressMessage
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"bolt07": "2.0.0",
|
|
16
16
|
"invoices": "6.2.0",
|
|
17
|
-
"lightning": "12.
|
|
17
|
+
"lightning": "12.5.0",
|
|
18
18
|
"macaroon": "3.0.4"
|
|
19
19
|
},
|
|
20
20
|
"description": "Interaction helper for your Lightning Network daemon",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"integration-test-0.20.0": "DOCKER_LND_VERSION=v0.20.0-beta npm run test",
|
|
67
67
|
"test": "echo $DOCKER_LND_VERSION && node test/runner"
|
|
68
68
|
},
|
|
69
|
-
"version": "59.
|
|
69
|
+
"version": "59.7.0"
|
|
70
70
|
}
|