mpcium icon indicating copy to clipboard operation
mpcium copied to clipboard

Proposal: Multi-Authorizer Event Initiator Proposal

Open anhthii opened this issue 1 year ago • 0 comments

This proposal adds multi-authorizer support to mpcium's InitiatorMessage system while keeping authorization policies in node configuration rather than embedded in messages.

Benefits

  • Risk Distribution

    • Requires multiple authorizers to sign on an event KeyGen, Sign.
    • Eliminates single points of failure.
  • Configuration Control

    • Node operators define and manage authorization policies.
    • Prevents clients from unilaterally dictating rules.
  • Operational Flexibility

    • Different operations (e.g., keygen, sign, reshare) can have different authorization requirements.
  • Backward Compatibility

    • Authorization is optional and can be disabled for existing deployments.

⚙️ Implementation Notes

  • Authorization is optional and controlled via configuration.
  • Uses the same configuration loading pattern as mpc_threshold.
  • Does not weaken existing message authentication and security mechanisms.
  • Allows operation-specific policies (e.g., different thresholds for signing vs key generation).
  • Produces clear and actionable error messages for authorization failures.

Enhanced InitiatorMessage Interface

Extend the existing InitiatorMessage interface to support authorizer signatures:

type InitiatorMessage interface {  
    // Existing methods  
    Raw() ([]byte, error)  
    Sig() []byte  
    InitiatorID() string  
      
    // New methods for multi-authorizer support  
    AuthorizerSigs() []AuthorizerSignature  
}  
  
type AuthorizerSignature struct {  
    AuthorizerID string `json:"authorizer_id"`  
    Signature    []byte `json:"signature"`  
}

type GenerateKeyMessage struct {  
    WalletID             string                `json:"wallet_id"`  
    Signature            []byte                `json:"signature"`  
    AuthorizerSignatures []AuthorizerSignature `json:"authorizer_signatures,omitempty"`  
}

type SignTxMessage struct {  
    KeyType              KeyType               `json:"key_type"`  
    WalletID             string                `json:"wallet_id"`  
    NetworkInternalCode  string                `json:"network_internal_code"`  
    TxID                 string                `json:"tx_id"`  
    Tx                   []byte                `json:"tx"`  
    Signature            []byte                `json:"signature"`  
    AuthorizerSignatures []AuthorizerSignature `json:"authorizer_signatures,omitempty"`  
}

Sample added configuration

# New authorization configuration  [header-2](#header-2)
authorization:  
  enabled: true  
  default_threshold: 2  
    
  # Operation-specific policies  
  operation_policies:  
    keygen:  
      required_authorizers: 2  
      authorizer_ids: ["auth1", "auth2", "auth3"]  
    signing:  
      required_authorizers: 1  
      authorizer_ids: ["auth1", "auth2"]  
    reshare:  
      required_authorizers: 3  
      authorizer_ids: ["auth1", "auth2", "auth3", "auth4"]  
    
  # Authorizer public keys  
  authorizers:  
    auth1:  
      pubkey: "1234567890abcdef..."  
      description: "Primary authorizer"  
    auth2:  
      pubkey: "abcdef1234567890..."  
      description: "Secondary authorizer"

anhthii avatar Aug 07 '25 05:08 anhthii