ReconcileStoreDao

open class ReconcileStoreDao(val currentKeyshare: ByteArray?, val stagedKeyshare: ByteArray?, val keyId: String) : StorageDao

Data Access Object for storing and retrieving keyshare reconciliation state.

This DAO manages the two-phase lifecycle of keyshares during MPC operations:

Keyshare States

currentKeyshare

  • Purpose: Active keyshare ready for signing operations

  • Status: Fully reconciled and verified

  • Usage: Use this for all signing, derivation, and export operations

  • Safety: Can be used immediately after reconciliation completes

stagedKeyshare

  • Purpose: Keyshare awaiting final reconciliation step

  • Status: MPC computation complete, but reconciliation pending

  • Usage: Automatically becomes currentKeyshare after reconciliation

  • Recovery: If reconciliation fails, this can be reconciled later

State Transitions

Operation Start → MPC Computation → stagedKeyshare → Reconciliation → currentKeyshare

Network Failure/Interruption

stagedKeyshare (needs retry)

When States Are Used

  • keygen(): Creates stagedKeyshare, then reconciles to currentKeyshare

  • keyRefresh(): Creates stagedKeyshare, then reconciles to currentKeyshare

  • import(): Creates stagedKeyshare, then reconciles to currentKeyshare

  • reconcileKeyshare(): Converts existing stagedKeyshare to currentKeyshare

Implementation Notes

  • Both fields can be null (no keyshare stored)

  • Only one state should be non-null at a time (except during transitions)

  • Keyshares are sensitive cryptographic material - encrypt at rest

  • The keyId uniquely identifies this keyshare across all operations

Parameters

currentKeyshare

The active, reconciled keyshare ready for use (null if none)

stagedKeyshare

The pending keyshare awaiting reconciliation (null if none)

keyId

Unique identifier for this keyshare

Constructors

Link copied to clipboard
constructor(currentKeyshare: ByteArray?, stagedKeyshare: ByteArray?, keyId: String)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int