Skip to main content
The StoffelInputManager contract handles client input submission for MPC computations, including mask reservation and ECDSA authentication.

Overview

How Input Masking Works

Clients don’t submit raw inputs on-chain (that would reveal them). Instead:
  1. MPC nodes generate input masks during preprocessing
  2. Clients reserve mask indices on-chain
  3. Clients submit masked inputs: masked = input + mask
  4. MPC nodes unmask during computation using their mask shares

Data Structures

MaskedInput

Inputs

Outputs

Storage

Functions

initializeInputMaskBuffer

Sets up the input mask buffer. Called by designated party during preprocessing.

reserveInputMask

Clients call this to reserve an input mask index.

submitMaskedInput

Clients submit their masked input using a reserved index.

authenticateClient

MPC nodes use this for off-chain client authentication via ECDSA.

getClientInput

Retrieve a client’s submitted input.

hasClientSubmitted

Check if a client has submitted their input.

Events

Client Workflow

1. Reserve a Mask Index

2. Get the Mask (Off-Chain)

3. Compute Masked Input

4. Submit Masked Input

5. MPC Nodes Unmask

During computation, MPC nodes:
  1. Read maskedInput from contract
  2. Subtract their mask share
  3. Proceed with MPC on the unmasked value

Authentication Flow

For off-chain operations, clients prove their identity:

Example: Complete Input Flow

Security Considerations

Index Reservation

  • Each index can only be reserved once
  • Prevents double-spending of masks
  • Clients should reserve early to ensure availability

Mask Uniqueness

  • Each mask is used exactly once
  • After submission, the index is unreserved
  • Prevents mask reuse attacks

Authentication

  • ECDSA signatures verify client identity
  • Prevents impersonation in off-chain communications
  • Message includes unique requestIndex to prevent replay

Input Privacy

  • Only masked values appear on-chain
  • Raw inputs never touch the blockchain
  • Privacy depends on MPC node security (threshold trust)

Next Steps