From ca69ebc839724184dbfe4f317d91413c358b2c8b Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 31 Dec 2025 07:01:59 -0800 Subject: [PATCH] fix(co-sign): use keygen N and T for TSS signing parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The TSS signing was failing with "U doesn't equal T" error because tss-party was passing incorrect parameters to tss.NewParameters(): - Was: len(sortedPartyIDs)=3 (signing participants), thresholdT-1=2 - Now: thresholdN=5 (keygen N), thresholdT=3 (keygen T) This matches how pkg/tss/signing.go creates parameters in server-party, which uses TotalParties=N and Threshold=T from the original keygen. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../services/service-party-app/tss-party/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 75dd00cb..43023996 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 @@ -597,9 +597,13 @@ func executeSign( // Create peer context and parameters // For signing with T parties from an N-party keygen: // - The peer context contains only the T signing parties - // - threshold parameter should be T-1 (since we need T parties to sign, threshold = T-1) + // - IMPORTANT: partyCount must be the original N from keygen, NOT current signers count + // - threshold must be the original T from keygen, NOT T-1 + // This matches how pkg/tss/signing.go creates parameters in server-party: + // params := tss.NewParameters(tss.S256(), peerCtx, selfTSSID, config.TotalParties, config.Threshold) + // where TotalParties=N from keygen and Threshold=T from keygen peerCtx := tss.NewPeerContext(sortedPartyIDs) - params := tss.NewParameters(tss.S256(), peerCtx, selfTSSID, len(sortedPartyIDs), thresholdT-1) + params := tss.NewParameters(tss.S256(), peerCtx, selfTSSID, thresholdN, thresholdT) // Create channels outCh := make(chan tss.Message, thresholdT*10)