diff --git a/backend/mpc-system/services/account/adapters/input/http/account_handler.go b/backend/mpc-system/services/account/adapters/input/http/account_handler.go index 3e577bd3..b8409344 100644 --- a/backend/mpc-system/services/account/adapters/input/http/account_handler.go +++ b/backend/mpc-system/services/account/adapters/input/http/account_handler.go @@ -732,12 +732,26 @@ func (h *AccountHTTPHandler) CreateSigningSession(c *gin.Context) { zap.String("username", req.Username), zap.Strings("configured_parties", partyIDs)) } else { - // Use all active parties (original behavior) - partyIDs = allActivePartyIDs + // For threshold signing, select minimum required parties (threshold_t) + // For 2-of-3, we need exactly 2 parties to sign (not all 3) + requiredParties := accountOutput.Account.ThresholdT + if len(allActivePartyIDs) < requiredParties { + c.JSON(http.StatusBadRequest, gin.H{ + "error": "insufficient active parties for signing", + "required": requiredParties, + "available": len(allActivePartyIDs), + }) + return + } - logger.Info("Using all active parties for signing", + // Select first 'threshold_t' parties + partyIDs = allActivePartyIDs[:requiredParties] + + logger.Info("Using minimum required parties for threshold signing", zap.String("username", req.Username), - zap.Strings("active_parties", partyIDs)) + zap.Int("threshold_t", requiredParties), + zap.Int("total_active", len(allActivePartyIDs)), + zap.Strings("selected_parties", partyIDs)) } // Check if any of the selected parties is a delegate