mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
BLS is consensus-only. The mpcd validator-key custody path generated a
threshold-BLS group key via a TRUSTED DEALER (blsThreshold.TrustedDealer:
one node, the lowest sorted party ID, generated the entire group secret
key and all shares, then distributed them) — a single point of full-key
compromise, with no DKG and no rogue-key PoP. That violates the
public/leaderless/permissionless invariant "no single node can sign or
extract a key".
Orphan-safe: this path was incomplete (no proof/sign-off doc unlike
cmp/frost; no deployment manifest provisions validator-BLS; BLS keygen
had no dispatch caller) and NOT live custody. A validator's real BLS
consensus key is its own NATIVE per-validator crypto/bls key (PoP +
aggregation, the consensus fast-path), held at the node — never
threshold-custodied here. Corona PQ-threshold custody (dealerless DKG)
stays. So a validator keyset = {native BLS (consensus, no custody) +
corona PQ-threshold (custodied)}.
Delete: bls_keygen_session.go, bls_signing_session.go, bls_config_marshal.go,
bls_session_test.go, signing_handler_bls.go. Remove KeyTypeBLS (mpc + types),
SessionTypeBLS, CreateBLS{KeyGen,Sign}Session, the BLS signing/keytype
dispatch cases, the keygen-result BLSPubKey field, and the bls: key-share
prefix. handlers_kms.go: drop the BLS-custody half of ValidatorKeySet and
the generate/sign/rotate BLS branches; KMS custodies corona only.
Verified: GOWORK=off go build ./... + go vet green; pkg/mpc, pkg/api,
pkg/types tests pass. Zero residual refs to deleted BLS symbols.
42 lines
1.2 KiB
Go
42 lines
1.2 KiB
Go
package event
|
|
|
|
const (
|
|
KeygenBrokerStream = "mpc-keygen"
|
|
KeygenConsumerStream = "mpc-keygen-consumer"
|
|
KeygenRequestTopic = "mpc.keygen_request.*"
|
|
)
|
|
|
|
type KeygenResultEvent struct {
|
|
WalletID string `json:"wallet_id"`
|
|
ECDSAPubKey []byte `json:"ecdsa_pub_key"`
|
|
EDDSAPubKey []byte `json:"eddsa_pub_key"`
|
|
SR25519PubKey []byte `json:"sr25519_pub_key,omitempty"`
|
|
|
|
ResultType ResultType `json:"result_type"`
|
|
ErrorReason string `json:"error_reason"`
|
|
ErrorCode string `json:"error_code"`
|
|
}
|
|
|
|
// CreateKeygenSuccess creates a successful keygen event
|
|
func CreateKeygenSuccess(walletID string, pubKeyHex string, metadata map[string]any) *KeygenResultEvent {
|
|
return &KeygenResultEvent{
|
|
WalletID: walletID,
|
|
ECDSAPubKey: []byte(pubKeyHex),
|
|
ResultType: ResultTypeSuccess,
|
|
}
|
|
}
|
|
|
|
// CreateKeygenFailure creates a failed keygen event
|
|
func CreateKeygenFailure(walletID string, metadata map[string]any) *KeygenResultEvent {
|
|
errorMsg := ""
|
|
if err, ok := metadata["error"].(string); ok {
|
|
errorMsg = err
|
|
}
|
|
return &KeygenResultEvent{
|
|
WalletID: walletID,
|
|
ResultType: ResultTypeError,
|
|
ErrorReason: errorMsg,
|
|
ErrorCode: string(ErrorCodeKeygenFailure),
|
|
}
|
|
}
|