bolts icon indicating copy to clipboard operation
bolts copied to clipboard

There should be a BOLT for internal key derivation

Open rustyrussell opened this issue 7 years ago • 2 comments

c-lightning uses a dumb system where the secrets (including the delayed_payment_point_secret and payment_point_secret which aren't needed for normal channel operation) are derived from a single seed using HKDF.

Since we're going to change that, I looked at lnd's much saner BIP-32-style https://github.com/lightningnetwork/lnd/blob/master/keychain/derivation.go . While it's completely optional, it serves as a well-thought-out method for key generation, so I'd like to turn it into a BOLT, with test vectors.

This would make creation of a wallet-independent salvage tool simpler, too.

rustyrussell avatar Jul 09 '18 10:07 rustyrussell

Interesting! We also implemented a simplistic BIP32-based derivation scheme for channel and node keys (with arbitrarily chosen paths).

sstone avatar Jul 09 '18 18:07 sstone

Can this be made into an official BOLT? I'm writing an implementation and I'm at the point now where I need to decide how to generate keys. I'd prefer my implementation to be consistent with other implementations (for recovery purposes, for instance). Is copying lnd the way to go?

canndrew avatar Aug 22 '19 05:08 canndrew