Mpc Service
Flutter submodule for MPC operations over pluggable hardware transports.
Responsibilities:
Transport-agnostic connection lifecycle (scan, connect, disconnect)
MPC protocol operations (identity exchange, DKG, presign) via orchestrator
Internal storage management (Flutter never accesses storage directly)
Exposes the active HwTransport for BlockchainSdkService.signWithHw()
Progress tracking via shared MpcProgressTracker
Reactive connection state stream for Flutter UI
All transports (BLE, USB) are pre-registered. The consumer chooses which transport to use at scan/connect time via TransportType.
This service does NOT handle transaction signing or compilation. Transaction-aware signing lives in BlockchainSdkService.signWithHw().
Properties
Reactive connection state stream. Emits ConnectionInfo with current state, transport type, and device info.
Functions
Connect to a specific device by ID (e.g. from QR code on AC device).
Disconnect from the currently connected device.
Get the current MPC protocol state for UI progress tracking. Returns IDLE state if no tracker is configured.
Perform Distributed Key Generation with the AC device. One-time operation per MPC group — produces keyshares stored permanently.
Perform identity exchange with the AC device and server. One-time operation per MPC group — establishes P-256 identity keys for all 3 parties.
Perform presign with the AC device. Can be done ahead of time — stores presign material for fast signing later.
Stream discovered devices across all transports, or filter by type. Cancel collection to stop scanning.
Convenience: scan + connect to first matching device.