BIP370: add Input Finalizer section; BIP371: remove finalizer clause from an output field #2277

pull fametrano wants to merge 2 commits into bitcoin:master from fametrano:psbt-finalizer-clearing changing 2 files +6 −1
  1. fametrano commented at 4:01 PM on September 7, 2026: contributor

    Two independent commits.

    BIP370: add an Input Finalizer section

    In a version 2 PSBT, the fields that define an input live in the input map: PSBT_IN_PREVIOUS_TXID, PSBT_IN_OUTPUT_INDEX, PSBT_IN_SEQUENCE, and the two required-locktime fields.

    BIP174 tells the Input Finalizer to clear every field of a finalized input except the UTXO and unknown fields. Followed literally on a version 2 input, this deletes the fields above. Without PSBT_IN_PREVIOUS_TXID or PSBT_IN_OUTPUT_INDEX the PSBT is invalid; without the sequence and locktime fields the Transaction Extractor builds a different transaction.

    BIP370 defines every other role for version 2 but has no Input Finalizer section. This adds one, stating that the finalizer keeps those five fields. Bitcoin Core already does this: its input serializer writes them whether or not the input is finalized.

    BIP371: remove a finalizer clause from an output field

    PSBT_OUT_TAP_BIP32_DERIVATION carries the note "Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS is constructed".

    This is an output field. An output has no PSBT_IN_FINAL_SCRIPTWITNESS, and the clause names no input to act on. The two neighbouring output fields carry no such note. This removes it.

    Both are minor amendments to Deployed BIPs.

  2. bip-0370: say what the Input Finalizer keeps in a version 2 input
    BIP 174 tells the Input Finalizer to clear all other data except the
    UTXO and unknown fields from a finalized input. It was written when the
    unsigned transaction was a global field. PSBTv2 moves the data that
    defines the input into the input map, and a finalizer that follows the
    sentence literally removes it: without PSBT_IN_PREVIOUS_TXID or
    PSBT_IN_OUTPUT_INDEX the result is invalid, and without
    PSBT_IN_SEQUENCE and the locktime fields the Transaction Extractor
    builds a different transaction.
    
    BIP 370 amends Creator, Updater, Signer and Transaction Extractor for
    PSBTv2, adds the Constructor, and says nothing about the Input
    Finalizer. Add the section: the five fields are kept. Bitcoin Core
    does this today: at 19b0ff2fa0, PSBTInput::Serialize in src/psbt.h
    writes them for every PSBTv2 input, finalized or not.
    4901287cf4
  3. bip-0371: drop the finalizer clause from PSBT_OUT_TAP_BIP32_DERIVATION
    The six taproot input fields say "Finalizers should remove this field
    after PSBT_IN_FINAL_SCRIPTWITNESS is constructed", and so does the
    output field PSBT_OUT_TAP_BIP32_DERIVATION. An output has no
    PSBT_IN_FINAL_SCRIPTWITNESS, the clause names no input, and its two
    neighbours in the output table carry no such clause. Drop it; Bitcoin
    Core does not clear output fields on finalization.
    f5034ac310
  4. fametrano renamed this:
    BIP370: add the Input Finalizer role; BIP371: drop the finalizer clause from PSBT_OUT_TAP_BIP32_DERIVATION
    BIP370: add Input Finalizer section; BIP371: remove finalizer clause from an output field
    on Sep 7, 2026
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-09 03:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me