mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01:00
lnwallet: modify elkrem root derivation, derive from root HD seed
This commit modifies the elkrem root derivation for each newly created channel. First a master elkrem root is derived from the rood HD seed generated from private wallet data. Next, a HKDF is used with the secret being the master elkrem root.
This commit is contained in:
@@ -743,12 +743,13 @@ func DeriveRevocationPrivKey(commitPrivKey *btcec.PrivateKey,
|
||||
//
|
||||
// [1]: https://eprint.iacr.org/2010/264.pdf
|
||||
// [2]: https://tools.ietf.org/html/rfc5869
|
||||
func deriveElkremRoot(localMultiSigKey *btcec.PrivateKey,
|
||||
func deriveElkremRoot(elkremDerivationRoot *btcec.PrivateKey,
|
||||
localMultiSigKey *btcec.PublicKey,
|
||||
remoteMultiSigKey *btcec.PublicKey) wire.ShaHash {
|
||||
|
||||
secret := localMultiSigKey.Serialize()
|
||||
salt := remoteMultiSigKey.SerializeCompressed()
|
||||
info := []byte("elkrem")
|
||||
secret := elkremDerivationRoot.Serialize()
|
||||
salt := localMultiSigKey.SerializeCompressed()
|
||||
info := remoteMultiSigKey.SerializeCompressed()
|
||||
|
||||
rootReader := hkdf.New(sha256.New, secret, salt, info)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user