ordspv
    Preparing search index...

    Function checkPowLimit

    • Proof-of-work floor. checkProofOfWork compares a header's hash against the target the header itself declares, so a header that declares an easy target passes it for a few milliseconds of work. A bundle chooses its own headers, so a verifier that checks only the self-declared target proves nothing about the cost of fabricating one.

      powLimitBits is the network's easiest allowed target. undefined means mainnet (MAINNET_CHAIN_PARAMS.powLimitBits), a number overrides it for another chain, and null disables the floor. The comparison is local and needs no network. A header that fails is fabricated or belongs to another chain, and both are forgery-class.

      The floor's own bar is low. Mainnet's limit is difficulty 1, and a header at difficulty 1 costs about 2^32 hashes, which dedicated hardware does in well under a second; a header at recent mainnet difficulty costs about 2^78, and nothing here requires one, since the bundle picks its own height and its own bits. This removes the free case and nothing more. Anchoring the hash against the caller's own view of the chain is what defends against a fabricated header.

      Parameters

      • header: BlockHeader
      • powLimitBits: number | null | undefined
      • label: string = 'header'

      Returns void