mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Taproot support for wallets (#2830)
* Support taproot for HotWallet * Support taproot for hardware wallets * Fix NBX version * Undo formatting * Do not show Taproot when not supported * Create taproot wallet from xpub * Bug Fix
This commit is contained in:
@@ -55,6 +55,7 @@ namespace BTCPayServer.Controllers
|
||||
vm.RootKeyPath = network.GetRootKeyPath();
|
||||
vm.CanUseHotWallet = hotWallet;
|
||||
vm.CanUseRPCImport = rpcImport;
|
||||
vm.CanUseTaproot = TaprootSupported(vm.CryptoCode);
|
||||
|
||||
if (vm.Method == null)
|
||||
{
|
||||
@@ -109,6 +110,11 @@ namespace BTCPayServer.Controllers
|
||||
try
|
||||
{
|
||||
strategy = ParseDerivationStrategy(vm.DerivationScheme, network);
|
||||
if(strategy.AccountDerivation is TaprootDerivationStrategy && !TaprootSupported(vm.CryptoCode))
|
||||
{
|
||||
ModelState.AddModelError(nameof(vm.DerivationScheme), "Taproot is not supported");
|
||||
return View(vm.ViewName, vm);
|
||||
}
|
||||
strategy.Source = "ManualDerivationScheme";
|
||||
if (!string.IsNullOrEmpty(vm.AccountKey))
|
||||
{
|
||||
@@ -208,6 +214,7 @@ namespace BTCPayServer.Controllers
|
||||
|
||||
vm.CanUseHotWallet = hotWallet;
|
||||
vm.CanUseRPCImport = rpcImport;
|
||||
vm.CanUseTaproot = TaprootSupported(vm.CryptoCode);
|
||||
vm.RootKeyPath = network.GetRootKeyPath();
|
||||
vm.Network = network;
|
||||
|
||||
@@ -262,6 +269,12 @@ namespace BTCPayServer.Controllers
|
||||
CanUseRPCImport = rpcImport
|
||||
};
|
||||
|
||||
if (request.ScriptPubKeyType == ScriptPubKeyType.TaprootBIP86 && !TaprootSupported(cryptoCode) )
|
||||
{
|
||||
ModelState.AddModelError(nameof(request.ScriptPubKeyType), $"Taproot not supported");
|
||||
return View(vm.ViewName, vm);
|
||||
}
|
||||
|
||||
if (isImport && string.IsNullOrEmpty(request.ExistingMnemonic))
|
||||
{
|
||||
ModelState.AddModelError(nameof(request.ExistingMnemonic), "Please provide your existing seed");
|
||||
|
||||
Reference in New Issue
Block a user