BIP-341: require full spent transaction for taproot inputs in PSBT #1243

pull dr-orlovsky wants to merge 1 commits into bitcoin:master from dr-orlovsky:patch-12 changing 1 files +4 −2
  1. dr-orlovsky commented at 11:37 pm on November 26, 2021: contributor

    Since taproot signatures sign over all amounts in the spent transaction, taproot inputs must require PSBT_IN_NON_WITNESS_UTXO to be always present. The only exclusion is SIGHASH_ANYONECANPAY, where PSBT_IN_WITNESS_UTXO may be enough.

    I also propose to consider changing names of PSBT_IN_NON_WITNESS_UTXO and PSBT_IN_WITNESS_UTXO in all three PSBT standards to PSBT_IN_SPENT_FULL_TX and PSBT_IN_SPENT_UTXO

  2. BIP-341: require full spent transaction for taproot inputs in PSBT
    Since taproot signatures sign over all amounts in the spent transaction, taproot inputs must require `PSBT_IN_NON_WITNESS_UTXO` to be always present. The only exclusion is `SIGHASH_ANYONECANPAY`, where `PSBT_IN_WITNESS_UTXO` may be enough.
    bc1c6dabaf
  3. junderw commented at 11:50 pm on November 26, 2021: contributor

    It also might be beneficial to add new PSBT_IN_ALL_PREVOUT_SCRIPTS and PSBT_IN_ALL_PREVOUT_VALUES to save on space.

    Using Psbt in a crypto exchange setting, I can tell you that we run into PSBT_IN_NON_WITNESS_UTXO where there are hundreds of inputs (in the parent tx) and our cold transactions also tend to have hundreds of inputs, so we often run into parsing errors from the Psbt getting too large.

    For fork coins that don’t support segwit we get around this by doing some hacky things that are no worse than what we had pre-Psbt. @achow101 If I could also get your thoughts on PSBT_IN_ALL_PREVOUT_SCRIPTS and PSBT_IN_ALL_PREVOUT_VALUES real quick when/if you ACK this, I’d appreciate it.

  4. achow101 commented at 0:06 am on November 27, 2021: member

    Since taproot signatures sign over all amounts in the spent transaction, taproot inputs must require PSBT_IN_NON_WITNESS_UTXO to be always present.

    No it doesn’t. Taproot requires only the amounts of the UYXOs being spent in the current transaction. Other than the amount and script of each UTXO, no data from previous transactions are required.

  5. junderw commented at 0:12 am on November 27, 2021: contributor

    No it doesn’t. Taproot requires only the amounts of the UYXOs being spent in the current transaction. Other than the amount and script of each UTXO, no data from previous transactions are required.

    My comment was under the pretense that OP was correct, so I withdraw my comment. We can continue to use witness_utxo and just gather the scripts and values from all the inputs.

  6. dr-orlovsky commented at 1:04 am on November 27, 2021: contributor

    No it doesn’t. Taproot requires only the amounts of the UYXOs being spent in the current transaction. Other than the amount and script of each UTXO, no data from previous transactions are required.

    But without PSBT_IN_NON_WITNESS_UTXO there is nowhere the signer can get information on the amounts…

  7. junderw commented at 4:58 am on November 27, 2021: contributor

    @dr-orlovsky You don’t need any amount besides the amount you are spending for your input. You need the amounts that all your sibling inputs are spending (which are all different transactions most likely)

    This is not correct:

    0tx.ins[0].getSighashSegwitV1(
    1  ...,
    2  tx.ins[0].nonWitnessUtxo.outs.map(o => o.script),
    3  tx.ins[0].nonWitnessUtxo.outs.map(o => o.value),
    4  ...,
    5)
    

    This is correct:

    0tx.ins[0].getSighashSegwitV1(
    1  ...,
    2  tx.ins.map(in => in.witnessUtxo.script),
    3  tx.ins.map(in => in.witnessUtxo.value),
    4  ...,
    5)
    
  8. dr-orlovsky commented at 7:47 am on November 27, 2021: contributor
    @junderw oh, ok, that was not obvious from the specs; thank you for clarifying that out. Probably we can close this issue.
  9. luke-jr added the label Proposed BIP modification on Dec 15, 2021
  10. luke-jr commented at 9:35 pm on December 15, 2021: member
    @dr-orlovsky Could you close it, if it is no longer needed?
  11. dr-orlovsky closed this on Dec 21, 2021


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: 2024-10-30 01:10 UTC

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