walletunlocker+keychain+config_builder: use new aezeed version

This commit is contained in:
Oliver Gugger
2022-05-12 12:47:13 +02:00
parent daa5966119
commit 51a480129b
4 changed files with 26 additions and 11 deletions

View File

@@ -8,11 +8,20 @@ import (
)
const (
// KeyDerivationVersion is the version of the key derivation schema
// defined below. We use a version as this means that we'll be able to
// accept new seed in the future and be able to discern if the software
// is compatible with the version of the seed.
KeyDerivationVersion = 0
// KeyDerivationVersionLegacy is the previous version of the key
// derivation schema defined below. We use a version as this means that
// we'll be able to accept new seed in the future and be able to discern
// if the software is compatible with the version of the seed.
KeyDerivationVersionLegacy = 0
// KeyDerivationVersionTaproot is the most recent version of the key
// derivation scheme that marks the introduction of the Taproot
// derivation with BIP0086 support.
KeyDerivationVersionTaproot = 1
// CurrentKeyDerivationVersion is the current default key derivation
// version that is used for new seeds.
CurrentKeyDerivationVersion = KeyDerivationVersionTaproot
// BIP0043Purpose is the "purpose" value that we'll use for the first
// version or our key derivation scheme. All keys are expected to be
@@ -25,6 +34,13 @@ const (
BIP0043Purpose = 1017
)
// IsKnownVersion returns true if the given version is one of the known
// derivation scheme versions as defined by this package.
func IsKnownVersion(internalVersion uint8) bool {
return internalVersion == KeyDerivationVersionLegacy ||
internalVersion == KeyDerivationVersionTaproot
}
var (
// MaxKeyRangeScan is the maximum number of keys that we'll attempt to
// scan with if a caller knows the public key, but not the KeyLocator