/** * Split Paper Key Service for the BrightChain identity system. * * Splits a 24-word BIP39 paper key into N Shamir's Secret Sharing * shares with a configurable threshold T. Any T shares can reconstruct * the original paper key; fewer than T shares reveal nothing. * * Each share is encoded as a human-readable word sequence using the * BIP39 English wordlist as a dictionary (11 bits per word). Because * Shamir shares include metadata (bit-width, share index) and internal * padding, they are larger than the original 32-byte entropy, so they * cannot be represented as standard BIP39 mnemonics. Instead, the * service uses a raw 11-bit-per-word encoding that preserves the full * share hex string for lossless round-trip reconstruction. * * Requirements: 2.1, 2.2, 2.3, 2.4, 2.7 */ import { ISplitPaperKeyShare } from '../../interfaces/identity/splitPaperKey'; /** * Service for splitting and reconstructing BIP39 paper keys using * Shamir's Secret Sharing. * * All methods are static — the service is stateless and safe to call * from any context (browser or Node.js). * * @example * ```typescript * // Split a 24-word paper key into 5 shares, requiring 3 to reconstruct * const shares = SplitPaperKeyService.split(paperKey, 5, 3); * * // Reconstruct from any 3 shares * const recovered = SplitPaperKeyService.reconstruct(shares, 5); * * // Generate a printable template for share #1 * const template = await SplitPaperKeyService.generateShareTemplate( * shares[0], 1, 5, 3, * ); * ``` */ export declare class SplitPaperKeyService { /** * Split a 24-word BIP39 paper key into N Shamir shares. * * The paper key mnemonic is converted to its 32-byte entropy, then * the entropy hex is split using Shamir's Secret Sharing. Each * resulting share hex is encoded as human-readable words using the * BIP39 wordlist (11 bits per word). * * **Validates: Requirements 2.1, 2.2, 2.3** * * @param paperKey - A valid 24-word BIP39 mnemonic * @param shares - Total number of shares to generate (2–1,048,575) * @param threshold - Minimum shares needed to reconstruct (2–shares) * @returns Array of word-encoded share strings (space-separated words) * @throws {Error} If the paper key is invalid or parameters are out of range */ static split(paperKey: string, shares: number, threshold: number): string[]; /** * Reconstruct a paper key from T or more Shamir shares. * * The word-encoded shares are decoded back to hex, combined using * Shamir's Secret Sharing, and the resulting entropy is converted * back to a 24-word BIP39 mnemonic. * * **Validates: Requirement 2.4** * * @param shares - Array of word-encoded share strings (at least threshold count) * @param totalShares - The total number of shares originally created * (needed to re-initialise the secrets library with * the correct Galois Field bit-width) * @returns The original 24-word BIP39 paper key * @throws {Error} If shares are invalid or reconstruction fails */ static reconstruct(shares: string[], totalShares: number): string; /** * Generate a printable template for a single share. * * Produces an {@link ISplitPaperKeyShare} containing the share words, * a QR code data URL for mobile scanning, and human-readable * instructions with share number, total count, and threshold. * * **Validates: Requirement 2.7** * * @param share - Space-separated word-encoded share string * @param shareNumber - 1-based index of this share * @param totalShares - Total number of shares created * @param threshold - Minimum shares needed to reconstruct * @returns A promise resolving to the complete {@link ISplitPaperKeyShare} */ static generateShareTemplate(share: string, shareNumber: number, totalShares: number, threshold: number): Promise; } //# sourceMappingURL=splitPaperKeyService.d.ts.map