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

    Function sskrGenerateShares

    • Generates SSKR shares for the given spec and secret.

      This function matches the Rust sskr_generate API by returning wrapped SSKRShare objects instead of raw byte arrays.

      Parameters

      • spec: SSKRSpec

        The SSKRSpec instance defining group/member thresholds

      • masterSecret: SSKRSecret

        The SSKRSecret to be split into shares

      Returns SSKRShareCbor[][]

      Nested array of SSKRShare instances (groups × members)

      import { SSKRSecret, SSKRSpec, SSKRGroupSpec, sskrGenerateShares } from '@bcts/components';

      const secret = SSKRSecret.new(new Uint8Array(16).fill(0x42));
      const group = SSKRGroupSpec.new(2, 3); // 2 of 3
      const spec = SSKRSpec.new(1, [group]); // 1 group required

      const shares = sskrGenerateShares(spec, secret);
      // shares[0] contains 3 SSKRShare instances