Closed apotdevin closed 3 years ago
I'm not sure I would use my node real private keys with arbitrary protocols...
If you consider that a private key is simply a random number, it is possible to generate a new key for this:
You can use diffieHellmanComputeSecret
to compute such a random series of bytes, doing the diffie with your own public key
You can convert random entropy to a mnemonic seed https://github.com/bitcoinjs/bip39
And you can convert that HD seed to derived keys: https://github.com/bitcoinjs/bip32
Ah the diffieHellman.. might just work. I believe the only requirement is that the random series of bytes doesn't change when computed again, and think this is the case with this one, will indeed check this 👍
Yes it will not change when computed again, although you might want to mess with the key family and index or use other methods to make sure you are separated off from something else that might use the same key for a different purpose
Awesome it worked perfectly 👍 Yeah for lnauth it suggests to use key family of 138
Tried with a v0.9.1 lnd node and it worked but for a v0.10.2 lnd node it gives:
503,
'UnexpetedErrorDerivingSharedKey',
{
err: Error: 1 CANCELLED: Received http2 header with status: 404
You know what could be the issue? Is version 0.10.2 not compatible with diffieHellmanComputeSecret
?
Awesome it worked perfectly 👍 Yeah for lnauth it suggests to use key family of 138
Tried with a v0.9.1 lnd node and it worked but for a v0.10.2 lnd node it gives:
503, 'UnexpetedErrorDerivingSharedKey', { err: Error: 1 CANCELLED: Received http2 header with status: 404
You know what could be the issue? Is version 0.10.2 not compatible with
diffieHellmanComputeSecret
?
Maybe the build flag wasn't present?
Might be, always have issues with that node. Will check, thanks for the help!
Hey, don't know if it's currently possible with the api but is there some way to derive a private key from your wallet with ln-service?
For example for ln-auth you need to derive a private key with the path
m/138'/0
for the signing