22 Commits
Author SHA1 Message Date
zeekay 8273105926 The signing curve is derived from the network, not stated by the caller
Solana addresses were correct and receive-only: ConsensusKeyInfoStore.Save was
the only RegisterKey caller and hardcoded "secp256k1", and TriggerSign read the
curve from that field, so no product entry point could reach Ed25519 signing.

The hardcode is not fixed, it is UNREPRESENTABLE. transport.KeyInfo.KeyType is
deleted — the record carries one public key per curve and a PublicKeyFor(curve)
— and RegisterKey lost its keyType parameter, so there is no longer a place to
state a curve wrongly. A scalar KeyType was the wrong shape anyway: one keygen
ceremony produces BOTH a secp256k1 and an Ed25519 key, so "what curve is this
wallet" has no single answer.

The request carries the network instead, and ONE table maps it to a curve, with
NO default arm — KeyTypeForNetwork returns ErrUnknownNetwork rather than
guessing. That is the point: the old default returned secp256k1 for anything
unrecognized, which is how a Solana request would have been signed with the
wrong key.

/sign's 32-byte clamp becomes the SCHEME's rule rather than the endpoint's:
secp256k1 signs a digest and requires exactly 32 bytes, Ed25519 signs the
message at any length. /sign no longer accepts key_type at all — two ways to say
the curve is the misuse being removed — and Network is bound into the
idempotency fingerprint, so the same bytes for SOL and ETH conflict instead of
sharing one cached signature from a different key.

⚠ The trap this nearly shipped with: every pre-existing KeyInfo record has EMPTY
public keys, because the old Save wrote "", "". A naive "does this wallet have
this curve" gate would have refused every existing wallet on every curve. The
check is gated on RecordsCurves() — a record naming no curve denies none, and
the missing share stays the thing that fails closed.

Verified end to end, not by mirroring: a Solana request through
ConsensusMPCBackend.TriggerSign with a real 2-of-3 FROST ring produces a
signature crypto/ed25519.Verify accepts, over a 63-byte message so any
reintroduced clamp or pre-hash fails it; ETH/EVM/BTC/LUX still route to
secp256k1 and must RECOVER to the wallet's key. Four mutations tried, all
caught.

Behavioral risk worth naming: an unrecognized chain string now fails its
transaction closed rather than signing with a default. That is correct, and the
real fix is validating chain at POST /v1/transactions.
2026-08-06 15:59:30 -07:00
zeekay acd726682a examples: port bitcoin/ethereum/lux/solana/tfhe MPC signing demos from hanzoai/mpc
Consolidate the hanzoai/mpc repo into luxfi/mpc (the canonical, deployed MPC —
v1.16.0, running as ghcr.io/luxfi/mpc across all clusters). hanzoai/mpc (legacy
v1.0.6) carried 5 chain-specific threshold-signing examples luxfi/mpc lacked;
they already import github.com/luxfi/mpc/pkg/threshold, so this is a clean port.
hanzoai/mpc is being archived — nothing imports it and the deployments already
run luxfi/mpc.
2026-06-28 14:49:40 -07:00
zeekay 8952776a9b fix: format imports with goimports
- Fix import formatting in all files
- Ensure consistent import grouping
- Resolve golangci-lint formatting issues
2025-08-17 00:00:28 -05:00
zeekay e89da4d563 Update examples 2025-08-07 10:55:10 -05:00
zeekay a4385c4754 Fix linting issues and Go version compatibility
- Remove unused imports (os/signal, syscall)
- Fix unused variable warning (msgBytes)
- Set Go version to 1.21 for CI compatibility
2025-08-02 22:21:09 -05:00
zeekay babf7e2c71 Fix CI build errors
- Remove local replace directive for threshold library
- Fix unused directMessaging variable warning
- Replace undefined logger.NewLogger with zap.NewProduction
- Fix GetMessage method call to use Raw()
- Mark bridge implementation as TODO
2025-08-02 22:17:16 -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 4ec50522c9 Add benchmarks, tests, updated docs 2025-08-02 15:27:50 -05:00
anhthii df63284a9b Gracefully close consumers 2025-07-11 22:29:31 +07:00
anhthii 5e48a47019 Add missing error handling 2025-07-11 21:08:02 +07:00
anhthii fa8a42e010 Secure file permission 2025-07-06 15:16:15 +07:00
anhthii 8912fda251 Fix resharing, only require t+1 participants, add session_id to remove idempotempt issue 2025-07-04 14:13:17 +07:00
anhthii 134ba09ad2 Rename success event -> result event 2025-07-03 21:59:46 +07:00
vietddude b59005c8ff chore: resolve PR review comments 2025-07-02 16:26:15 +07:00
vietddude 95af28f8f1 Add resharing functionality with event handling and session management 2025-07-01 16:03:58 +07:00
anhthii 91af31e885 Refactor session 2025-06-27 15:41:20 +07:00
anhthii 0ff4c0e9b7 Process key gen event concurrently 2025-06-27 10:03:37 +07:00
anhthii 3f1a7e3a68 Refactor clis to use requestPassword util 2025-04-30 21:26:10 +07:00
anhthii 1f944b3436 Update logs 2025-04-30 21:30:24 +07:00
anhthii e7da31eb7c Add version for cli 2025-04-30 21:44:48 +07:00
anhthii 1ee63ba4cb Relocate package 2025-04-30 19:06:46 +07:00
anhthii 3780e3a617 Implement mpcium client + examples 2025-04-29 21:07:28 +07:00