ordspv
    Preparing search index...

    Function attachRevealWitnessSection

    • Attach the reveal's wtxid proof to its hop, so the verifier can prove the envelope's index through the block's BIP-141 witness commitment. The whole added cost is one raw block request, the same request buildProofBundle makes for L3.

      mode decides which reveals get one. 'when-needed', the default, attaches it to multi-input reveals only, since a single-input reveal proves its own numbering; those bundles stay byte-identical to what earlier builders emitted. 'always' attaches it to every reveal, which is what a caller needs when the inscriber is inside its threat model: only a wtxid anchor shows the witness the chain executed.

      Each candidate section is folded against the block's own BIP-141 commitment before it is attached, through verifyWitnessAnchoring, the function the verifier runs on it. A backend can serve a block whose header hashes right and whose reveal sits at the right position while every witness in it has been rewritten, since a txid commits to no witness byte, and such a section is that backend's bad answer rather than a bundle to hand on.

      A missing section is fatal at verification for a multi-input reveal, and it is what the caller asked for under 'always', so failure is reported rather than swallowed. Each backend is tried in the order the caller supplied them and its cause recorded, and when none can serve the block this throws WitnessSectionUnavailableError naming every backend and why it failed. A rate limit and an unprovable reveal are different facts, and the caller has to be able to tell them apart. No unverifiable bundle is emitted.

      Returns the base URL of the backend that served the block, so the caller can bar it from attesting to the header it just helped fill in, and undefined when no section was needed.

      Parameters

      Returns Promise<string | undefined>