ordspv
    Preparing search index...

    Function assembleAnchoredHop

    • Anchor a transaction: fetch its inclusion proof, header, and block tx count, plus the prev txs for inputs 0..prevTxsUpTo (pass -1 for none, as a coinbase needs).

      Nothing here is trusted, and the bundle verifier re-proves all of it. What the verifier cannot do is rotate, because it runs after the build loop has been left, so the hop is checked against itself here as well, through checkHopAnswers, which covers every check verifyAnchoredHop runs on the same answers and adds the block info fields the bundle does not carry. A failure is one backend's answers failing (HopConsistencyError), which the loops rotate on instead of spending the rest of the walk on it, and a hop that fails here would have failed there.

      The rest of the parity with verification lives at the callers, because it needs data this function is not given: checkTxNotAmbiguous on every transaction a bundle will carry in a proven position, bindRevealEnvelope on the reveal once its envelope and prev txs are in hand, the custody walk's own chain-order test on each hop it appends, and the genealogy walk's test that the terminal coinbase sits at position 0. That last one belongs to its caller because this function anchors ordinary hops too, where a nonzero position is correct.

      powLimitBits is the floor checkPowLimit applies, in the convention makeHeaderTrust uses: undefined is the mainnet limit and null disables it. Pass the caller's own option, so the build refuses at the same bar the caller's verification will.

      Parameters

      Returns Promise<CustodyHopJson>