11 Commits
Author SHA1 Message Date
zeekayandHanzo Dev 3685ebea4c mpc: make signature verification real, and stop trusting a caller's Y
Both protocol adapters shipped a Verify that returned false unconditionally —
cggmp21 with "For now, return false", frost with "doesn't support ECDSA". That
is not a safe default dressed up as one. A verifier that always fails is
indistinguishable from a verifier that works and was handed a bad signature, so
a caller using it as a signing-path health check sees a permanent, unexplained
failure, and a caller treating "unsupported" as skippable gets no verification
at all.

Both now verify. FROST is Schnorr rather than ECDSA, but its group key is still
a secp256k1 point and *ecdsa.PublicKey is only how this package's interface
carries one, so the point is recovered and handed to the FROST verifier.

pkg/protocol/curvekey.go holds the conversion both adapters need, replacing two
hand-rolled decompressions (a Tonelli-Shanks square root in cggmp21, a separate
helper in frost). CurvePoint goes the other way, and it validates rather than
assumes: an (X, Y) that is not on the curve is REJECTED, not silently corrected.
Compression keeps only the parity of Y, so a conversion that trusts X and
parity alone will happily turn an inconsistent key into a valid point and then
verify signatures against a key the caller never named. X=1 is a real X
coordinate on secp256k1, which is how the test that found this was written.

X is left-padded with FillBytes; big.Int drops leading zeros, so about one key
in 256 would otherwise encode short and fail to convert at all.

Bumps luxfi/threshold to v1.12.5 for pkg/quorum.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-25 11:45:23 -07:00
zeekay 3fceb5dce6 feat(mpc): key listing, KMS backup/restore, API-only backend, CGGMP21 config serialization 2025-12-27 16:03:48 -08:00
zeekay 9385abddd2 Sync improvements from hanzoai/mpc
Features:
- Add FROST keygen and signing sessions for EdDSA/Taproot
- Add LSS keygen and signing sessions with dynamic resharing
- Add CBOR serialization for FROST and LSS configs (fix JSON corruption)
- Add recovery byte calculation for Ethereum compatibility
- Add FROST signing handler for EdDSA signatures
- Upgrade threshold library to v1.5.2

Security:
- Fix config serialization using CBOR instead of JSON
- Add security audit findings to LLM.md
- Document blockchain support matrix

Files added:
- frost_config_marshal.go, frost_keygen_session.go
- lss_config_marshal.go, keygen_session_lss.go
- signing_session_frost.go, signing_session_lss.go
- recovery.go, signing_handler_frost.go
2025-12-27 09:06:37 -08:00
zeekay 6c1e9138ca chore: update logger imports and dependencies 2025-12-27 09:00:00 -08:00
zeekay efbcf5a8be refactor: migrate to modern NewHandler protocol API with logging support
Update all protocol handlers to use NewHandler() instead of legacy
NewMultiHandler() compatibility wrapper. This enables proper context
cancellation, protocol-level logging, and session ID tracking.

Changes:
- Add context.Background() and session IDs to all handler creations
- Add log.Logger fields to CGGMP21Protocol and FROSTProtocol structs
- Use protocol.DefaultConfig() for handler configuration
- Update handler types from *MultiHandler to *Handler
2025-12-25 09:51:41 -08:00
zeekay 7fc38de7dd fix: correct import grouping with golangci-lint
- Separate standard and third-party imports
- Follow proper import ordering convention
- Fix goimports violations
2025-08-17 00:37:38 -05:00
zeekay 7d585c39ad fix: resolve golangci-lint issues
- Fix goimports formatting in multiple files
- Remove unused keyType variables in kms_integration.go
- Clean up import formatting
2025-08-16 22:39:45 -05:00
zeekay e89da4d563 Update examples 2025-08-07 10:55:10 -05:00
zeekay b45ac639ac Fix remaining import formatting issues
- Run goimports on all pkg files
- Ensure consistent import grouping throughout codebase
2025-08-02 22:30:28 -05:00
zeekay 83969bc35e feat: Complete migration to luxfi/threshold library
Major changes:
- Replaced Binance TSS library with luxfi/threshold (supports CGGMP21 & FROST)
- Added XRPL network support for secp256k1 signatures
- Implemented resharing functionality for both ECDSA and EdDSA
- Fixed protocol adapters for CGGMP21 and FROST
- Updated event consumer to use new node methods
- Fixed all build errors in core packages

Technical improvements:
- Simplified party.ID usage (now string-based)
- Added proper message types and encoding
- Updated session interfaces with required methods
- Fixed test suite to work with new library structure

All core package tests passing. Ready for mainnet deployment.
2025-08-02 20:49:39 -05:00
zeekay 0b8661ced9 Use new threshold lib 2025-08-02 15:49:26 -05:00