author: akumaigorodski
author: fiatjaf
author: hampus_s
discussion: https://t.me/lnurl/5155
This is based on the signmessage
API provided by some Lightning node implementations. It signs an HMAC of a message in a standard way using ECDSA with deterministic nonces, so it's always the same signature given the same key and message.
Here we define a canonical phrase to be signed, and from that we will derive the LNURL-auth seed.
In this case neither hashingKey
nor domain-specific linkingKey
s can be derived by the path. To overcome this limitation a different scheme is used for this class of wallets:
- The following canonical phrase is defined:
DO NOT EVER SIGN THIS TEXT WITH YOUR PRIVATE KEYS! IT IS ONLY USED FOR DERIVATION OF LNURL-AUTH HASHING-KEY, DISCLOSING ITS SIGNATURE WILL COMPROMISE YOUR LNURL-AUTH IDENTITY AND MAY LEAD TO LOSS OF FUNDS!
. LN WALLET
obtains anRFC6979
deterministic signature ofsha256(utf8ToBytes(canonical phrase))
usingsecp256k1
with node private key.LN WALLET
defineshashingKey
asPrivateKey(sha256(obtained signature))
.SERVICE
domain name is extracted from authLNURL
and then service-specificlinkingPrivKey
is defined asPrivateKey(hmacSha256(hashingKey, service domain name))
.
LN WALLET
must make sure it is not possible to accidentally or automatically sign and hand out a signature of canonical phrase.