diff --git a/backend/mpc-system/services/service-party-app/tss-party/main.go b/backend/mpc-system/services/service-party-app/tss-party/main.go index a03618b7..287fb233 100644 --- a/backend/mpc-system/services/service-party-app/tss-party/main.go +++ b/backend/mpc-system/services/service-party-app/tss-party/main.go @@ -595,12 +595,17 @@ func executeSign( sortedPartyIDs := tss.SortPartyIDs(tssPartyIDs) // Create peer context and parameters - // For co-managed signing: user says "3-of-5" meaning 3 signers needed - // tss-lib threshold parameter t means t+1 signers required - // So we pass thresholdT-1 to get the correct number of signers - // Example: user wants 3 signers -> pass threshold=2 -> tss-lib needs 2+1=3 signers + // For signing, the first parameter to NewParameters must be the number of parties + // actually participating in the signing (len(sortedPartyIDs)), NOT the original keygen N. + // The threshold parameter is the minimum signers minus 1 (tss-lib convention: t means t+1 required) + // + // For co-managed signing with 3-of-5: + // - thresholdN = 5 (original keygen parties) - NOT used here + // - thresholdT = 3 (signers needed) + // - len(sortedPartyIDs) = 3 (actual signing participants) + // - threshold param = thresholdT - 1 = 2 (tss-lib needs 2+1=3 signers) peerCtx := tss.NewPeerContext(sortedPartyIDs) - params := tss.NewParameters(tss.S256(), peerCtx, selfTSSID, thresholdN, thresholdT-1) + params := tss.NewParameters(tss.S256(), peerCtx, selfTSSID, len(sortedPartyIDs), thresholdT-1) // Create channels outCh := make(chan tss.Message, thresholdT*10)