{"version":3,"file":"index.mjs","names":[],"sources":["../source/mainnet.ts","../source/testnet.ts","../source/chipnet.ts","../source/scalenet.ts","../source/legacynet.ts"],"sourcesContent":["import type { Blockchain } from './interfaces';\n\n/**\n * Bitcoin Cash mainnet (no flag, P2P 8333, magic 0xe3e1f3e8)\n *\n * The production BCH network. Shares Bitcoin's genesis and history through block 478558,\n * then diverges at the August 1, 2017 UAHF. Upgrades activate on May 15 each year.\n * Default and only network that carries real value.\n */\nexport const mainnet: Blockchain =\n{\n\t// This is the shared genesis block with BTC.\n\tgenesis:\n\t{\n\t\theight: 0,\n\t\tmerkleRoot: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f',\n\t\tblockHash: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f',\n\t\tchainWork: undefined,\n\t},\n\t// This is the first block after the fork from BTC.\n\tindependence:\n\t{\n\t\theight: 478559,\n\t\tmerkleRoot: 'b397084eabffae26ef69b88fd2e35e61bcb2afbc14a3ab40ca5ad84c86fb6a21',\n\t\tblockHash: '000000000000000000651ef99cb9fcbe0dadde1d424bd9f15ff20136191a5eec',\n\t\tchainWork: undefined,\n\t},\n\t// This is a recent checkpoint on the BCH mainnet network.\n\tcheckpoint:\n\t{\n\t\theight: 960000,\n\t\tmerkleRoot: '4e15e6f1a8ca917441e34ee4613537b50e67cdae95eaa40a55aa26e7a3c01e12',\n\t\tblockHash: '000000000000000002559a63f4975fb3c2203ca1e4f24725bb71d6cb3fcd29ae',\n\t\tchainWork: undefined,\n\t},\n\n\t// Consensus parameters for the Bitcoin Cash mainnet.\n\t// NOTE: Parameters are taken from BCHN sources.\n\tdifficultyParameters:\n\t{\n\t\t// Easiest legal expanded target on BCH (powLimit 0x1d00ffff).\n\t\tminimumDifficultyTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Mainnet does not use the 20-minute minimum-difficulty exception.\n\t\tallowMinimumDifficultyBlocks: false,\n\n\t\t// Current difficulty adjustment algorithm on the network.\n\t\tdifficultyAlgorithm: 'aserti3-2d',\n\n\t\t// First header whose compressed target is produced by ASERT (anchor height + 1).\n\t\tasertActivationHeight: 661648,\n\n\t\t// Last pre-ASERT block;\n\t\tasertAnchoredBlockHeight: 661647,\n\n\t\t// Expanded target of block 661647;\n\t\tasertAnchoredTarget: 119054999042180427261419964385105293965474731717176590336n,\n\n\t\t// Timestamp of block 661646;\n\t\tasertAnchoredParentTimestamp: 1605447844,\n\n\t\t// Two days. (2 * 24 * 60 * 60)\n\t\tasertHalfLifeInSeconds: 172800,\n\n\t\t// Ten-minute target spacing.\n\t\tasertIdealBlockTimeInSeconds: 600,\n\t},\n};\n\n// Export alias for mainnet checkpoint for backwards compatibility.\nexport const electrumCheckpoint = mainnet.checkpoint;\n","import type { Blockchain } from './interfaces';\n\n/**\n * Bitcoin Cash testnet3 (-testnet, P2P 18333, magic 0xf4e5f3f4)\n *\n * Historical BCH fork of Bitcoin's BTC testnet3 from 2017.\n * Same genesis as BTC testnet3. Still maintained and upgraded on the May 15 mainnet schedule.\n * It is large (tens of GB) because of old 32 MB scaling tests, so it is a poor default for new work.\n * After ABLA it stays capped at 32 MB.\n */\nexport const testnet3: Blockchain =\n{\n\t// This is the shared genesis block with the BTC testnet3.\n\tgenesis:\n\t{\n\t\theight: 0,\n\t\tmerkleRoot: '000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943',\n\t\tblockHash: '000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943',\n\t\tchainWork: undefined,\n\t},\n\t// This is the first block after testnet3 was forked off from the BTC testnet3.\n\tindependence:\n\t{\n\t\theight: 1155876,\n\t\tmerkleRoot: 'b8075f1a8822f6c20e42ad0d2d92ea792b4ff225faff8bfc18c3e41a7ea57db9',\n\t\tblockHash: '00000000000e38fef93ed9582a7df43815d5c2ba9fd37ef70c9a0ea4a285b8f5',\n\t\tchainWork: undefined,\n\t},\n\t// This is a recent checkpoint on the BCH testnet3 network.\n\tcheckpoint:\n\t{\n\t\theight: 1707442,\n\t\tmerkleRoot: 'efbe18fd81badc08121e0779a424a77effbc68c37fb859f8b554f65b873aa704',\n\t\tblockHash: '00000000f9541bc154e2402a01296fff37f3352829c33595cc631418abcc8100',\n\t\tchainWork: undefined,\n\t},\n\n\t// Consensus parameters for the Bitcoin Cash testnet3.\n\t// NOTE: Parameters are taken from BCHN / bchd TestNet3Params.\n\tdifficultyParameters:\n\t{\n\t\t// Easiest legal expanded target on BCH (powLimit 0x1d00ffff).\n\t\tminimumDifficultyTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Testnet3 uses the 20-minute minimum-difficulty exception.\n\t\tallowMinimumDifficultyBlocks: true,\n\n\t\t// Current difficulty adjustment algorithm on the network.\n\t\tdifficultyAlgorithm: 'aserti3-2d',\n\n\t\t// First header whose compressed target is produced by ASERT (anchor height + 1).\n\t\tasertActivationHeight: 1421482,\n\n\t\t// Last pre-ASERT block.\n\t\tasertAnchoredBlockHeight: 1421481,\n\n\t\t// Expanded target of block 1421481.\n\t\tasertAnchoredTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Timestamp of block 1421480.\n\t\tasertAnchoredParentTimestamp: 1605445400,\n\n\t\t// One hour. (60 * 60)\n\t\tasertHalfLifeInSeconds: 3600,\n\n\t\t// Ten-minute target spacing.\n\t\tasertIdealBlockTimeInSeconds: 600,\n\t},\n};\n\n/**\n * Bitcoin Cash testnet4 (-testnet4, P2P 28333, magic 0xe2b7daaf)\n *\n * Created in 2020 as the lightweight replacement for testnet3. Fresh BCH-specific genesis (not BTC's later BIP94 testnet4).\n * Default 2 MB blocks, 1-hour ASERT half-life, min-diff allowed so it can return to CPU mining after an ASIC burst.\n * Intended to stay small and sync quickly. Upgrades on the May 15 schedule with mainnet.\n */\nexport const testnet4: Blockchain =\n{\n\t// This is the genesis block for the BCH testnet4 network.\n\tgenesis:\n\t{\n\t\theight: 0,\n\t\tmerkleRoot: '000000001dd410c49a788668ce26751718cc797474d3152a5fc073dd44fd9f7b',\n\t\tblockHash: '000000001dd410c49a788668ce26751718cc797474d3152a5fc073dd44fd9f7b',\n\t\tchainWork: undefined,\n\t},\n\t// This is a recent checkpoint on the BCH testnet4 network.\n\tcheckpoint:\n\t{\n\t\theight: 302729,\n\t\tmerkleRoot: '036cf826e9f5c6ed6aed07ec3046a15034f4238ec3cd210f8a44a13af3878012',\n\t\tblockHash: '00000000440e0d0f80f3a8371a8c9827a48937b68417167f7ef6dadf69ad0410',\n\t\tchainWork: undefined,\n\t},\n\n\t// Consensus parameters for the Bitcoin Cash testnet4.\n\t// NOTE: Parameters are taken from BCHN CTestNet4Params.\n\tdifficultyParameters:\n\t{\n\t\t// Easiest legal expanded target on BCH (powLimit 0x1d00ffff).\n\t\tminimumDifficultyTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Testnet4 uses the 20-minute minimum-difficulty exception.\n\t\tallowMinimumDifficultyBlocks: true,\n\n\t\t// Current difficulty adjustment algorithm on the network.\n\t\tdifficultyAlgorithm: 'aserti3-2d',\n\n\t\t// First header whose compressed target is produced by ASERT (anchor height + 1).\n\t\tasertActivationHeight: 16845,\n\n\t\t// Last pre-ASERT block.\n\t\tasertAnchoredBlockHeight: 16844,\n\n\t\t// Expanded target of block 16844.\n\t\tasertAnchoredTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Timestamp of block 16843.\n\t\tasertAnchoredParentTimestamp: 1605451779,\n\n\t\t// One hour. (60 * 60)\n\t\tasertHalfLifeInSeconds: 3600,\n\n\t\t// Ten-minute target spacing.\n\t\tasertIdealBlockTimeInSeconds: 600,\n\t},\n};\n","import type { Blockchain } from './interfaces';\n\n/**\n * Bitcoin Cash chipnet (-chipnet, P2P 48333, magic 0xe2b7daaf)\n *\n * Permanent fork of testnet4, same genesis, same P2P magic, and same cashaddr prefix (bchtest:).\n * Stages the next CHIP upgrade on November 15, six months before mainnet.\n * After ABLA it has a dynamic blocksize with a 2 MB floor.\n */\nexport const chipnet: Blockchain =\n{\n\t// This is the shared genesis block with the BCH testnet4.\n\tgenesis:\n\t{\n\t\theight: 0,\n\t\tmerkleRoot: '000000001dd410c49a788668ce26751718cc797474d3152a5fc073dd44fd9f7b',\n\t\tblockHash: '000000001dd410c49a788668ce26751718cc797474d3152a5fc073dd44fd9f7b',\n\t\tchainWork: undefined,\n\t},\n\t// This is the first block after chipnet was forked off from the BCH testnet4.\n\tindependence:\n\t{\n\t\theight: 121957,\n\t\tmerkleRoot: '56a6120921540d9be43150ebe81aa61104d2afaa2eeea7a81eb5beab64a41b50',\n\t\tblockHash: '0000000056087dee73fb66178ca70da89dfd0be098b1a63cf6fe93934cd04c78',\n\t\tchainWork: undefined,\n\t},\n\t// This is a recent checkpoint on the BCH chipnet network.\n\tcheckpoint:\n\t{\n\t\theight: 302144,\n\t\tmerkleRoot: '59a2a6a10b2fa406a8b22a16b934307159319454098fdddeae7148c801326c6c',\n\t\tblockHash: '0000000038161e1d24f9cad45fc46bc4e5512453b8523bb5f393b46ea7f752cd',\n\t\tchainWork: undefined,\n\t},\n\n\t// Consensus parameters for the Bitcoin Cash chipnet.\n\t// NOTE: Parameters are taken from bchd ChipNetParams (same ASERT anchor as testnet4).\n\tdifficultyParameters:\n\t{\n\t\t// Easiest legal expanded target on BCH (powLimit 0x1d00ffff).\n\t\tminimumDifficultyTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Chipnet uses the 20-minute minimum-difficulty exception.\n\t\tallowMinimumDifficultyBlocks: true,\n\n\t\t// Current difficulty adjustment algorithm on the network.\n\t\tdifficultyAlgorithm: 'aserti3-2d',\n\n\t\t// First header whose compressed target is produced by ASERT (anchor height + 1).\n\t\tasertActivationHeight: 16845,\n\n\t\t// Last pre-ASERT block. Shared with testnet4; not re-targeted at independence.\n\t\tasertAnchoredBlockHeight: 16844,\n\n\t\t// Expanded target of block 16844.\n\t\tasertAnchoredTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Timestamp of block 16843.\n\t\tasertAnchoredParentTimestamp: 1605451779,\n\n\t\t// One hour. (60 * 60)\n\t\tasertHalfLifeInSeconds: 3600,\n\n\t\t// Ten-minute target spacing.\n\t\tasertIdealBlockTimeInSeconds: 600,\n\t},\n};\n","import type { Blockchain } from './interfaces';\n\n/**\n * Bitcoin Cash scalenet (-scalenet, P2P 38333, magic 0xc3afe1a2)\n *\n * High-throughput testnet with its own genesis, created alongside testnet4.\n * Default 256 MB blocks and a 2-day ASERT half-life so ASIC scaling tests are viable.\n * Operators reorg the chain back to height 10,000 about twice a year so the history stays downloadable.\n */\nexport const scalenet: Blockchain =\n{\n\t// This is the genesis block for the BCH scalenet network.\n\tgenesis:\n\t{\n\t\theight: 0,\n\t\tmerkleRoot: '00000000e6453dc2dfe1ffa19023f86002eb11dbb8e87d0291a4599f0430be52',\n\t\tblockHash: '00000000e6453dc2dfe1ffa19023f86002eb11dbb8e87d0291a4599f0430be52',\n\t\tchainWork: undefined,\n\t},\n\t// This is the reset-floor checkpoint on the BCH scalenet network.\n\tcheckpoint:\n\t{\n\t\theight: 10000,\n\t\tmerkleRoot: '855e457ccde2083f6b0cd5f99767d53f533aff47de36e3ffc30bcb93239be9bd',\n\t\tblockHash: '00000000b711dc753130e5083888d106f99b920b1b8a492eb5ac41d40e482905',\n\t\tchainWork: undefined,\n\t},\n\n\t// Consensus parameters for the Bitcoin Cash scalenet.\n\t// NOTE: Half-life and min-diff are from BCHN CScaleNetParams.\n\t// The ASERT anchor is not hardcoded there; use the reset-floor header after each reorg.\n\tdifficultyParameters:\n\t{\n\t\t// Easiest legal expanded target on BCH (powLimit 0x1d00ffff).\n\t\tminimumDifficultyTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Scalenet uses the 20-minute minimum-difficulty exception.\n\t\tallowMinimumDifficultyBlocks: true,\n\n\t\t// Current difficulty adjustment algorithm on the network.\n\t\tdifficultyAlgorithm: 'aserti3-2d',\n\n\t\t// First header after the reset-floor checkpoint.\n\t\tasertActivationHeight: 10001,\n\n\t\t// Reset floor; BCHN expects ASERT to run from here after each reorg.\n\t\tasertAnchoredBlockHeight: 10000,\n\n\t\t// Expanded target of block 10000. Fetch from that header; not hardcoded in BCHN.\n\t\tasertAnchoredTarget: 0n,\n\n\t\t// Timestamp of block 9999. Fetch from the parent header; not hardcoded in BCHN.\n\t\tasertAnchoredParentTimestamp: 0,\n\n\t\t// Two days. (2 * 24 * 60 * 60)\n\t\tasertHalfLifeInSeconds: 172800,\n\n\t\t// Ten-minute target spacing.\n\t\tasertIdealBlockTimeInSeconds: 600,\n\t},\n};\n","import type { Blockchain } from './interfaces';\n\n/**\n * Bitcoin legacynet (no flag, P2P 8333, magic 0xf9beb4d9)\n *\n * The original Bitcoin network that BCH split from in 2017.\n * Same genesis as BCH mainnet. This snapshot is frozen at the last common block\n * and is not expected to be updated after the UAHF.\n */\nexport const legacynet: Blockchain =\n{\n\t// This is the shared genesis block with BCH mainnet.\n\tgenesis:\n\t{\n\t\theight: 0,\n\t\tmerkleRoot: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f',\n\t\tblockHash: '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f',\n\t\tchainWork: undefined,\n\t},\n\t// This is the last shared block before BCH independence; no further updates are expected.\n\tcheckpoint:\n\t{\n\t\theight: 478558,\n\t\tmerkleRoot: 'e98d0b87d8768e8c06a8a194d6b0440cfb15979722c3cf6f74c6d9056ae427db',\n\t\tblockHash: '0000000000000000011865af4122fe3b144e2cbeea86142e8ff2fb4107352d43',\n\t\tchainWork: undefined,\n\t},\n\n\t// Consensus parameters for the Bitcoin legacynet.\n\tdifficultyParameters:\n\t{\n\t\t// Easiest legal expanded target on BTC (powLimit 0x1d00ffff).\n\t\tminimumDifficultyTarget: 26959535291011309493156476344723991336010898738574164086137773096960n,\n\n\t\t// Bitcoin mainnet does not use the 20-minute minimum-difficulty exception.\n\t\tallowMinimumDifficultyBlocks: false,\n\n\t\t// Current difficulty adjustment algorithm on the network.\n\t\tdifficultyAlgorithm: 'legacy',\n\t},\n};\n"],"mappings":";;;;;;;;AASA,MAAa,UACb;CAEC,SACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,cACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,YACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAIA,sBACA;EAEC,yBAAyB;EAGzB,8BAA8B;EAG9B,qBAAqB;EAGrB,uBAAuB;EAGvB,0BAA0B;EAG1B,qBAAqB;EAGrB,8BAA8B;EAG9B,wBAAwB;EAGxB,8BAA8B;CAC/B;AACD;AAGA,MAAa,qBAAqB,QAAQ;;;;;;;;;;;AC5D1C,MAAa,WACb;CAEC,SACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,cACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,YACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAIA,sBACA;EAEC,yBAAyB;EAGzB,8BAA8B;EAG9B,qBAAqB;EAGrB,uBAAuB;EAGvB,0BAA0B;EAG1B,qBAAqB;EAGrB,8BAA8B;EAG9B,wBAAwB;EAGxB,8BAA8B;CAC/B;AACD;;;;;;;;AASA,MAAa,WACb;CAEC,SACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,YACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAIA,sBACA;EAEC,yBAAyB;EAGzB,8BAA8B;EAG9B,qBAAqB;EAGrB,uBAAuB;EAGvB,0BAA0B;EAG1B,qBAAqB;EAGrB,8BAA8B;EAG9B,wBAAwB;EAGxB,8BAA8B;CAC/B;AACD;;;;;;;;;;ACtHA,MAAa,UACb;CAEC,SACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,cACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,YACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAIA,sBACA;EAEC,yBAAyB;EAGzB,8BAA8B;EAG9B,qBAAqB;EAGrB,uBAAuB;EAGvB,0BAA0B;EAG1B,qBAAqB;EAGrB,8BAA8B;EAG9B,wBAAwB;EAGxB,8BAA8B;CAC/B;AACD;;;;;;;;;;AC1DA,MAAa,WACb;CAEC,SACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,YACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAKA,sBACA;EAEC,yBAAyB;EAGzB,8BAA8B;EAG9B,qBAAqB;EAGrB,uBAAuB;EAGvB,0BAA0B;EAG1B,qBAAqB;EAGrB,8BAA8B;EAG9B,wBAAwB;EAGxB,8BAA8B;CAC/B;AACD;;;;;;;;;;ACnDA,MAAa,YACb;CAEC,SACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAEA,YACA;EACC,QAAQ;EACR,YAAY;EACZ,WAAW;EACX,WAAW,KAAA;CACZ;CAGA,sBACA;EAEC,yBAAyB;EAGzB,8BAA8B;EAG9B,qBAAqB;CACtB;AACD"}