diff --git a/BTCPayServer.Common/BTCPayNetwork.cs b/BTCPayServer.Common/BTCPayNetwork.cs index 21ae3e888..b7b8d1177 100644 --- a/BTCPayServer.Common/BTCPayNetwork.cs +++ b/BTCPayServer.Common/BTCPayNetwork.cs @@ -70,40 +70,6 @@ namespace BTCPayServer public bool SupportPayJoin { get; set; } = false; public bool SupportLightning { get; set; } = true; - public KeyPath GetRootKeyPath(DerivationType type) - { - KeyPath baseKey; - if (!NBitcoinNetwork.Consensus.SupportSegwit) - { - baseKey = new KeyPath("44'"); - } - else - { - switch (type) - { - case DerivationType.Legacy: - baseKey = new KeyPath("44'"); - break; - case DerivationType.SegwitP2SH: - baseKey = new KeyPath("49'"); - break; - case DerivationType.Segwit: - baseKey = new KeyPath("84'"); - break; - default: - throw new ArgumentOutOfRangeException(nameof(type), type, null); - } - } - return baseKey - .Derive(CoinType); - } - - public KeyPath GetRootKeyPath() - { - return new KeyPath(NBitcoinNetwork.Consensus.SupportSegwit ? "49'" : "44'") - .Derive(CoinType); - } - public override T ToObject(string json) { return NBXplorerNetwork.Serializer.ToObject(json); diff --git a/BTCPayServer/Controllers/StoresController.Onchain.cs b/BTCPayServer/Controllers/StoresController.Onchain.cs index 3b4bc49b0..d09280a32 100644 --- a/BTCPayServer/Controllers/StoresController.Onchain.cs +++ b/BTCPayServer/Controllers/StoresController.Onchain.cs @@ -52,7 +52,6 @@ namespace BTCPayServer.Controllers var (hotWallet, rpcImport) = await CanUseHotWallet(); vm.Network = network; - vm.RootKeyPath = network.GetRootKeyPath(); vm.CanUseHotWallet = hotWallet; vm.CanUseRPCImport = rpcImport; vm.SupportTaproot = network.NBitcoinNetwork.Consensus.SupportTaproot; @@ -82,7 +81,6 @@ namespace BTCPayServer.Controllers } vm.Network = network; - vm.RootKeyPath = network.GetRootKeyPath(); DerivationSchemeSettings strategy = null; var wallet = _WalletProvider.GetWallet(network); @@ -214,7 +212,6 @@ namespace BTCPayServer.Controllers vm.SupportTaproot = network.NBitcoinNetwork.Consensus.SupportTaproot; vm.SupportSegwit = network.NBitcoinNetwork.Consensus.SupportSegwit; vm.IsTaprootActivated = TaprootActivated(vm.CryptoCode); - vm.RootKeyPath = network.GetRootKeyPath(); vm.Network = network; if (vm.Method == null) @@ -260,7 +257,6 @@ namespace BTCPayServer.Controllers SetupRequest = request, Confirmation = string.IsNullOrEmpty(request.ExistingMnemonic), Network = network, - RootKeyPath = network.GetRootKeyPath(), Source = isImport ? "SeedImported" : "NBXplorerGenerated", IsHotWallet = isImport ? request.SavePrivateKeys : method == WalletSetupMethod.HotWallet, DerivationSchemeFormat = "BTCPay", @@ -389,7 +385,6 @@ namespace BTCPayServer.Controllers vm.CanUseHotWallet = hotWallet; vm.CanUseRPCImport = rpcImport; - vm.RootKeyPath = network.GetRootKeyPath(); vm.Network = network; vm.Source = derivation.Source; vm.RootFingerprint = derivation.GetSigningAccountKeySettings().RootFingerprint.ToString(); diff --git a/BTCPayServer/Models/StoreViewModels/DerivationSchemeViewModel.cs b/BTCPayServer/Models/StoreViewModels/DerivationSchemeViewModel.cs index 6f6846217..2deeab5a3 100644 --- a/BTCPayServer/Models/StoreViewModels/DerivationSchemeViewModel.cs +++ b/BTCPayServer/Models/StoreViewModels/DerivationSchemeViewModel.cs @@ -22,8 +22,6 @@ namespace BTCPayServer.Models.StoreViewModels public string RootFingerprint { get; set; } public bool Confirmation { get; set; } - public KeyPath RootKeyPath { get; set; } - [Display(Name = "Wallet file")] public IFormFile WalletFile { get; set; } [Display(Name = "Wallet file content")]