Commit Graph

3 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
cd068d8888
keychain: add initial set up interface-level tests 2018-03-06 16:03:59 -05:00
Olaoluwa Osuntokun
d6f54b30fc
keychain: add a btcwallet implementation of the KeyRing and SecretKeyRing interfaces 2018-03-06 16:03:59 -05:00
Olaoluwa Osuntokun
aebe7f35dc
keychain: introduce new package for deterministic key derivation + seed
In this commit, we add a new package to lnd: the keychain package. The
role of this package is to house all the interfaces that lnd will use
to generate the various keys it needs to create contracts and operate
within the network. Additionally, we also use this package to define a
deterministic key derivation scheme, that can be implemented by any
software/hardware that partially understands BIP43-like derivation.

The first version (v0) of the keychain schema is very simple. We re-use
BIP43, with a slight twist. Re-using BIP43 lets us leverage all the
existing libraries out there as far as compatibility. The purpose used
is 1017, and the coin type, the particular coin type of the chain where
the keys are meant to be used. Within our schema, we define multiple
“key families”. Each key family is actually just manifested as a new
“account” within the BIP44/43 family. With this schema, if we have
static description of the keys used within a channel, given the seed,
and the “KeyLocator”, we can re-derive all keys necessary be able to
re-sign for the channel.
2018-03-06 16:03:58 -05:00