Commit Graph
13 Commits
Author SHA1 Message Date
zeekay 0d7a523c3e security: add orgID multi-tenancy isolation, rename badger to zapdb
Multi-tenancy isolation (addresses Dragonfire review MPC audit):
- Add OrgID field to all event messages (keygen, sign, reshare)
- Scope session dedup keys as orgID-walletID-txID
- Namespace KVStore keys with org prefix (org:<orgID>:<key>)
- Backward-compatible fallback to legacy unscoped keys
- New org_kvstore.go with OrgScopedKey/GetKeyShareWithFallback

Naming cleanup:
- Rename all badger references to zapdb in code, config, tests
- config.yaml: badger_password → zapdb_password
- AppConfig: BadgerPassword → ZapDBPassword
- Fix MPCiumVersion typo → MPCVersion
2025-12-27 22:41:08 -08:00
zeekay 4641ad7c09 feat: BLS threshold + security hardening + ZapDB KMS-backing
Security (from red team review):
- Replay protection: request_id + timestamp freshness on sign API
- Ed25519 message auth re-enabled on all protocol messages
- DKG timeout (5min) + signing timeout (30s) with watchdog
- Dedup map TTL cleanup (10min expiry, 2min sweep)

BLS threshold signing:
- KeyTypeBLS + keygen/signing sessions
- TrustedDealer pattern for BLS DKG
- CBOR serialization for BLS config
- 8 tests

ZapDB KMS-backing:
- HSM PasswordProvider wired to ZapDB init
- Supports: AWS KMS, GCP KMS, Azure KV, env, file
- Default env for backward compat
- 19 tests

Also: sr25519 sessions, fixed SignWireMessage build break
2025-12-27 21:54:46 -08:00
zeekay b143c542e4 feat: sr25519 threshold signing for Polkadot/Substrate
MPC daemon now supports sr25519 (Schnorrkel) key generation and
threshold signing using FROST over the ristretto255 group.

New files:
- pkg/mpc/sr25519_keygen_session.go — threshold keygen
- pkg/mpc/sr25519_signing_session.go — threshold signing
- pkg/mpc/sr25519_config_marshal.go — CBOR serialization
- pkg/mpc/ristretto255.go — local curve implementation
- pkg/eventconsumer/signing_handler_sr25519.go — event routing

Wiring:
- KeyTypeSR25519 constant + session type
- Event consumer routes sr25519 keygen/signing events
- API accepts "sr25519" as valid protocol
- DOT/KSM network codes mapped to sr25519 key type
- Signing context configurable (default "substrate")

14 tests passing.
2025-12-27 21:41:32 -08: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
anhthii fa8a42e010 Secure file permission 2025-07-06 15:16:15 +07:00
CodyandGitHub c6e2c3c06f Add integration, unit testing CI pipelines (#48)
* Add comprehensive tests for multiple pkg

* Add db_path to config

* Add e2e testing pipeline

* Add github workflow

* Remove config.test.yaml

* Fix lint issue

* Increase timeout

* Add e2e testing for signing

* Skip signing if node is not in participant list

* Code cleanup

* Add e2e testing for signing and resharing

* Increase timeout

* Add test instructions

* Update github workflow branching

* Add vulnerabilties check in CI

* Fix ci
2025-07-06 14:26:03 +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
vietddude 95af28f8f1 Add resharing functionality with event handling and session management 2025-07-01 16:03:58 +07:00
anhthii 3780e3a617 Implement mpcium client + examples 2025-04-29 21:07:28 +07:00
anhthii 02d32325ad Implement identity store, multual signature verification 2025-04-27 21:11:18 +07:00