UNPKG

meta-log-db

Version:

Native database package for Meta-Log (ProLog, DataLog, R5RS)

89 lines 3.13 kB
/** * BIP44 Wallet Derivation Paths * * Implements BIP44 standard derivation paths for deterministic wallet generation * Based on BIP44 specification: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki */ /** * BIP44 derivation path format: m / purpose' / coin_type' / account' / change / address_index * * @param purpose - Purpose (44 for BIP44) * @param coin - Coin type (0 for Bitcoin, 60 for Ethereum) * @param account - Account index * @param change - Change chain (0 for external, 1 for internal) * @param address - Address index * @returns Derivation path string */ export declare function getDerivationPath(purpose?: number, coin?: number, account?: number, change?: number, address?: number): string; /** * Standard BIP44 derivation paths for common cryptocurrencies */ export declare const StandardPaths: { bitcoin: (account?: number, change?: number, address?: number) => string; ethereum: (account?: number, change?: number, address?: number) => string; litecoin: (account?: number, change?: number, address?: number) => string; custom: (coinType: number, account?: number, change?: number, address?: number) => string; }; /** * Storage key derivation paths for Meta-Log Database * * These are custom derivation paths for different storage purposes: * - Local/private workspace keys * - Published content root keys * - Contributor signing keys * - Ephemeral sharing keys */ export declare const StorageDerivationPaths: { /** * Local/private workspace keys * Path: m/44'/999'/0'/0/0 */ LOCAL_PRIVATE: string; /** * Published content root keys * Path: m/44'/999'/1'/0/0 */ PUBLISHED_ROOT: string; /** * Contributor signing keys * Path: m/44'/999'/2'/0/0 */ CONTRIBUTOR_SIGNING: string; /** * Ephemeral sharing keys * Path: m/44'/999'/3'/0/0 */ EPHEMERAL_SHARING: string; /** * Helper: Published manifest key * Path: m/44'/999'/1'/{topicIndex}'/{nodeIndex}' */ publishedManifest: (topicIndex: number, nodeIndex: number) => string; /** * Helper: Contributor key * Path: m/44'/999'/2'/{contributorIndex}' */ contributorKey: (contributorIndex: number) => string; /** * Helper: Sharing key * Path: m/44'/999'/3'/{shareIndex}'/{sessionIndex}' */ sharingKey: (shareIndex: number, sessionIndex: number) => string; }; /** * Derive storage key from mnemonic and purpose * * @param mnemonic - BIP39 mnemonic phrase * @param purpose - Storage purpose ('local' | 'published' | 'contributor' | 'ephemeral') * @returns CryptoKey for encryption/decryption */ export declare function deriveStorageKey(mnemonic: string, purpose: 'local' | 'published' | 'contributor' | 'ephemeral'): Promise<CryptoKey>; /** * Derive storage key with custom path * * @param mnemonic - BIP39 mnemonic phrase * @param path - Custom derivation path * @returns CryptoKey for encryption/decryption */ export declare function deriveStorageKeyFromPath(mnemonic: string, path: string): Promise<CryptoKey>; //# sourceMappingURL=bip44.d.ts.map