Blockchain Commons Components TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Function sskrCombineShares

    • Combines SSKR shares to reconstruct the original secret.

      This function matches the Rust sskr_combine API by accepting wrapped SSKRShare objects.

      Parameters

      Returns SSKRSecret

      The reconstructed SSKRSecret

      Error if shares cannot be combined (insufficient shares, mismatched IDs, etc.)

      import { sskrGenerateShares, sskrCombineShares } from '@bcts/components';

      // Generate shares
      const shares = sskrGenerateShares(spec, secret);

      // Combine 2 shares from the first group
      const recoveredSecret = sskrCombineShares([shares[0][0], shares[0][1]]);