/** * @fileoverview Unified TUPLE Storage Service * * This service ensures ALL data stored in BrightChain goes through TUPLE storage * for complete Owner-Free Filesystem compliance. Every piece of data is stored * as a TUPLE (3 blocks: data + 2 randomizers) to ensure plausible deniability. * * Storage hierarchy: * - Raw data blocks: TUPLE (3 blocks) * - CBL metadata: TUPLE (3 blocks) * - Message content: TUPLE (3 blocks) * - Participant data: TUPLE per participant (3 blocks each) * * This replaces the previous "cheating" approach where CBLs were stored with * a single whitener instead of a full TUPLE. */ import { BlockStoreOptions } from '../interfaces/storage/blockMetadata'; import { IBlockStore } from '../interfaces/storage/blockStore'; /** * Result of storing data as a TUPLE */ export interface TupleStorageResult { /** The data block ID */ dataBlockId: string; /** The two randomizer block IDs */ randomizerBlockIds: [string, string]; /** Magnet URL for reconstruction */ magnetUrl: string; /** Optional parity block IDs for each block */ parityBlockIds?: [string[], string[], string[]]; } /** * Unified service for TUPLE-based storage operations */ export declare class TupleStorageService { private readonly blockStore; constructor(blockStore: IBlockStore); /** * Store any data as a TUPLE (data + 2 randomizers) * * @param data - The data to store * @param options - Storage options (durability, expiration, etc.) * @returns TUPLE storage result with all block IDs and magnet URL */ storeTuple(data: Uint8Array, options?: BlockStoreOptions): Promise; /** * Retrieve data from a TUPLE * * @param dataBlockId - The data block ID * @param randomizerBlockIds - The two randomizer block IDs * @param parityBlockIds - Optional parity block IDs for recovery * @returns The original data */ retrieveTuple(dataBlockId: string, randomizerBlockIds: [string, string], parityBlockIds?: [string[], string[], string[]]): Promise; /** * Parse a TUPLE magnet URL * * Format: magnet:?xt=urn:brightchain:tuple&bs=&d=&r1=&r2=[&pd=][&pr1=][&pr2=] */ parseTupleMagnetUrl(magnetUrl: string): { dataBlockId: string; randomizerBlockIds: [string, string]; blockSize: number; parityBlockIds?: [string[], string[], string[]]; }; /** * Generate a TUPLE magnet URL */ private generateTupleMagnetUrl; /** * Retrieve a block with automatic recovery if needed */ private retrieveBlockWithRecovery; } //# sourceMappingURL=tupleStorageService.d.ts.map