RAILGUN Reloaded
    Preparing search index...

    Stateful orchestration helper for trusted-dealer and coordinator-less DKG.

    Instances are single-flow helpers. Recreate them for new sessions instead of trying to reuse finalized state. In-progress sessions can be persisted and resumed across process restarts via DKGManager#toJSON and DKGManager.fromJSON.

    Index
    • Creates a DKG manager for a named participant.

      Parameters

      • participantName: string

        Human-readable participant name.

      • OptionalsecretCommKey: Uint8Array<ArrayBufferLike>

        Optional 32-byte communication key; random if omitted.

      Returns DKGManager

    • Lists peers whose dealer commitments are still outstanding.

      Returns number[]

      Roster ids whose dealer commitments have not yet been collected.

    • Lists peers whose encrypted-share bundles are still outstanding.

      Returns number[]

      Roster ids whose encrypted-share bundles have not yet been collected.

    • Projects the two progress dimensions onto the legacy linear flow state. State is derived from data, never assigned imperatively, so collection of the final commitment/share automatically advances the reported state.

      Returns DKGFlowState

      The current DKG flow state.

    • Coordination snapshot for UIs and protocol drivers: the derived state plus exactly what this participant is still waiting on from peers.

      Returns {
          state: DKGFlowState;
          awaitingCommitments: number[];
          awaitingEncryptedShares: number[];
      }

      Current state and the roster ids with outstanding artifacts.

    • Serializes the in-progress (or finalized) session to a JSON-safe snapshot.

      The snapshot includes secret material (this participant's communication key and any decrypted local shares); persist it only to trusted storage.

      Returns DKGSnapshot

      A versioned, hex-encoded snapshot suitable for JSON.stringify.

    • Runs a single trusted-dealer key generation flow and returns finalized outputs.

      Parameters

      • privateKey: bigint

        Dealer secret used as the constant polynomial term.

      • desiredShares: number

        Total number of participant shares to derive.

      • threshold: number

        Minimum number of shares required for signing/recovery.

      Returns {
          shares: { identifier: number; skShare: string; skShareDiv8: string }[];
          groupPublicKey: any;
          viewingPrivateKey: Uint8Array<ArrayBuffer>;
      }

      Finalized trusted-dealer shares, group public key, and viewing key.

    • Returns this participant's announcement payload for roster construction.

      Returns { pubKey: Uint8Array<ArrayBufferLike>; name: string }

      The participant name and public X25519 communication key.

    • Assigns the local participant identifier once the roster is known.

      Parameters

      • identifier: number

        Positive integer identifier assigned to this participant.

      Returns void

    • Assigns the full participant roster and derives per-peer shared secrets. The local participant's own announcement key must be present in the roster.

      Parameters

      • roster: Record<number, Uint8Array>

        Mapping of participant id to 32-byte public communication key.

      Returns void

    • Generates local polynomial commitments and dealer shares for a DKG round. Produces only — the caller broadcasts the returned commitments and feeds them back through DKGManager#addParticipantCommitments, exactly as it does for every peer dealer (one uniform collection path).

      Parameters

      • secret: bigint

        Dealer secret used as the constant polynomial term.

      • desiredShares: number

        Total number of participants expected in the roster.

      • threshold: number

        Minimum number of shares required by the DKG.

      Returns { shares: Record<number, bigint>; commitments: any[] }

      The dealer's per-recipient shares and public commitments.

    • Stores a dealer's public commitments for later verification and finalization.

      Parameters

      • participantID: number

        Dealer identifier.

      • participantCommitments: Point<bigint>[]

        Public commitments broadcast by that dealer.

      Returns void

    • Stores a dealer's encrypted share bundle for this DKG session.

      Parameters

      • participantID: number

        Dealer identifier.

      • shares: Record<number, EncryptedShare>

        Map of recipient id to encrypted share payload.

      Returns void

    • Decrypts the caller's shares from every dealer once all bundles are available.

      Returns Record<number, bigint>

      A map of dealer id to decrypted share scalar.

    • Finalizes the participant's aggregate signing share and group metadata.

      Returns {
          share: { id: number; skShare: bigint; skShareDiv8: bigint };
          PKGroup: Point<bigint>;
          viewingPrivateKey: Uint8Array;
      }

      The finalized participant share, group public key, and viewing key.

    • Derives the public X25519 communication key used for share transport.

      Parameters

      • secretKey: Uint8Array

        Private 32-byte X25519-compatible secret key.

      Returns Uint8Array<ArrayBufferLike>

      The public communication key.

    • Derives a shared secret with another participant's communication key.

      Parameters

      • theirPub: Uint8Array

        Another participant's public communication key.

      Returns Uint8Array<ArrayBufferLike>

      The derived shared secret.

    name: string

    Human-readable participant name used in announcements.

    Underlying trusted-dealer / coordinator-less DKG primitive.

    participantID: number | undefined

    Local participant identifier once the roster is known.

    pubComKey: Uint8Array

    Public X25519 communication key announced to peers.

    roster: Record<number, Uint8Array>

    Mapping of participant id to public communication key.

    keysByID: Record<number, Uint8Array> = {}

    Per-peer shared secrets derived from the roster.

    recipientIds: number[] = []

    Participant identifiers this dealer produced shares for.

    encryptedShares: Record<number, Record<number, EncryptedShare>> = {}

    Encrypted share bundles keyed by dealer id then recipient id.