{"name":"@ethereumjs/common","version":"10.0.0","keywords":["ethereum","ethereumjs","constants","parameters","genesis","networks","bootstrap"],"license":"MIT","_id":"@ethereumjs/common@10.0.0","maintainers":[{"name":"axic","email":"alex@rtfs.hu"},{"name":"holgerd77","email":"Holger.Drewes@gmail.com"},{"name":"acolytec3","email":"metroman374@gmail.com"},{"name":"g11tech","email":"gajinder@g11.in"}],"homepage":"https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common#readme","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+common%22"},"dist":{"shasum":"7beb1d2135c9eeaf03fd7dd9fed94fea18182a2c","tarball":"http://registry-npm.ywwl.com/@ethereumjs/common/download/@ethereumjs/common-10.0.0.tgz","fileCount":115,"integrity":"sha512-qb0M1DGdXzMAf3O6Zg5Wr5UDjoxBmplLPbQyC6DQ0LfgVDBRdqn0Pk+/hHm4q0McE22Of0MxbV4hhiDTkSgKag==","signatures":[{"sig":"MEYCIQDBWyMv3hIoLJxAt2PyMK/q/xU0h3YDgJAN4ghP5pQ5dAIhAPp8xCNoHd/wI3Bd/8YxjB8atIa6oFflx/RlwUu/Fq5K","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":595811,"size":103538,"noattachment":false,"key":"/@ethereumjs/common/-/@ethereumjs/common-10.0.0.tgz"},"main":"dist/cjs/index.js","type":"module","types":"./dist/cjs/index.d.ts","module":"dist/esm/index.js","exports":{".":{"import":{"default":"./dist/esm/index.js","typescript":"./src/index.ts"},"require":"./dist/cjs/index.js"}},"gitHead":"9e461f54312bf20c710b43ab73f7d3ad753f8765","scripts":{"sc":"npm run spellcheck","tsc":"../../config/cli/ts-compile.sh","lint":"npm run biome && eslint  --config ./eslint.config.mjs .","test":"npm run test:node && npm run test:browser","biome":"npx @biomejs/biome check","build":"../../config/cli/ts-build.sh","clean":"../../config/cli/clean-package.sh","coverage":"DEBUG=ethjs npx vitest run -c ../../config/vitest.config.coverage.mts","examples":"tsx ../../scripts/examples-runner.ts -- common","lint:fix":"npm run biome:fix && eslint  --fix --config ./eslint.config.mjs .","biome:fix":"npx @biomejs/biome check --write","test:node":"npx vitest run -c ../../config/vitest.config.mts","docs:build":"typedoc --options typedoc.mjs","spellcheck":"npm run spellcheck:ts && npm run spellcheck:md","test:browser":"npx vitest run --config=../../config/vitest.config.browser.mts","spellcheck:md":"npx cspell --gitignore -c ../../config/cspell-md.json \"**.md\" --cache --show-suggestions --show-context","spellcheck:ts":"npx cspell --gitignore -c ../../config/cspell-ts.json \"./**/*.ts\" --cache --show-suggestions --show-context","examples:build":"npx embedme README.md","prepublishOnly":"../../config/cli/prepublish.sh","coverage:istanbul":"DEBUG=ethjs npx vitest run -c ../../config/vitest.config.coverage.istanbul.mts"},"_npmUser":{"name":"holgerd77","email":"Holger.Drewes@gmail.com"},"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-monorepo.git","type":"git"},"_npmVersion":"11.2.0","description":"Resources common to all Ethereum implementations","directories":{},"sideEffects":false,"_nodeVersion":"23.10.0","dependencies":{"eventemitter3":"^5.0.1","@ethereumjs/util":"^10.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@polkadot/util":"^13.4.3","@polkadot/wasm-crypto":"^7.4.1"},"_npmOperationalInternal":{"tmp":"tmp/common_10.0.0_1745915914909_0.33855432108761785","host":"s3://npm-registry-packages-npm-production"},"readme":"# @ethereumjs/common `v10`\n\n[![NPM Package][common-npm-badge]][common-npm-link]\n[![GitHub Issues][common-issues-badge]][common-issues-link]\n[![Actions Status][common-actions-badge]][common-actions-link]\n[![Code Coverage][common-coverage-badge]][common-coverage-link]\n[![Discord][discord-badge]][discord-link]\n\n| Resources common to all EthereumJS implementations. |\n| --------------------------------------------------- |\n\n`Common` holds the **chain configuration**, **active hardfork**, **EIP set**, and **protocol parameters** shared across the EthereumJS libraries. Instantiate one `Common` per network context and pass it to `tx`, `block`, `evm`, `vm`, and related packages.\n\nRunnable examples live in [`examples/`](./examples/).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Chain Presets](#chain-presets)\n- [Hardfork Selection](#hardfork-selection)\n- [Parameter Access](#parameter-access)\n- [Blob Gas Schedule](#blob-gas-schedule)\n- [EIP Activation](#eip-activation)\n- [Events](#events)\n- [Custom and Private Chains](#custom-and-private-chains)\n- [Custom Cryptography (WASM / KZG)](#custom-cryptography-wasm--kzg)\n- [Browser](#browser)\n- [API](#api)\n- [EthereumJS](#ethereumjs)\n- [License](#license)\n\n## Installation\n\n```shell\nnpm install @ethereumjs/common\n```\n\n## Getting Started\n\n### import / require\n\nimport (ESM, TypeScript):\n\n```ts\nimport { Chain, Common, Hardfork, Mainnet } from '@ethereumjs/common'\n```\n\nrequire (CommonJS, Node.js):\n\n```ts\nconst { Common, Hardfork, Mainnet } = require('@ethereumjs/common')\n```\n\n### Instantiate `Common`\n\nPick a built-in chain preset (`Mainnet`, `Sepolia`, …) and optionally pin a hardfork. When omitted, the chain's `defaultHardfork` is used (`Hardfork.Prague` on Mainnet today).\n\n```ts\n// ./examples/instantiation.ts\n\nimport { Common, Hardfork, Mainnet } from '@ethereumjs/common'\n\nconst withHardfork = new Common({ chain: Mainnet, hardfork: Hardfork.Prague })\nconst withDefault = new Common({ chain: Mainnet })\n\nconsole.log(`Explicit hardfork: ${withHardfork.hardfork()}`)\nconsole.log(\n  `Default hardfork: ${withDefault.hardfork()} (DEFAULT_HARDFORK=${withDefault.DEFAULT_HARDFORK})`,\n)\n```\n\n## Chain Presets\n\nBuilt-in presets: `Mainnet`, `Sepolia`, `Holesky`, `Hoodi`. Each exposes `chainId()`, `genesis()`, `hardforks()`, `bootstrapNodes()`, `dnsNetworks()`, and consensus metadata.\n\n```ts\n// ./examples/testnetChains.ts\n\nimport { Common, Holesky, Hoodi, Mainnet, Sepolia } from '@ethereumjs/common'\n\nfor (const chain of [Mainnet, Sepolia, Holesky, Hoodi]) {\n  const common = new Common({ chain })\n  console.log(\n    `${common.chainName()}: chainId=${common.chainId()} hardfork=${common.hardfork()} bootstrapNodes=${common.bootstrapNodes().length}`,\n  )\n}\n```\n\nChain fields are defined in [`chains.ts`](./src/chains.ts) and the `ChainConfig` type in [`types.ts`](./src/types.ts).\n\n## Hardfork Selection\n\n### Pin at construction\n\nSet `hardfork` in the constructor when you know the fork up front (tests, single-fork tooling).\n\n### Resolve from block headers\n\nFor block replay, syncing, or VM runs, use `getHardforkBy()` / `setHardforkBy()`. Pre-merge forks use **block number**; post-merge forks need **timestamp** (and typically block number as well).\n\n```ts\n// ./examples/hardforkByBlock.ts\n\nimport { Common, Hardfork, Mainnet } from '@ethereumjs/common'\n\nconst common = new Common({ chain: Mainnet })\n\n// Pre-merge: block number alone determines the active hardfork\nconsole.log(`HF at block 12_965_000 (London): ${common.getHardforkBy({ blockNumber: 12_965_000n })}`)\ncommon.setHardforkBy({ blockNumber: 12_965_000n })\nconsole.log(`After setHardforkBy: ${common.hardfork()}`)\n\n// Post-merge: pass timestamp (and block number) for timestamp-based forks\ncommon.setHardforkBy({ blockNumber: 19_000_000n, timestamp: 1_710_338_135n })\nconsole.log(`HF at Cancun timestamp: ${common.hardfork()}`)\n\ncommon.setHardforkBy({ blockNumber: 19_000_000n, timestamp: 1_746_612_311n })\nconsole.log(`HF at Prague timestamp: ${common.hardfork()}`)\nconsole.log(`Prague active on block 19M: ${common.hardforkIsActiveOnBlock(Hardfork.Prague, 19_000_000n)}`)\n```\n\nThis mirrors what `@ethereumjs/vm` does when executing a block.\n\n### Supported hardforks\n\nPast and upcoming hardforks include `chainstart` through `osaka`, plus in-development `amsterdam`. `Hardfork.Prague` is the current Mainnet default; `Hardfork.Amsterdam` is experimental — see the [canonical Amsterdam overview](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/vm#amsterdam-hardfork-experimental) in `@ethereumjs/vm` for release ↔ spec tracking.\n\n## Parameter Access\n\nHardfork and EIP parameters (gas costs, limits, rewards, …) are read with `param()`, `paramByHardfork()`, and `paramByBlock()`. Parameter definitions live in [`hardforks.ts`](./src/hardforks.ts) and [`eips.ts`](./src/eips.ts).\n\n```ts\n// ./examples/paramAccess.ts\n\nimport { Common, Hardfork, Mainnet } from '@ethereumjs/common'\n\n// Hardfork-local params (defined on the BPO hardfork schedule)\nconst bpo = new Common({ chain: Mainnet, hardfork: Hardfork.Bpo1 })\nconsole.log(`BPO target blob count: ${bpo.param('target')}`)\n\n// Downstream packages ship default EIP param sets; inject manually on standalone Common\nconst common = new Common({ chain: Mainnet, hardfork: Hardfork.London })\ncommon.updateParams({ 1559: { initialBaseFee: 1_000_000_000 } })\nconsole.log(`London initialBaseFee: ${common.param('initialBaseFee')}`)\n\n// paramByBlock() picks the hardfork active at a block (then reads the param)\nconsole.log(`HF at block 12_965_000: ${common.getHardforkBy({ blockNumber: 12_965_000n })}`)\nconsole.log(\n  `initialBaseFee at block 12_965_000: ${common.paramByBlock('initialBaseFee', 12_965_000n)}`,\n)\n```\n\nDownstream packages may supply extra param dictionaries (e.g. `@ethereumjs/tx` `paramsTx` for tx-specific EIP params). Pass them via the constructor `params` option when needed.\n\n## Blob Gas Schedule\n\nEIP-4844 blob gas limits and EIP-7892 BPO schedule changes are exposed through `getBlobGasSchedule()`. BPO hardforks (`Bpo1`, …) carry `target` / `max` on the hardfork definition; earlier forks need EIP-4844 params (merged automatically when using `@ethereumjs/vm` / `@ethereumjs/evm`, or via `updateParams()` on standalone `Common`).\n\n```ts\n// ./examples/blobGasSchedule.ts\n\nimport { Common, Hardfork, Mainnet } from '@ethereumjs/common'\n\nconst blob4844Params = {\n  targetBlobGasPerBlock: 393216,\n  maxBlobGasPerBlock: 786432,\n  blobGasPriceUpdateFraction: 3338477,\n  blobGasPerBlob: 131072,\n}\n\n// Pre-BPO: EIP-4844 param names\nconst cancun = new Common({ chain: Mainnet, hardfork: Hardfork.Cancun })\ncancun.updateParams({ 4844: blob4844Params })\nconst cancunSchedule = cancun.getBlobGasSchedule()\nconsole.log(\n  `Cancun: target=${cancunSchedule.targetBlobGasPerBlock} max=${cancunSchedule.maxBlobGasPerBlock}`,\n)\n\n// BPO hardforks: target/max counts are on the HF; multiply by blobGasPerBlob\nfor (const hardfork of [Hardfork.Bpo1, Hardfork.Bpo2]) {\n  const common = new Common({ chain: Mainnet, hardfork })\n  common.updateParams({ 4844: { blobGasPerBlob: blob4844Params.blobGasPerBlob } })\n  const schedule = common.getBlobGasSchedule()\n  console.log(\n    `${hardfork}: target=${schedule.targetBlobGasPerBlock} max=${schedule.maxBlobGasPerBlock} updateFraction=${schedule.blobGasPriceUpdateFraction}`,\n  )\n}\n```\n\n## EIP Activation\n\nEIPs activate through the hardfork schedule and/or the constructor `eips` array. Query with `isActivatedEIP()`.\n\n```ts\n// ./examples/activateEIPs.ts\n\nimport { Common, Hardfork, Mainnet } from '@ethereumjs/common'\n\n// Default-on via hardfork schedule (Prague ships EIP-7702)\nconst prague = new Common({ chain: Mainnet, hardfork: Hardfork.Prague })\nconsole.log(`EIP-7702 on Prague: ${prague.isActivatedEIP(7702)}`)\n\n// Opt-in before schedule: activate on an earlier hardfork via constructor `eips`\nconst early7702 = new Common({ chain: Mainnet, hardfork: Hardfork.Cancun, eips: [7702] })\nconsole.log(`EIP-7702 forced on Cancun: ${early7702.isActivatedEIP(7702)}`)\n\n// Experimental Amsterdam fork (in development) — full bundle via Hardfork.Amsterdam\nconst amsterdam = new Common({ chain: Mainnet, hardfork: Hardfork.Amsterdam })\nconsole.log(`EIP-7928 BAL on Amsterdam: ${amsterdam.isActivatedEIP(7928)}`)\nconsole.log(`EIP-7708 transfer logs: ${amsterdam.isActivatedEIP(7708)}`)\nconsole.log(`EIP-8037 two-dimensional gas: ${amsterdam.isActivatedEIP(8037)}`)\nconsole.log(`EIP-7843 SLOTNUM / slotNumber: ${amsterdam.isActivatedEIP(7843)}`)\n```\n\n### Supported EIPs\n\nThe following EIPs are currently supported (sorted by EIP number):\n\n- [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) - Transient storage opcodes (Cancun)\n- [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) - Fee market change for ETH 1.0 chain\n- [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - Precompile for BLS12-381 curve operations (Prague)\n- [EIP-2565](https://eips.ethereum.org/EIPS/eip-2565) - ModExp gas cost\n- [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) - Transaction Types\n- [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929) - Gas cost increases for state access opcodes\n- [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) - Optional access list tx type\n- [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) - Serve historical block hashes in state (Prague)\n- [EIP-3198](https://eips.ethereum.org/EIPS/eip-3198) - Base fee opcode\n- [EIP-3529](https://eips.ethereum.org/EIPS/eip-3529) - Reduction in refunds\n- [EIP-3541](https://eips.ethereum.org/EIPS/eip-3541) - Reject new contracts starting with the 0xEF byte\n- [EIP-3554](https://eips.ethereum.org/EIPS/eip-3554) - Difficulty Bomb Delay to December 2021 (only PoW networks)\n- [EIP-3607](https://eips.ethereum.org/EIPS/eip-3607) - Reject transactions from senders with deployed code\n- [EIP-3651](https://eips.ethereum.org/EIPS/eip-3651) - Warm COINBASE (Shanghai)\n- [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675) - Upgrade consensus to Proof-of-Stake\n- [EIP-3855](https://eips.ethereum.org/EIPS/eip-3855) - PUSH0 opcode (Shanghai)\n- [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860) - Limit and meter initcode (Shanghai)\n- [EIP-4345](https://eips.ethereum.org/EIPS/eip-4345) - Difficulty Bomb Delay to June 2022\n- [EIP-4399](https://eips.ethereum.org/EIPS/eip-4399) - Supplant DIFFICULTY opcode with PREVRANDAO (Merge)\n- [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) - Beacon block root in the EVM (Cancun)\n- [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) - Shard Blob Transactions (Cancun)\n- [EIP-4895](https://eips.ethereum.org/EIPS/eip-4895) - Beacon chain push withdrawals as operations (Shanghai)\n- [EIP-5133](https://eips.ethereum.org/EIPS/eip-5133) - Delaying Difficulty Bomb to mid-September 2022 (Gray Glacier)\n- [EIP-5656](https://eips.ethereum.org/EIPS/eip-5656) - MCOPY - Memory copying instruction (Cancun)\n- [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110) - Supply validator deposits on chain (Prague)\n- [EIP-6780](https://eips.ethereum.org/EIPS/eip-6780) - SELFDESTRUCT only in same transaction (Cancun)\n- [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002) - Execution layer triggerable exits (Prague)\n- [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251) - Increase the MAX_EFFECTIVE_BALANCE (Prague)\n- [EIP-7516](https://eips.ethereum.org/EIPS/eip-7516) - BLOBBASEFEE opcode (Cancun)\n- [EIP-7594](https://eips.ethereum.org/EIPS/eip-7594) - PeerDAS blob transactions (Osaka)\n- [EIP-7623](https://eips.ethereum.org/EIPS/eip-7623) - Increase calldata cost (Prague)\n- [EIP-7685](https://eips.ethereum.org/EIPS/eip-7685) - General purpose execution layer requests (Prague)\n- [EIP-7691](https://eips.ethereum.org/EIPS/eip-7691) - Blob throughput increase (Prague)\n- [EIP-7692](https://eips.ethereum.org/EIPS/eip-7692) - EVM Object Format (EOF) v1 (experimental)\n- [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) - Set EOA account code (Prague)\n- [EIP-7708](https://eips.ethereum.org/EIPS/eip-7708) - ETH transfers emit a log (Amsterdam, experimental)\n- [EIP-7709](https://eips.ethereum.org/EIPS/eip-7709) - Read BLOCKHASH from storage and update cost (Verkle, experimental)\n- [EIP-7778](https://eips.ethereum.org/EIPS/eip-7778) - Block-level gas accounting without refunds (Amsterdam, experimental)\n- [EIP-7823](https://eips.ethereum.org/EIPS/eip-7823) - Set upper bounds for MODEXP (Osaka)\n- [EIP-7825](https://eips.ethereum.org/EIPS/eip-7825) - Transaction gas limit cap (Osaka)\n- [EIP-7843](https://eips.ethereum.org/EIPS/eip-7843) - SLOTNUM opcode (Amsterdam, experimental)\n- [EIP-7864](https://eips.ethereum.org/EIPS/eip-7864) - Ethereum state using a unified binary tree (experimental)\n- [EIP-7883](https://eips.ethereum.org/EIPS/eip-7883) - ModExp gas cost increase (Osaka)\n- [EIP-7918](https://eips.ethereum.org/EIPS/eip-7918) - Blob base fee bounded by execution cost (Osaka)\n- [EIP-7928](https://eips.ethereum.org/EIPS/eip-7928) - Block Level Access Lists (Amsterdam, experimental)\n- [EIP-7934](https://eips.ethereum.org/EIPS/eip-7934) - RLP Execution Block Size Limit (Osaka)\n- [EIP-7939](https://eips.ethereum.org/EIPS/eip-7939) - Count leading zeros (CLZ) opcode (Osaka)\n- [EIP-7951](https://eips.ethereum.org/EIPS/eip-7951) - Precompile for secp256r1 curve support (Osaka)\n- [EIP-7954](https://eips.ethereum.org/EIPS/eip-7954) - Increase max contract and initcode size (Amsterdam, experimental)\n- [EIP-7976](https://eips.ethereum.org/EIPS/eip-7976) - Increase calldata floor cost (Amsterdam, experimental)\n- [EIP-7981](https://eips.ethereum.org/EIPS/eip-7981) - Access list data pricing (Amsterdam, experimental)\n- [EIP-7997](https://eips.ethereum.org/EIPS/eip-7997) - Deterministic CREATE2 factory predeploy (Amsterdam, experimental)\n- [EIP-8024](https://eips.ethereum.org/EIPS/eip-8024) - DUPN, SWAPN and EXCHANGE instructions (Amsterdam, experimental)\n- [EIP-8037](https://eips.ethereum.org/EIPS/eip-8037) - State creation gas cost increase (Amsterdam, experimental)\n- [EIP-8038](https://eips.ethereum.org/EIPS/eip-8038) - State access gas cost increase (Amsterdam, experimental)\n- [EIP-8246](https://eips.ethereum.org/EIPS/eip-8246) - SELFDESTRUCT no burn (Amsterdam, experimental)\n- [EIP-8282](https://eips.ethereum.org/EIPS/eip-8282) - Builder execution requests (Amsterdam, experimental)\n\nAnnotations:\n\n- Hardfork labels (e.g. `(Prague)`) indicate default activation on that fork\n- `(Amsterdam, experimental)` and `(experimental)` mark unstable specs; behaviour may change on patch releases\n- Release ↔ spec tracking: [canonical Amsterdam overview](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/vm#amsterdam-hardfork-experimental) in `@ethereumjs/vm`\n\n## Events\n\n`common.events` is an [EventEmitter3](https://github.com/primus/eventemitter3) instance:\n\n| Event             | Description                                                |\n| ----------------- | ---------------------------------------------------------- |\n| `hardforkChanged` | Emitted when `setHardfork()` changes the active hardfork   |\n\n```ts\n// ./examples/hardforkEvents.ts\n\nimport { Common, Hardfork, Mainnet } from '@ethereumjs/common'\n\nconst common = new Common({ chain: Mainnet, hardfork: Hardfork.London })\n\ncommon.events.on('hardforkChanged', (hardfork) => {\n  console.log(`hardforkChanged event: ${hardfork}`)\n})\n\ncommon.setHardfork(Hardfork.Prague)\n```\n\n## Custom and Private Chains\n\n`createCustomCommon()` adjusts a base preset or supplies a full `ChainConfig`. Use it for L2 chain IDs, devnets, and PoA networks.\n\n### Chain ID override (L2 pattern)\n\n```ts\n// ./examples/customChainId.ts\n\nimport { Mainnet, createCustomCommon } from '@ethereumjs/common'\n\n// Keep Mainnet params but override chainId — typical for L2 / private networks\nconst l2Common = createCustomCommon({ chainId: 42161 }, Mainnet)\n\nconsole.log(`chainId=${l2Common.chainId()} name=${l2Common.chainName()}`)\nconsole.log(`Hardfork schedule inherited (${l2Common.hardforks().length} entries)`)\n```\n\nSee the [`@ethereumjs/tx` README](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx) for signing with a custom `Common`.\n\n### Full custom `ChainConfig`\n\n```ts\n// ./examples/customChain.ts\n\nimport { Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common'\nimport { customChainConfig } from '@ethereumjs/testdata'\n\nconst common = createCustomCommon(customChainConfig, Mainnet)\n\nconsole.log(`Chain ${common.chainName()} (chainId=${common.chainId()})`)\nconsole.log(`Hardfork at block 4: ${common.getHardforkBy({ blockNumber: 4n })}`)\nconsole.log(`Bootstrap nodes: ${common.bootstrapNodes().length}`)\n\ncommon.setHardfork(Hardfork.Byzantium)\nconsole.log(`Active hardfork on custom chain: ${common.hardfork()}`)\n```\n\n### PoA / Clique consensus metadata\n\n```ts\n// ./examples/consensusConfig.ts\n\nimport { Common, Hardfork } from '@ethereumjs/common'\nimport { testnetMergeChainConfig } from '@ethereumjs/testdata'\n\nconst common = new Common({ chain: testnetMergeChainConfig, hardfork: Hardfork.London })\n\nconsole.log(`consensusType: ${common.consensusType()}`)\nconsole.log(`consensusAlgorithm: ${common.consensusAlgorithm()}`)\n\nconst clique = common.consensusConfig()\nconsole.log(`clique period=${clique.period}s epoch=${clique.epoch} blocks`)\n```\n\n### From Geth genesis JSON\n\nFor devnets and testnets, derive `Common` from a Geth `genesis.json` (chain config + alloc):\n\n```ts\n// ./examples/fromGethGenesis.ts\n\nimport { createCommonFromGethGenesis } from '@ethereumjs/common'\nimport { postMergeGethGenesis } from '@ethereumjs/testdata'\nimport { hexToBytes } from '@ethereumjs/util'\n\nconst genesisHash = hexToBytes('0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a')\nconst common = createCommonFromGethGenesis(postMergeGethGenesis, {\n  chain: 'customChain',\n  genesisHash,\n})\n// Defer genesisHash when unknown at init time — set later after computing the genesis block hash\ncommon.setForkHashes(genesisHash)\n\nconsole.log(`Hardfork is ${common.hardfork()} chainId=${common.chainId()}`)\nconsole.log(`Paris fork hash: ${common.forkHash('paris')}`)\n```\n\n## Custom Cryptography (WASM / KZG)\n\nBy default, EthereumJS uses audited pure-JS crypto from `ethereum-cryptography`. For performance or blob/KZG support, pass replacements on `customCrypto` ([`types.ts`](./src/types.ts)).\n\nNote: WASM backends add supply-chain and audit surface. Evaluate before enabling in production.\n\n### keccak256 (WASM example)\n\n```ts\n// ./examples/customCrypto.ts\n\nimport { createBlock } from '@ethereumjs/block'\nimport { Common, Mainnet } from '@ethereumjs/common'\nimport { keccak256, waitReady } from '@polkadot/wasm-crypto'\n\nconst main = async () => {\n  await waitReady()\n\n  const common = new Common({ chain: Mainnet, customCrypto: { keccak256 } })\n  const block = createBlock({}, { common })\n\n  // Downstream calls on objects sharing this `common` use the custom hash\n  console.log(block.hash())\n}\n\nvoid main()\n```\n\n### KZG for EIP-4844 / PeerDAS\n\nKZG is required for blob transactions (EIP-4844) and cell proofs (EIP-7594). Wire any library implementing the [`KZG` interface](./src/types.ts); the example below uses `micro-eth-signer`:\n\n```ts\n// ./examples/initKZG.ts\n\nimport { Common, Hardfork, Mainnet } from '@ethereumjs/common'\nimport { trustedSetup } from '@paulmillr/trusted-setups/fast-peerdas.js'\nimport { KZG as microEthKZG } from 'micro-eth-signer/kzg.js'\n\nconst main = async () => {\n  const kzg = new microEthKZG(trustedSetup)\n  const common = new Common({\n    chain: Mainnet,\n    hardfork: Hardfork.Cancun,\n    customCrypto: { kzg },\n  })\n  console.log(common.customCrypto.kzg !== undefined)\n}\n\nvoid main()\n```\n\n## Browser\n\nHybrid ESM/CJS builds ship with v10; libraries are pure JS by default (no hard-wired WASM). See [`examples/browser.html`](./examples/browser.html) for a local dev-server setup.\n\n## API\n\nGenerated TypeDoc: [Documentation](./docs/README.md)\n\nHelper methods include `paramByBlock()`, `hardforkIsActiveOnBlock()`, `forkHash()`, `setForkHashes()`, `copy()`, and `updateParams()` for advanced overrides.\n\nHybrid CJS/ESM builds: ESM `import` resolves to `dist/esm/`; Node `require` resolves to `dist/cjs/`.\n\n## EthereumJS\n\nThe `EthereumJS` GitHub organization and its repositories are managed by members of the former Ethereum Foundation JavaScript team and the broader Ethereum community. See [developer docs](../../DEVELOPER.md) and [code of conduct](../../CODE_OF_CONDUCT.md).\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n\n[discord-badge]: https://img.shields.io/static/v1?logo=discord&label=discord&message=Join&color=blue\n[discord-link]: https://discord.gg/TNwARpR\n[common-npm-badge]: https://img.shields.io/npm/v/@ethereumjs/common.svg\n[common-npm-link]: https://www.npmjs.com/package/@ethereumjs/common\n[common-issues-badge]: https://img.shields.io/github/issues/ethereumjs/ethereumjs-monorepo/package:%20common?label=issues\n[common-issues-link]: https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aopen+is%3Aissue+label%3A\"package%3A+common\"\n[common-actions-badge]: https://github.com/ethereumjs/ethereumjs-monorepo/workflows/Common/badge.svg\n[common-actions-link]: https://github.com/ethereumjs/ethereumjs-monorepo/actions?query=workflow%3A%22Common%22\n[common-coverage-badge]: https://codecov.io/gh/ethereumjs/ethereumjs-monorepo/branch/master/graph/badge.svg?flag=common\n[common-coverage-link]: https://codecov.io/gh/ethereumjs/ethereumjs-monorepo/tree/master/packages/common\n","publish_time":1745915915083,"_cnpm_publish_time":1745915915083,"dist-tags":{"alpha":"5.0.0-alpha.1","beta":"3.0.0-beta.3","latest":"10.1.3","nightly":"10.1.1-nightly.2","rc":"10.0.0-rc.1"}}