Commit Graph

11 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
917f929e70
keychain: use t.Helper() instead of manually fetching the line no from the runtime 2018-08-15 16:14:02 -07:00
Olaoluwa Osuntokun
cf06b041a4
keychain: extend TestKeyRingDerivation to check KeyLocators of derived keys 2018-08-14 19:11:41 -07:00
Olaoluwa Osuntokun
ad25ae1a07
keychain: ensure we properly set the KeyLocator for keys from DeriveNextKey
In this commit, we fix a slight bug in the existing implementation of
DeriveNextKey for btcwallet. Before this commit, we would only set the
public key, and not also the derivation path. It's important that we
also set the path information, as in the near future we'll be using the
KeyDescriptors returned from this method to create static channel back
ups. With these static backups, the key alone may be insufficient to
re-derive the private key as we may need to fallback to brute forcing in
order to re-derive the key as it's possible we add new key families in
the future.
2018-08-14 19:11:40 -07:00
Olaoluwa Osuntokun
6f60f139f4 multi: switch over import paths from roasbeef/* to btcsuite/* 2018-07-13 17:05:39 -07:00
Conner Fromknecht
b9df5e75f7
keychain/interface_test: init test wallet w/o recovery window 2018-04-26 16:03:27 -07:00
Conner Fromknecht
99a2ce00d6
keychain/interface_test: test btc and ltc key derivation 2018-03-13 16:33:46 -07:00
Conner Fromknecht
cb7f34895c
keychain/btwallet: support coin type configuration
This commit allows for secret keyrings to be initialized
with a specific coin type, which allows us to use
different derivation paths for bitcion and litecoin.

It also provide default constants for Bitcion and
Litecoin BIP 44 coin types.
2018-03-13 16:33:46 -07:00
Conner Fromknecht
df99882648
keychain/btcwallet: convert Locked() -> IsLocked() 2018-03-08 20:07:27 -05:00
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