Input Manager
TheStoffelInputManager 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:- MPC nodes generate input masks during preprocessing
- Clients reserve mask indices on-chain
- Clients submit masked inputs:
masked = input + mask - 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:- Read
maskedInputfrom contract - Subtract their mask share
- 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
requestIndexto 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
- StoffelCoordinator: State machine details
- Access Control: Role management
- Overview: Architecture overview