{"_id":"@asylia/atlas","_rev":"2-b80137c002b51018787f4c13f072d6ea","name":"@asylia/atlas","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@asylia/atlas","version":"0.0.1","keywords":["bitcoin","bip32","bip44","bip49","bip84","bip86","derivation","xpub","ypub","zpub","extended-public-key","script-type","p2pkh","p2wpkh","p2tr","taproot","segwit","typescript","crypto","blockchain"],"author":{"url":"David Zita","name":"Asylian21"},"license":"MIT","_id":"@asylia/atlas@0.0.1","maintainers":[{"name":"asylion21","email":"infodavidzita@gmail.com"}],"homepage":"https://github.com/Asylian21/Asylia.io/tree/main/packages/atlas#readme","bugs":{"url":"https://github.com/Asylian21/Asylia.io/issues"},"dist":{"shasum":"c5421e00c211a665514b9bced99c6e6fad1c2686","tarball":"https://registry.npmjs.org/@asylia/atlas/-/atlas-0.0.1.tgz","fileCount":15,"integrity":"sha512-aMHzjXQjFjjULrNYkOscYnePboSIB6Om/6hFiPXQignPtUyv461FhyNZJ2UWlN2wKjf+X6qtrNDSanfITtvWEQ==","signatures":[{"sig":"MEYCIQDGLfUkq05Ff0UfviyNJaoWJvZQa0FafRUMEAi2cmxL1gIhAN5blNnRVUgtPalphD70hdZDGpj4gbgxZutZLO4B7+xC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":153171},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"c1175430fe9d138ea084a78784ec43e9ca365cda","scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"asylion21","email":"infodavidzita@gmail.com"},"repository":{"url":"git+https://github.com/Asylian21/Asylia.io.git","type":"git","directory":"packages/atlas"},"_npmVersion":"10.9.2","description":"Bitcoin derivation standards library - TypeScript utilities for working with BIP standards, extended public keys, script types, and network configurations","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","typescript":"^5.7.3"},"_npmOperationalInternal":{"tmp":"tmp/atlas_0.0.1_1761465199504_0.26844940823895236","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@asylia/atlas","version":"0.0.2","description":"Bitcoin derivation standards library - TypeScript utilities for working with BIP standards, extended public keys, script types, and network configurations","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"keywords":["bitcoin","bip32","bip44","bip49","bip84","bip86","derivation","xpub","ypub","zpub","extended-public-key","script-type","p2pkh","p2wpkh","p2tr","taproot","segwit","typescript","crypto","blockchain"],"author":{"name":"Asylian21","url":"David Zita"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Asylian21/Asylia.io.git","directory":"packages/atlas"},"bugs":{"url":"https://github.com/Asylian21/Asylia.io/issues"},"homepage":"https://github.com/Asylian21/Asylia.io/tree/main/packages/atlas#readme","engines":{"node":">=18.0.0"},"devDependencies":{"tsup":"^8.3.5","typescript":"^5.7.3"},"publishConfig":{"access":"public"},"_id":"@asylia/atlas@0.0.2","gitHead":"a621f40c22c50bd7fd0716cdd938b6a77ba1a118","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-PZCt58Or2nP6jzXw5fM1YxRs0WZzC7pPymzwYJ1rMf1a1cvVJTEv0HggBqBKpUDAHlyBS340iuVJjUaKEcbljg==","shasum":"d3122369ce0f790ea6af84e9cd1e1f73fa52e2d3","tarball":"https://registry.npmjs.org/@asylia/atlas/-/atlas-0.0.2.tgz","fileCount":16,"unpackedSize":437184,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDdYCuYMEi61XLW5+t5ooOEnznjgrO8p7xFa3T0dIFFagIhAImp/UAUU6/YGpNRtP4DOTupc37oiQuqQZGaO/8DV0eB"}]},"_npmUser":{"name":"asylion21","email":"infodavidzita@gmail.com"},"directories":{},"maintainers":[{"name":"asylion21","email":"infodavidzita@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/atlas_0.0.2_1761521531150_0.617555576840717"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-26T07:53:19.397Z","modified":"2025-10-26T23:32:11.498Z","0.0.1":"2025-10-26T07:53:19.733Z","0.0.2":"2025-10-26T23:32:11.318Z"},"bugs":{"url":"https://github.com/Asylian21/Asylia.io/issues"},"author":{"name":"Asylian21","url":"David Zita"},"license":"MIT","homepage":"https://github.com/Asylian21/Asylia.io/tree/main/packages/atlas#readme","keywords":["bitcoin","bip32","bip44","bip49","bip84","bip86","derivation","xpub","ypub","zpub","extended-public-key","script-type","p2pkh","p2wpkh","p2tr","taproot","segwit","typescript","crypto","blockchain"],"repository":{"type":"git","url":"git+https://github.com/Asylian21/Asylia.io.git","directory":"packages/atlas"},"description":"Bitcoin derivation standards library - TypeScript utilities for working with BIP standards, extended public keys, script types, and network configurations","maintainers":[{"name":"asylion21","email":"infodavidzita@gmail.com"}],"readme":"# @asylia/atlas\n\n> Bitcoin Derivation Standards Library - TypeScript utilities for working with BIP standards, extended public keys, script types, and network configurations\n\n[![npm version](https://img.shields.io/npm/v/@asylia/atlas.svg)](https://www.npmjs.com/package/@asylia/atlas)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## 🚀 Features\n\n- **Type-Safe** - Full TypeScript support with comprehensive type definitions (84 total exports)\n- **Zero Dependencies** - Lightweight and self-contained\n- **Tree-Shakeable** - Optimized for modern bundlers\n- **Well-Documented** - Extensive JSDoc comments and examples\n- **Standards Compliant** - Implements Bitcoin BIP standards (32, 44, 45, 48, 49, 84, 86) plus Electrum Legacy\n- **Complete API** - 6 modules with enums, types, maps, constants, and utility functions\n  - Extended Public Key Prefixes (15 exports)\n  - Network Types (9 exports)\n  - Script Types (7 exports)\n  - BIP Derivation Purposes (7 exports)\n  - Derivation Path Variants (8 exports)\n  - Standard Derivation Paths (38 exports)\n\n## 📦 Installation\n\n```bash\n# npm\nnpm install @asylia/atlas\n\n# pnpm\npnpm add @asylia/atlas\n\n# yarn\nyarn add @asylia/atlas\n```\n\n## 🔧 Usage\n\n### Complete Import Example\n\nAll available exports from the package (84 total exports):\n\n```typescript\nimport {\n  // ============================================================================\n  // Extended Public Key Prefixes (15 exports)\n  // ============================================================================\n  ExtendedPubKeyPrefix, // Enum\n  type ExtendedPubKeyPrefixValue, // Type\n  type ExtendedPubKeyDisplayLabel, // Type\n  type ExtendedPubKeyNetworkClass, // Type\n  type ExtendedPubKeyScriptType, // Type\n  type Bip32VersionBytes, // Type\n  ExtendedPubKeyDisplayMap, // Map\n  ExtendedPubKeyNetworkMap, // Map\n  ExtendedPubKeyScriptTypeMap, // Map\n  ExtendedPubKeyBip32VersionMap, // Map\n  isMainnetPrefix, // Function\n  isTestnetPrefix, // Function\n  getPrefixFromExtendedPublicKey, // Function\n  guessScriptTypeFromPrefix, // Function\n  getBip32VersionBytes, // Function\n\n  // ============================================================================\n  // Network Types (9 exports)\n  // ============================================================================\n  NetworkType, // Enum\n  type NetworkTypeValue, // Type\n  type NetworkTypeKey, // Type\n  NetworkMap, // Map\n  NetworkReverseMap, // Map\n  networkKeyToValue, // Function\n  networkValueToKey, // Function\n  isMainnet, // Function\n  isTestnetFamily, // Function\n\n  // ============================================================================\n  // Script Types (7 exports)\n  // ============================================================================\n  ScriptType, // Enum\n  type ScriptTypeValue, // Type\n  type ScriptTypeUppercaseKey, // Type\n  ScriptTypeMap, // Map\n  ScriptTypeReverseMap, // Map\n  scriptTypeToValue, // Function\n  scriptTypeFromValue, // Function\n\n  // ============================================================================\n  // BIP Derivation Purposes (7 exports)\n  // ============================================================================\n  DERIVATION_PURPOSE_PREFIX, // Constant\n  DERIVATION_PURPOSE_LIST, // Constant\n  ELECTRUM_LEGACY_PURPOSE, // Constant\n  type DerivationPurposeNumber, // Type\n  type DerivationPurposeLabel, // Type\n  DerivationPurposeString, // Map\n  DerivationPurposeNumberMap, // Map\n\n  // ============================================================================\n  // Derivation Path Variants (8 exports)\n  // ============================================================================\n  DERIVATION_VARIANTS, // Constant\n  type DerivationVariant, // Type\n  type DerivationPathIDMainnetValue, // Type\n  type DerivationPathIDTestnetValue, // Type\n  type DerivationPathIDRegtestValue, // Type\n  DerivationPathIDMainnet, // Map\n  DerivationPathIDTestnet, // Map\n  DerivationPathIDRegtest, // Map\n\n  // ============================================================================\n  // Standard Derivation Paths (38 exports)\n  // ============================================================================\n  AccountIndex, // Enum\n  ChangeIndex, // Enum\n  AddressIndex, // Enum\n  COIN_TYPE_MAINNET, // Constant\n  COIN_TYPE_TESTNET, // Constant\n  type CoinType, // Type\n  type DerivationPathObject, // Type\n  type DerivationPathString, // Type\n  type StandardDerivationPath, // Type\n  type StandardPathsBip44, // Type\n  type StandardPathsBip49, // Type\n  type StandardPathsBip84, // Type\n  type StandardPathsBip86, // Type\n  type LegacyPathsType, // Type\n  type MultisigPathsType, // Type\n  type HistoricalPathsType, // Type\n  type PathsByNetworkMainnet, // Type\n  type PathsByNetworkTestnet, // Type\n  type PathsByNetworkRegtest, // Type\n  STANDARD_PATHS_BIP44, // Map\n  STANDARD_PATHS_BIP49, // Map\n  STANDARD_PATHS_BIP84, // Map\n  STANDARD_PATHS_BIP86, // Map\n  LEGACY_PATHS, // Map\n  MULTISIG_PATHS, // Map\n  HISTORICAL_PATHS, // Map\n  PATHS_BY_NETWORK_MAINNET, // Map\n  PATHS_BY_NETWORK_TESTNET, // Map\n  PATHS_BY_NETWORK_REGTEST, // Map\n  buildDerivationPath, // Function\n  parseDerivationPath, // Function\n  getStandardPath, // Function\n  getCoinTypeForNetwork, // Function\n  getPathsForNetwork, // Function\n  getCommonPathsForNetwork, // Function\n  getLegacyPathsForNetwork, // Function\n  getMultisigPathsForNetwork, // Function\n  getAllPathsByNetwork, // Function\n} from '@asylia/atlas';\n```\n\n### Extended Public Key Prefixes\n\nWork with xpub, ypub, zpub, and other extended public key prefixes:\n\n```typescript\nimport {\n  // Enum\n  ExtendedPubKeyPrefix,\n\n  // Types\n  type ExtendedPubKeyPrefixValue,\n  type ExtendedPubKeyDisplayLabel,\n  type ExtendedPubKeyNetworkClass,\n  type ExtendedPubKeyScriptType,\n  type Bip32VersionBytes,\n\n  // Maps\n  ExtendedPubKeyDisplayMap,\n  ExtendedPubKeyNetworkMap,\n  ExtendedPubKeyScriptTypeMap,\n  ExtendedPubKeyBip32VersionMap,\n\n  // Functions\n  isMainnetPrefix,\n  isTestnetPrefix,\n  guessScriptTypeFromPrefix,\n  getBip32VersionBytes,\n} from '@asylia/atlas';\n\n// Use enum values\nconst xpub = ExtendedPubKeyPrefix.XPUB; // 'xpub'\nconst zpub = ExtendedPubKeyPrefix.ZPUB; // 'zpub'\nconst trpub = ExtendedPubKeyPrefix.TRPUB; // 'trpub'\n\n// Extract prefix from extended public key string\nconst xpubString = 'xpub6CzbQ5BLF2mngsMXijEf...';\nconst detectedPrefix = getPrefixFromExtendedPublicKey(xpubString);\nconsole.log(detectedPrefix); // 'xpub'\n\n// Check if a prefix is mainnet/testnet\nconst isMainnet = isMainnetPrefix('xpub'); // true\nconst isTestnet = isTestnetPrefix('tpub'); // true\n\n// Get script type from prefix\nconst scriptType = guessScriptTypeFromPrefix('zpub'); // 'p2wpkh' (Native SegWit)\n\n// Get network from prefix\nconst network = ExtendedPubKeyNetworkMap[ExtendedPubKeyPrefix.YPUB]; // 'MAINNET'\n\n// Get display label\nconst label = ExtendedPubKeyDisplayMap[ExtendedPubKeyPrefix.ZPUB]; // 'Zpub'\n\n// Get BIP32 version bytes for serialization\nconst zpubVersions = ExtendedPubKeyBip32VersionMap.zpub;\nconsole.log(zpubVersions.public.toString(16)); // '4b24746'\nconsole.log(zpubVersions.private.toString(16)); // '4b2430c'\n\n// Or use the helper function\nconst versions = getBip32VersionBytes('zpub');\nif (versions) {\n  console.log('Public:', versions.public.toString(16));\n  console.log('Private:', versions.private.toString(16));\n}\n```\n\n#### BIP32 Version Bytes\n\nAccess BIP32 version bytes for extended key serialization:\n\n```typescript\nimport {\n  ExtendedPubKeyBip32VersionMap,\n  getBip32VersionBytes,\n  type Bip32VersionBytes,\n} from '@asylia/atlas';\n\n// Get version bytes directly from the map\nconst xpubVersions = ExtendedPubKeyBip32VersionMap.xpub;\nconsole.log(xpubVersions.public); // 0x0488b21e (76067358)\nconsole.log(xpubVersions.private); // 0x0488ade4 (76066276)\n\n// All mainnet version bytes\nconst mainnetVersions = {\n  xpub: ExtendedPubKeyBip32VersionMap.xpub, // Legacy (BIP44)\n  ypub: ExtendedPubKeyBip32VersionMap.ypub, // Nested SegWit (BIP49)\n  zpub: ExtendedPubKeyBip32VersionMap.zpub, // Native SegWit (BIP84)\n  trpub: ExtendedPubKeyBip32VersionMap.trpub, // Taproot (BIP86)\n};\n\n// All testnet version bytes\nconst testnetVersions = {\n  tpub: ExtendedPubKeyBip32VersionMap.tpub, // Legacy (BIP44)\n  upub: ExtendedPubKeyBip32VersionMap.upub, // Nested SegWit (BIP49)\n  vpub: ExtendedPubKeyBip32VersionMap.vpub, // Native SegWit (BIP84)\n  trpubt: ExtendedPubKeyBip32VersionMap.trpubt, // Taproot (BIP86)\n};\n\n// Use the helper function with error handling\nfunction getVersionBytesForPrefix(prefix: string) {\n  const versions = getBip32VersionBytes(prefix as any);\n  if (versions) {\n    return {\n      publicHex: '0x' + versions.public.toString(16),\n      privateHex: '0x' + versions.private.toString(16),\n    };\n  }\n  return null;\n}\n\nconst zpubHex = getVersionBytesForPrefix('zpub');\n// { publicHex: '0x4b24746', privateHex: '0x4b2430c' }\n\n// Format version bytes for use in extended key serialization\nconst formatVersionBytes = (versions: Bip32VersionBytes) => {\n  const publicBytes = Buffer.allocUnsafe(4);\n  const privateBytes = Buffer.allocUnsafe(4);\n  publicBytes.writeUInt32BE(versions.public, 0);\n  privateBytes.writeUInt32BE(versions.private, 0);\n  return { publicBytes, privateBytes };\n};\n\nconst zpubBytes = formatVersionBytes(ExtendedPubKeyBip32VersionMap.zpub);\n// publicBytes: <Buffer 04 b2 47 46>\n// privateBytes: <Buffer 04 b2 43 0c>\n```\n\n**What are BIP32 Version Bytes?**\n\nVersion bytes are 4-byte integers prepended to extended keys during serialization. They identify:\n\n- The network (mainnet vs testnet)\n- The derivation purpose (BIP44, BIP49, BIP84, BIP86)\n- The address type that will be generated (P2PKH, P2WPKH, etc.)\n\nWhen an extended key is serialized to Base58Check format (xpub/xprv string), the version bytes are the first 4 bytes of the payload, which then get encoded into the final string. Different version bytes result in different prefixes (xpub, ypub, zpub, etc.).\n\n**Version Bytes Reference:**\n\n| Prefix    | Network | Purpose             | Public Version | Private Version |\n| --------- | ------- | ------------------- | -------------- | --------------- |\n| xpub/xprv | Mainnet | BIP44 Legacy        | `0x0488b21e`   | `0x0488ade4`    |\n| ypub/yprv | Mainnet | BIP49 Nested SegWit | `0x049d7cb2`   | `0x049d7878`    |\n| zpub/zprv | Mainnet | BIP84 Native SegWit | `0x04b24746`   | `0x04b2430c`    |\n| trpub     | Mainnet | BIP86 Taproot       | `0x0488b21e`   | `0x0488ade4`    |\n| tpub/tprv | Testnet | BIP44 Legacy        | `0x043587cf`   | `0x04358394`    |\n| upub/uprv | Testnet | BIP49 Nested SegWit | `0x044a5262`   | `0x044a4e28`    |\n| vpub/vprv | Testnet | BIP84 Native SegWit | `0x045f1cf6`   | `0x045f18bc`    |\n| trpubt    | Testnet | BIP86 Taproot       | `0x043587cf`   | `0x04358394`    |\n\n**Note:** Taproot prefixes (trpub/trpubt) reuse the same version bytes as xpub/tpub because BIP86 wasn't originally part of the extended key prefix specification.\n\n### Network Types\n\nHandle Bitcoin network types (mainnet, testnet, regtest):\n\n```typescript\nimport {\n  // Enum\n  NetworkType,\n\n  // Types\n  type NetworkTypeValue,\n  type NetworkTypeKey,\n\n  // Maps\n  NetworkMap,\n  NetworkReverseMap,\n\n  // Functions\n  networkKeyToValue,\n  networkValueToKey,\n  isMainnet,\n  isTestnetFamily,\n} from '@asylia/atlas';\n\n// Use enum values\nconst mainnet = NetworkType.MAINNET; // 'mainnet'\nconst testnet = NetworkType.TESTNET; // 'testnet'\nconst regtest = NetworkType.REGTEST; // 'regtest'\n\n// Convert between formats\nconst value = networkKeyToValue('MAINNET'); // 'mainnet'\nconst key = networkValueToKey('testnet'); // 'TESTNET'\n\n// Check network type\nconst isMain = isMainnet('mainnet'); // true\nconst isTest = isTestnetFamily('testnet'); // true\nconst isReg = isTestnetFamily('regtest'); // true\n\n// Use maps\nconst networkValue = NetworkMap.MAINNET; // 'mainnet'\nconst networkKey = NetworkReverseMap.mainnet; // 'MAINNET'\n```\n\n### Script Types\n\nWork with different Bitcoin script types:\n\n```typescript\nimport {\n  // Enum\n  ScriptType,\n\n  // Types\n  type ScriptTypeValue,\n  type ScriptTypeUppercaseKey,\n\n  // Maps\n  ScriptTypeMap,\n  ScriptTypeReverseMap,\n\n  // Functions\n  scriptTypeToValue,\n  scriptTypeFromValue,\n} from '@asylia/atlas';\n\n// Use enum values\nconst legacyScript = ScriptType.P2PKH; // 'p2pkh'\nconst nestedSegwit = ScriptType.P2SH_P2WPKH; // 'p2sh-p2wpkh'\nconst segwitScript = ScriptType.P2WPKH; // 'p2wpkh'\nconst taprootScript = ScriptType.P2TR; // 'p2tr'\nconst multisigScript = ScriptType.P2SH_MULTISIG; // 'p2sh-multisig'\nconst wshScript = ScriptType.P2WSH; // 'p2wsh'\nconst wshP2shScript = ScriptType.P2WSH_P2SH; // 'p2wsh-p2sh'\n\n// Convert between formats\nconst value = scriptTypeToValue('P2WPKH'); // 'p2wpkh'\nconst key = scriptTypeFromValue('p2tr'); // 'P2TR'\n\n// Use maps\nconst scriptValue = ScriptTypeMap.P2WPKH; // 'p2wpkh'\nconst scriptKey = ScriptTypeReverseMap['p2wpkh']; // 'P2WPKH'\n```\n\n### BIP Derivation Purposes\n\nAccess BIP standard numbers and labels:\n\n```typescript\nimport {\n  // Constants\n  DERIVATION_PURPOSE_PREFIX,\n  DERIVATION_PURPOSE_LIST,\n\n  // Types\n  type DerivationPurposeNumber,\n  type DerivationPurposeLabel,\n\n  // Maps\n  DerivationPurposeString,\n  DerivationPurposeNumberMap,\n} from '@asylia/atlas';\n\n// Get all supported BIP numbers\nconst bips = DERIVATION_PURPOSE_LIST; // [44, 45, 48, 49, 84, 86]\n\n// Get the prefix\nconst prefix = DERIVATION_PURPOSE_PREFIX; // 'BIP'\n\n// Use BIP labels\nconst bip44 = DerivationPurposeString.BIP_44; // 'BIP_44'\nconst bip49 = DerivationPurposeString.BIP_49; // 'BIP_49'\nconst bip84 = DerivationPurposeString.BIP_84; // 'BIP_84'\nconst bip86 = DerivationPurposeString.BIP_86; // 'BIP_86'\nconst bip45 = DerivationPurposeString.BIP_45; // 'BIP_45'\nconst bip48 = DerivationPurposeString.BIP_48; // 'BIP_48'\n\n// Convert label to number\nconst number44 = DerivationPurposeNumberMap.BIP_44; // 44\nconst number84 = DerivationPurposeNumberMap.BIP_84; // 84\nconst number86 = DerivationPurposeNumberMap.BIP_86; // 86\n```\n\n### Standard Derivation Paths\n\nWork with Bitcoin derivation paths in both string and object formats:\n\n```typescript\nimport {\n  // Enums\n  AccountIndex,\n  ChangeIndex,\n  AddressIndex,\n\n  // Constants\n  COIN_TYPE_MAINNET,\n  COIN_TYPE_TESTNET,\n\n  // Types\n  type CoinType,\n  type DerivationPathObject,\n  type DerivationPathString,\n  type StandardDerivationPath,\n\n  // Standard path maps\n  STANDARD_PATHS_BIP44,\n  STANDARD_PATHS_BIP49,\n  STANDARD_PATHS_BIP84,\n  STANDARD_PATHS_BIP86,\n\n  // Functions\n  buildDerivationPath,\n  parseDerivationPath,\n  getStandardPath,\n  getCoinTypeForNetwork,\n} from '@asylia/atlas';\n\n// Use enum values for type-safe indices\nconst account = AccountIndex.ACCOUNT_0; // 0\nconst receive = ChangeIndex.RECEIVE; // 0\nconst change = ChangeIndex.CHANGE; // 1\nconst address = AddressIndex.ADDRESS_0; // 0\n\n// Build a custom derivation path\nconst customPath = buildDerivationPath(\n  84, // BIP84 (Native SegWit)\n  COIN_TYPE_MAINNET,\n  AccountIndex.ACCOUNT_0,\n  ChangeIndex.RECEIVE,\n  AddressIndex.ADDRESS_5\n);\nconsole.log(customPath.path); // \"m/84'/0'/0'/0/5\"\nconsole.log(customPath.components.purpose); // 84\nconsole.log(customPath.components.addressIndex); // 5\n\n// Parse an existing derivation path\nconst parsed = parseDerivationPath(\"m/84'/0'/0'/0/0\");\nconsole.log(parsed.purpose); // 84\nconsole.log(parsed.coinType); // 0\nconsole.log(parsed.account); // 0\nconsole.log(parsed.change); // 0\nconsole.log(parsed.addressIndex); // 0\n\n// Get standard path with defaults\nconst standardPath = getStandardPath(84, 'MAINNET');\nconsole.log(standardPath.path); // \"m/84'/0'/0'/0/0\"\n\n// Get standard path with custom values\nconst customStandard = getStandardPath(\n  86, // BIP86 (Taproot)\n  'TESTNET',\n  AccountIndex.ACCOUNT_1,\n  ChangeIndex.CHANGE,\n  AddressIndex.ADDRESS_10\n);\nconsole.log(customStandard.path); // \"m/86'/1'/1'/1/10\"\n\n// Use pre-defined standard paths for BIP84 (Native SegWit)\nconst firstReceive = STANDARD_PATHS_BIP84.FIRST_RECEIVE_MAINNET;\nconsole.log(firstReceive.path); // \"m/84'/0'/0'/0/0\"\n\nconst firstChange = STANDARD_PATHS_BIP84.FIRST_CHANGE_MAINNET;\nconsole.log(firstChange.path); // \"m/84'/0'/0'/1/0\"\n\nconst secondAccount = STANDARD_PATHS_BIP84.SECOND_ACCOUNT_MAINNET;\nconsole.log(secondAccount.path); // \"m/84'/0'/1'/0/0\"\n\n// Use pre-defined standard paths for BIP86 (Taproot)\nconst taprootPath = STANDARD_PATHS_BIP86.FIRST_RECEIVE_MAINNET;\nconsole.log(taprootPath.path); // \"m/86'/0'/0'/0/0\"\nconsole.log(taprootPath.components.purpose); // 86\n\n// Get coin type for a network\nconst mainnetCoin = getCoinTypeForNetwork('MAINNET'); // 0\nconst testnetCoin = getCoinTypeForNetwork('testnet'); // 1\nconst regtestCoin = getCoinTypeForNetwork('REGTEST'); // 1\n\n// Iterate through address indices\nfor (let i = AddressIndex.ADDRESS_0; i <= AddressIndex.ADDRESS_9; i++) {\n  const path = buildDerivationPath(\n    84,\n    COIN_TYPE_MAINNET,\n    AccountIndex.ACCOUNT_0,\n    ChangeIndex.RECEIVE,\n    i\n  );\n  console.log(path.path); // m/84'/0'/0'/0/0, m/84'/0'/0'/0/1, ...\n}\n```\n\n### Legacy and Historical Derivation Paths\n\nWork with legacy formats like Electrum Legacy and BIP32 basic paths:\n\n```typescript\nimport { LEGACY_PATHS, MULTISIG_PATHS, HISTORICAL_PATHS } from '@asylia/atlas';\n\n// Electrum Legacy paths (m/0'/change/index format)\nconst electrumReceive = LEGACY_PATHS.ELECTRUM_LEGACY_FIRST_RECEIVE;\nconsole.log(electrumReceive.path); // \"m/0'/0/0\"\n\nconst electrumChange = LEGACY_PATHS.ELECTRUM_LEGACY_FIRST_CHANGE;\nconsole.log(electrumChange.path); // \"m/0'/1/0\"\n\n// BIP32 basic paths\nconst bip32Receive = LEGACY_PATHS.BIP32_BASIC_FIRST_RECEIVE;\nconsole.log(bip32Receive.path); // \"m/0'/0/0\"\n\nconst bip32NonHardened = LEGACY_PATHS.BIP32_NON_HARDENED;\nconsole.log(bip32NonHardened.path); // \"m/0/0/0\"\n\n// Multi-signature paths\n// BIP45 (m/45'/cosigner/change/index)\nconst bip45 = MULTISIG_PATHS.BIP45_COSIGNER_0_RECEIVE_MAINNET;\nconsole.log(bip45.path); // \"m/45'/0/0/0\"\n\n// BIP48 with P2WSH-P2SH (script_type=1)\nconst bip48WshP2sh = MULTISIG_PATHS.BIP48_P2WSH_P2SH_RECEIVE_MAINNET;\nconsole.log(bip48WshP2sh.path); // \"m/48'/0'/0'/1'/0/0\"\n\n// BIP48 with P2WSH (script_type=2)\nconst bip48Wsh = MULTISIG_PATHS.BIP48_P2WSH_RECEIVE_MAINNET;\nconsole.log(bip48Wsh.path); // \"m/48'/0'/0'/2'/0/0\"\n\n// Access all historical paths at once\nconst allHistorical = HISTORICAL_PATHS;\nconsole.log(Object.keys(allHistorical)); // All legacy and multisig paths\n```\n\n### Network-Based Path Filtering\n\nGet all paths for a specific network:\n\n```typescript\nimport {\n  PATHS_BY_NETWORK_MAINNET,\n  PATHS_BY_NETWORK_TESTNET,\n  PATHS_BY_NETWORK_REGTEST,\n  getPathsForNetwork,\n  getCommonPathsForNetwork,\n  getLegacyPathsForNetwork,\n  getMultisigPathsForNetwork,\n  getAllPathsByNetwork,\n} from '@asylia/atlas';\n\n// Get all mainnet paths using the map\nconst mainnetPaths = PATHS_BY_NETWORK_MAINNET;\nconsole.log(mainnetPaths.BIP84_FIRST_RECEIVE_MAINNET.path); // \"m/84'/0'/0'/0/0\"\n\n// Or use the function to get paths as an array\nconst allMainnetPaths = getPathsForNetwork('MAINNET');\nconsole.log(allMainnetPaths.length); // All mainnet paths\n\nconst testnetPaths = getPathsForNetwork('testnet');\nconsole.log(testnetPaths.length); // All testnet paths\n\n// Get only common/standard paths (BIP44, 49, 84, 86)\nconst commonMainnet = getCommonPathsForNetwork('MAINNET');\nconsole.log(commonMainnet.length); // 15 paths (3 for each BIP + second account)\n\n// Get only legacy paths\nconst legacyPaths = getLegacyPathsForNetwork('MAINNET');\nconsole.log(legacyPaths.length); // Electrum and BIP32 paths\n\n// Get only multisig paths\nconst multisigMainnet = getMultisigPathsForNetwork('MAINNET');\n// Returns BIP45 and BIP48 mainnet paths\n\nconst multisigTestnet = getMultisigPathsForNetwork('TESTNET');\n// Returns BIP45 and BIP48 testnet paths\n\n// Get all paths grouped by network\nconst groupedPaths = getAllPathsByNetwork();\nconsole.log(groupedPaths.mainnet.length); // All mainnet paths\nconsole.log(groupedPaths.testnet.length); // All testnet paths\nconsole.log(groupedPaths.regtest.length); // All regtest paths\n\n// Filter and display specific paths\nconst mainnetCommon = getCommonPathsForNetwork('MAINNET');\nmainnetCommon.forEach((path) => {\n  console.log(`${path.components.purpose}: ${path.path}`);\n  // 44: m/44'/0'/0'/0/0\n  // 44: m/44'/0'/0'/1/0\n  // 49: m/49'/0'/0'/0/0\n  // ...\n});\n```\n\n### Derivation Path Variants\n\nCombine BIP standards, script types, and networks:\n\n```typescript\nimport {\n  // Constants\n  DERIVATION_VARIANTS,\n\n  // Types\n  type DerivationVariant,\n  type DerivationPathIDMainnetValue,\n  type DerivationPathIDTestnetValue,\n  type DerivationPathIDRegtestValue,\n\n  // Network-specific maps\n  DerivationPathIDMainnet,\n  DerivationPathIDTestnet,\n  DerivationPathIDRegtest,\n} from '@asylia/atlas';\n\n// Get all variants (without network)\nconst variants = DERIVATION_VARIANTS;\n// [\n//   'ELECTRUM_LEGACY_P2PKH',\n//   'BIP_44_P2PKH',\n//   'BIP_49_P2SH-P2WPKH',\n//   'BIP_84_P2WPKH',\n//   'BIP_86_P2TR',\n//   'BIP_45_P2SH-MULTISIG',\n//   'BIP_48_P2WSH-P2SH',\n//   'BIP_48_P2WSH'\n// ]\n\n// Access mainnet derivation path IDs\nconst mainnetLegacy = DerivationPathIDMainnet.BIP_44_P2PKH_MAINNET;\nconst mainnetNestedSegwit = DerivationPathIDMainnet.BIP_49_P2SH_P2WPKH_MAINNET;\nconst mainnetSegwit = DerivationPathIDMainnet.BIP_84_P2WPKH_MAINNET;\nconst mainnetTaproot = DerivationPathIDMainnet.BIP_86_P2TR_MAINNET;\n\n// Access testnet derivation path IDs\nconst testnetLegacy = DerivationPathIDTestnet.BIP_44_P2PKH_TESTNET;\nconst testnetSegwit = DerivationPathIDTestnet.BIP_84_P2WPKH_TESTNET;\nconst testnetTaproot = DerivationPathIDTestnet.BIP_86_P2TR_TESTNET;\n\n// Access regtest derivation path IDs\nconst regtestLegacy = DerivationPathIDRegtest.BIP_44_P2PKH_REGTEST;\nconst regtestSegwit = DerivationPathIDRegtest.BIP_84_P2WPKH_REGTEST;\n```\n\n## 📚 API Reference\n\n### Extended Public Key Module\n\n| Export                             | Type     | Description                                               |\n| ---------------------------------- | -------- | --------------------------------------------------------- |\n| `ExtendedPubKeyPrefix`             | Enum     | All extended public key prefixes (xpub, ypub, zpub, etc.) |\n| `ExtendedPubKeyPrefixValue`        | Type     | Union type of all prefix values                           |\n| `ExtendedPubKeyDisplayLabel`       | Type     | Union type of display labels                              |\n| `ExtendedPubKeyNetworkClass`       | Type     | Union type of network classifications                     |\n| `ExtendedPubKeyScriptType`         | Type     | Union type of script types for prefixes                   |\n| `Bip32VersionBytes`                | Type     | Interface for BIP32 version bytes (public/private)        |\n| `ExtendedPubKeyDisplayMap`         | Map      | Prefix → Display label (e.g., \"xpub\" → \"Xpub\")            |\n| `ExtendedPubKeyNetworkMap`         | Map      | Prefix → Network type (e.g., \"xpub\" → \"MAINNET\")          |\n| `ExtendedPubKeyScriptTypeMap`      | Map      | Prefix → Script type (e.g., \"zpub\" → \"p2wpkh\")            |\n| `ExtendedPubKeyBip32VersionMap`    | Map      | Prefix → BIP32 version bytes for serialization            |\n| `isMainnetPrefix()`                | Function | Check if prefix is mainnet                                |\n| `isTestnetPrefix()`                | Function | Check if prefix is testnet                                |\n| `getPrefixFromExtendedPublicKey()` | Function | Extract and identify prefix from extended public key      |\n| `guessScriptTypeFromPrefix()`      | Function | Get script type from prefix                               |\n| `getBip32VersionBytes()`           | Function | Get BIP32 version bytes for a prefix                      |\n\n**Total Exports: 15** (1 enum, 5 types, 4 maps, 5 functions)\n\n### Network Module\n\n| Export                | Type     | Description                                     |\n| --------------------- | -------- | ----------------------------------------------- |\n| `NetworkType`         | Enum     | All network types (MAINNET, TESTNET, REGTEST)   |\n| `NetworkTypeValue`    | Type     | Union type of lowercase network values          |\n| `NetworkTypeKey`      | Type     | Union type of uppercase network keys            |\n| `NetworkMap`          | Map      | Network key → Network value (MAINNET → mainnet) |\n| `NetworkReverseMap`   | Map      | Network value → Network key (mainnet → MAINNET) |\n| `networkKeyToValue()` | Function | Convert MAINNET → mainnet                       |\n| `networkValueToKey()` | Function | Convert mainnet → MAINNET                       |\n| `isMainnet()`         | Function | Check if network is mainnet                     |\n| `isTestnetFamily()`   | Function | Check if network is testnet/regtest             |\n\n**Total Exports: 9** (1 enum, 2 types, 2 maps, 4 functions)\n\n### Script Type Module\n\n| Export                   | Type     | Description                                  |\n| ------------------------ | -------- | -------------------------------------------- |\n| `ScriptType`             | Enum     | All script types (P2PKH, P2WPKH, P2TR, etc.) |\n| `ScriptTypeValue`        | Type     | Union type of lowercase script values        |\n| `ScriptTypeUppercaseKey` | Type     | Union type of uppercase script keys          |\n| `ScriptTypeMap`          | Map      | Script key → Script value (P2WPKH → p2wpkh)  |\n| `ScriptTypeReverseMap`   | Map      | Script value → Script key (p2wpkh → P2WPKH)  |\n| `scriptTypeToValue()`    | Function | Convert P2WPKH → p2wpkh                      |\n| `scriptTypeFromValue()`  | Function | Convert p2wpkh → P2WPKH                      |\n\n**Total Exports: 7** (1 enum, 2 types, 2 maps, 2 functions)\n\n### Purpose Module\n\n| Export                       | Type     | Description                                                 |\n| ---------------------------- | -------- | ----------------------------------------------------------- |\n| `DERIVATION_PURPOSE_PREFIX`  | Constant | 'BIP' prefix string                                         |\n| `DERIVATION_PURPOSE_LIST`    | Constant | Array of supported BIP numbers [32, 44, 45, 48, 49, 84, 86] |\n| `ELECTRUM_LEGACY_PURPOSE`    | Constant | Special purpose value (0) for Electrum Legacy wallets       |\n| `DerivationPurposeNumber`    | Type     | Union type of valid BIP numbers                             |\n| `DerivationPurposeLabel`     | Type     | Union type of BIP labels                                    |\n| `DerivationPurposeString`    | Map      | BIP labels (BIP_32, BIP_44, BIP_49, etc.)                   |\n| `DerivationPurposeNumberMap` | Map      | Label → Number (BIP_44 → 44)                                |\n\n**Total Exports: 7** (3 constants, 2 types, 2 maps)\n\n### Variant Module\n\n| Export                         | Type     | Description                          |\n| ------------------------------ | -------- | ------------------------------------ |\n| `DERIVATION_VARIANTS`          | Constant | Array of all BIP+Script combinations |\n| `DerivationVariant`            | Type     | Union type of derivation variants    |\n| `DerivationPathIDMainnetValue` | Type     | Union type of mainnet derivation IDs |\n| `DerivationPathIDTestnetValue` | Type     | Union type of testnet derivation IDs |\n| `DerivationPathIDRegtestValue` | Type     | Union type of regtest derivation IDs |\n| `DerivationPathIDMainnet`      | Map      | Mainnet derivation path IDs          |\n| `DerivationPathIDTestnet`      | Map      | Testnet derivation path IDs          |\n| `DerivationPathIDRegtest`      | Map      | Regtest derivation path IDs          |\n\n**Total Exports: 8** (1 constant, 4 types, 3 maps)\n\n### DerivationPath Module\n\n| Export                         | Type     | Description                                                      |\n| ------------------------------ | -------- | ---------------------------------------------------------------- |\n| `AccountIndex`                 | Enum     | Account indices (0-19) following BIP44 account discovery         |\n| `ChangeIndex`                  | Enum     | Change indices (RECEIVE=0, CHANGE=1)                             |\n| `AddressIndex`                 | Enum     | Address indices (0-19) following gap limit                       |\n| `COIN_TYPE_MAINNET`            | Constant | Bitcoin mainnet coin type (0)                                    |\n| `COIN_TYPE_TESTNET`            | Constant | Bitcoin testnet coin type (1)                                    |\n| `CoinType`                     | Type     | Union type of coin types (0 \\| 1)                                |\n| `DerivationPathObject`         | Type     | Object representation of a derivation path                       |\n| `DerivationPathString`         | Type     | String representation of a derivation path                       |\n| `StandardDerivationPath`       | Type     | Complete path with both string and object representations        |\n| `StandardPathsBip44`           | Type     | Type of the BIP44 standard paths map                             |\n| `StandardPathsBip49`           | Type     | Type of the BIP49 standard paths map                             |\n| `StandardPathsBip84`           | Type     | Type of the BIP84 standard paths map                             |\n| `StandardPathsBip86`           | Type     | Type of the BIP86 standard paths map                             |\n| `LegacyPathsType`              | Type     | Type of the legacy paths map                                     |\n| `MultisigPathsType`            | Type     | Type of the multisig paths map                                   |\n| `HistoricalPathsType`          | Type     | Type of the historical paths map                                 |\n| `PathsByNetworkMainnet`        | Type     | Type of mainnet paths collection                                 |\n| `PathsByNetworkTestnet`        | Type     | Type of testnet paths collection                                 |\n| `PathsByNetworkRegtest`        | Type     | Type of regtest paths collection                                 |\n| `STANDARD_PATHS_BIP44`         | Map      | Pre-defined standard paths for BIP44 (Legacy)                    |\n| `STANDARD_PATHS_BIP49`         | Map      | Pre-defined standard paths for BIP49 (Nested SegWit)             |\n| `STANDARD_PATHS_BIP84`         | Map      | Pre-defined standard paths for BIP84 (Native SegWit)             |\n| `STANDARD_PATHS_BIP86`         | Map      | Pre-defined standard paths for BIP86 (Taproot)                   |\n| `LEGACY_PATHS`                 | Map      | Legacy paths (Electrum, BIP32 basic)                             |\n| `MULTISIG_PATHS`               | Map      | Multi-signature paths (BIP45, BIP48)                             |\n| `HISTORICAL_PATHS`             | Map      | All legacy and multisig paths combined                           |\n| `PATHS_BY_NETWORK_MAINNET`     | Map      | All derivation paths for mainnet                                 |\n| `PATHS_BY_NETWORK_TESTNET`     | Map      | All derivation paths for testnet                                 |\n| `PATHS_BY_NETWORK_REGTEST`     | Map      | All derivation paths for regtest                                 |\n| `buildDerivationPath()`        | Function | Build a derivation path from individual components               |\n| `parseDerivationPath()`        | Function | Parse a derivation path string into components                   |\n| `getStandardPath()`            | Function | Get a standard derivation path for a BIP and network             |\n| `getCoinTypeForNetwork()`      | Function | Get the appropriate coin type for a network                      |\n| `getPathsForNetwork()`         | Function | Get all derivation paths for a specific network                  |\n| `getCommonPathsForNetwork()`   | Function | Get only common/standard paths for a network (BIP44, 49, 84, 86) |\n| `getLegacyPathsForNetwork()`   | Function | Get only legacy/historical paths for a network                   |\n| `getMultisigPathsForNetwork()` | Function | Get only multi-signature paths for a network                     |\n| `getAllPathsByNetwork()`       | Function | Get all paths grouped by network (mainnet, testnet, regtest)     |\n\n**Total Exports: 38** (3 enums, 2 constants, 16 types, 9 maps, 9 functions)\n\n## 🌍 Supported Standards\n\n### Extended Public Key Prefixes\n\n**Mainnet:**\n\n- `xpub` - Legacy (BIP44, P2PKH)\n- `ypub` - Nested SegWit (BIP49, P2SH-P2WPKH)\n- `zpub` - Native SegWit (BIP84, P2WPKH)\n- `trpub` - Taproot (BIP86, P2TR)\n\n**Testnet:**\n\n- `tpub` - Legacy (BIP44, P2PKH)\n- `upub` - Nested SegWit (BIP49, P2SH-P2WPKH)\n- `vpub` - Native SegWit (BIP84, P2WPKH)\n- `trpubt` - Taproot (BIP86, P2TR)\n\n### BIP Standards\n\n- **BIP32** - Hierarchical Deterministic Wallets (basic derivation)\n- **BIP44** - Legacy addresses (P2PKH)\n- **BIP45** - Multi-signature addresses (P2SH)\n- **BIP48** - Multi-signature with different script types (P2WSH-P2SH, P2WSH)\n- **BIP49** - Nested SegWit addresses (P2SH-P2WPKH)\n- **BIP84** - Native SegWit addresses (P2WPKH)\n- **BIP86** - Taproot addresses (P2TR)\n- **Electrum Legacy** - Historical Electrum wallet format (`m/0'/change/index`)\n\n### Script Types\n\n- **P2PKH** - Pay to Public Key Hash (Legacy)\n- **P2SH-P2WPKH** - Nested SegWit\n- **P2WPKH** - Native SegWit\n- **P2TR** - Taproot\n- **P2SH-MULTISIG** - Multi-signature (Legacy)\n- **P2WSH-P2SH** - Wrapped Witness Script Hash\n- **P2WSH** - Native Witness Script Hash\n\n### Derivation Paths\n\n**Standard Paths by BIP:**\n\n- **BIP32** (Basic): `m/account'/change/addressIndex`\n  - Example: `m/0'/0/0` (First receiving address)\n- **BIP44** (Legacy): `m/44'/coinType'/account'/change/addressIndex`\n  - Example: `m/44'/0'/0'/0/0` (First mainnet receiving address)\n- **BIP45** (Multisig): `m/45'/cosigner/change/addressIndex`\n  - Example: `m/45'/0/0/0` (Cosigner 0, first receiving address)\n- **BIP48** (Multisig Scripts): `m/48'/coinType'/account'/scriptType'/change/addressIndex`\n  - Example: `m/48'/0'/0'/2'/0/0` (P2WSH first receiving address)\n  - scriptType: 1 = P2WSH-P2SH, 2 = P2WSH\n- **BIP49** (Nested SegWit): `m/49'/coinType'/account'/change/addressIndex`\n  - Example: `m/49'/0'/0'/0/0` (First mainnet receiving address)\n- **BIP84** (Native SegWit): `m/84'/coinType'/account'/change/addressIndex`\n  - Example: `m/84'/0'/0'/0/0` (First mainnet receiving address)\n- **BIP86** (Taproot): `m/86'/coinType'/account'/change/addressIndex`\n  - Example: `m/86'/0'/0'/0/0` (First mainnet receiving address)\n\n- **Electrum Legacy**: `m/0'/change/addressIndex`\n  - Example: `m/0'/0/0` (First receiving address)\n  - Example: `m/0'/1/0` (First change address)\n\n**Path Components:**\n\n- **purpose**: BIP number (32, 44, 45, 48, 49, 84, 86) - determines address type\n- **coinType**: 0 for mainnet, 1 for testnet/regtest\n- **account**: Account index (hardened) - segregates different purposes\n- **change**: 0 for receive addresses, 1 for change addresses\n- **addressIndex**: Sequential address index (non-hardened)\n- **scriptType** (BIP48 only): 1 for P2WSH-P2SH, 2 for P2WSH\n- **cosigner** (BIP45 only): Cosigner index for multi-signature setups\n\n## 🛠️ Development\n\n```bash\n# Install dependencies\npnpm install\n\n# Build the package\npnpm run build\n\n# Run type checking\npnpm run typecheck\n\n# Watch mode for development\npnpm run dev\n```\n\n## 📄 License\n\nMIT © Asylia.io - Made by Asylian21 (David Zita)\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📞 Support\n\n- 🐛 [Report Issues](https://github.com/Asylian21/Asylia.io/issues)\n- 💬 [Discussions](https://github.com/Asylian21/Asylia.io/discussions)\n\n---\n\nMade with ❤️ by [Asylian21](https://github.com/Asylian21) (David Zita)\n","readmeFilename":"README.md"}