diff --git a/modules/abstract-utxo/src/impl/zec/zec.ts b/modules/abstract-utxo/src/impl/zec/zec.ts index f20e03d628..d32a22ecc1 100644 --- a/modules/abstract-utxo/src/impl/zec/zec.ts +++ b/modules/abstract-utxo/src/impl/zec/zec.ts @@ -1,7 +1,7 @@ /** * @prettier */ -import { BitGoBase } from '@bitgo/sdk-core'; +import { BitGoBase, MPCAlgorithm } from '@bitgo/sdk-core'; import { zcashAddress } from '@bitgo/wasm-utxo'; import { AbstractUtxoCoin } from '../../abstractUtxoCoin'; @@ -14,6 +14,16 @@ export class Zec extends AbstractUtxoCoin { super(bitgo); } + /** + * ZEC shielded (Orchard/Ironwood) custodial wallets use RedPallas threshold keys. + * Transparent (secp256k1 multisig) flows are unaffected: MPCAlgorithm is only + * consulted on the TSS custodial wallet-creation path. + * @inheritdoc + */ + getMPCAlgorithm(): MPCAlgorithm { + return 'redpallas'; + } + static createInstance(bitgo: BitGoBase): Zec { return new Zec(bitgo); } diff --git a/modules/sdk-core/src/bitgo/wallet/wallets.ts b/modules/sdk-core/src/bitgo/wallet/wallets.ts index 7303acbaf0..0fd00cf6aa 100644 --- a/modules/sdk-core/src/bitgo/wallet/wallets.ts +++ b/modules/sdk-core/src/bitgo/wallet/wallets.ts @@ -435,6 +435,25 @@ export class Wallets implements IWallets { throw new Error('EVM TSS wallets are only supported for wallet version 3, 5 and 6'); } + // Transparent zcash wallets are multisig and isTSS is not set inherently. + // Shielded zcash wallets are MPC + if (params.isShielded) { + assert(enterprise, 'enterprise is required for shielded wallet'); + if (type !== 'custodial') { + throw new Error('shielded wallets can only be created as custodial wallets'); + } + if (params.multisigType !== 'tss') { + throw new Error('shielded wallets must set/use multisigType tss'); + } + return this.generateCustodialMpcWallet({ + multisigType: 'tss', + isShielded: true, + label, + enterprise, + walletVersion: params.walletVersion, + }); + } + if (isTss) { if (!this.baseCoin.supportsTss()) { throw new Error(`coin ${this.baseCoin.getFamily()} does not support TSS at this time`); @@ -491,22 +510,6 @@ export class Wallets implements IWallets { return walletData; } - // Transparent zcash wallets are multisig and isTSS is not set inherently. - // Shielded zcash wallets are MPC - if (params.isShielded) { - assert(enterprise, 'enterprise is required for shielded wallet'); - if (type !== 'custodial') { - throw new Error('shielded wallets can only be created as custodial wallets'); - } - return this.generateCustodialMpcWallet({ - multisigType: 'tss', - isShielded: true, - label, - enterprise, - walletVersion: params.walletVersion, - }); - } - // Handle distributed custody if (isDistributedCustody) { if (!enterprise) {