Skip to content

feat(tss): bump tss-lib v2.0.3 to v3.0.1 - #164

Merged
anhthii merged 3 commits into
masterfrom
feat/bump-tss-lib-v3
Sep 8, 2026
Merged

feat(tss): bump tss-lib v2.0.3 to v3.0.1#164
anhthii merged 3 commits into
masterfrom
feat/bump-tss-lib-v3

Conversation

@vietddude

@vietddude vietddude commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrate to fystack/tss-lib v3.0.1 (GG20 session binding + SRC-2026-573 hardening). Module path bumped v2v3 across root and e2e modules.

The only API break requiring code changes: ckd.ExtendedKey.PublicKey moved from *crypto.ECPoint to ecdsa.PublicKey. Adapted pkg/mpc/ckd.go — the ECDSA/EdDSA UpdateSinglePublicKeyAndAdjustBigXj helpers now take an ecdsa.PublicKey child key and convert internally.

Compatibility with existing (v2-generated) wallets

  • Key shares load unchangedLocalPartySaveData JSON format is identical between v2.0.3 and v3.0.1 (only import paths differ).
  • EdDSA CKD addresses unchanged — mpcium's own derivation already reduced IL mod N; v3 now matches it (v3 actually fixes non-hardened EdDSA CKD, which errored ~94% of the time under v2).

Tests added

  • pkg/ckdutil/golden_compat_test.go — golden vectors pinning ECDSA/EdDSA child pubkeys so any future derivation drift fails loudly.
  • pkg/mpc/ckd_update_test.go — invariants of the CKD update-and-adjust helpers.

Verification

  • Unit tests: all green.
  • e2e on 3 real v3 nodes: TestKeyGeneration, TestSigning, TestCKDSigning (ECDSA+EdDSA), TestResharing + signing-after-reshare — all PASS, 0 fail / 0 skip.

⚠️ Operational note

v3 binds ssid into proofs, so v2 and v3 nodes cannot interoperate. All 3 nodes must be upgraded together (no rolling/mixed-version rollout).

Migrate to fystack/tss-lib v3.0.1 (GG20 session binding + SRC-2026-573
hardening). Update module path v2->v3 across root and e2e modules.

Adapt pkg/mpc/ckd.go to the v3 API change where ckd.ExtendedKey.PublicKey
moved from *crypto.ECPoint to ecdsa.PublicKey; the ECDSA/EdDSA
UpdateSinglePublicKeyAndAdjustBigXj helpers now take an ecdsa.PublicKey
child key and convert internally.

Compatibility with v2-generated wallets verified:
- LocalPartySaveData JSON format unchanged; existing shares load and sign.
- EdDSA CKD addresses unchanged (local reimpl already reduced IL mod N,
  which v3 now matches).

Add regression tests:
- pkg/ckdutil golden vectors pinning ECDSA/EdDSA child pubkeys so any
  future derivation drift fails loudly.
- pkg/mpc CKD update-and-adjust invariants.

Verified: unit tests + full e2e (keygen, signing, CKD signing, resharing)
green on 3 v3 nodes.
@vietddude
vietddude force-pushed the feat/bump-tss-lib-v3 branch from 186564b to f9ae2e1 Compare August 31, 2026 02:55
@vietddude
vietddude requested a review from anhthii August 31, 2026 03:17
tss-lib v3 mixes an optional session nonce into the SSID that every ZK proof
is bound to (GG20 session binding). Without it, keygen and resharing run with
ssidNonce = 0, so two ceremonies among the same node set share an SSID and a
proof from one is valid in the other.

Derive the nonce as SHA-256(domainTag || 0x1f || initiatorPayload), where
initiatorPayload is the exact signed body of the initiator request
(msg.Raw()). Every node already verifies the same signed request, so every
node derives an identical nonce with no extra coordination round; the domain
tag keeps keygen / signing / resharing nonces disjoint.

- pkg/mpc/session_nonce.go: SessionNonceFromInitiator + newTSSParameters /
  newTSSReSharingParameters wrappers that require the nonce (fail-fast).
- Thread sessionNonce through Create{KeyGen,Signing,Reshare}Session and the
  session constructors; KeyGenSession.Init() now returns error.
- eventconsumer derives the nonce right after AuthorizeInitiatorMessage and
  handles the new Init() errors.

No client-facing change: pkg/types wire messages are untouched, the nonce is
derived server-side from fields the client already sends and signs. All nodes
must upgrade together (mixed nonce/no-nonce nodes compute different SSIDs).
@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

@anhthii
anhthii merged commit c4e9451 into master Sep 8, 2026
21 checks passed
@anhthii
anhthii deleted the feat/bump-tss-lib-v3 branch September 8, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants