Skip to content

Conversation

@Shahil3
Copy link

@Shahil3 Shahil3 commented Mar 28, 2025

The following features are included:
•PSBT parsing from hex and serialization back to hex
•Validation of global, input, and output maps using BIP-174 rules
•Input type detection (e.g., P2PKH, P2WSH, P2SH-P2WPKH)
•UTXO field validation: non-witness and witness handling
•Partial signature parsing and completeness check (for multisig)
•Input finalization (scriptSig and witness stack)
• Full transaction extraction if all inputs are finalized

@karask
Copy link
Owner

karask commented Mar 29, 2025

Hi @Shahil3 and thank you for the contribution.

Please make the test similar to all the other tests. Also please include some examples to demonstrate the usage of PSBT.

I will then review the code.

@defconradio
Copy link
Contributor

python3 tt.py 
==== PSBT Robust Test ====

1. Testing PSBT parsing from hex...
Traceback (most recent call last):
  File "/home/analiser/Someone-s-There/python-bitcoin-utils/tt.py", line 119, in <module>
    run_tests()
  File "/home/analiser/Someone-s-There/python-bitcoin-utils/tt.py", line 15, in run_tests
    psbt = PSBT.from_hex(psbt_hex)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/analiser/Someone-s-There/python-bitcoin-utils/bitcoinutils/psbt.py", line 295, in from_hex
    return cls.from_bytes(binascii.unhexlify(hex_string))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/analiser/Someone-s-There/python-bitcoin-utils/bitcoinutils/psbt.py", line 354, in from_bytes
    raise ValueError(f"Input #{idx} in unsigned tx already contains a scriptSig")
ValueError: Input #0 in unsigned tx already contains a scriptSig

@karask
Copy link
Owner

karask commented May 8, 2025

Proposals have finished and another PSBT design / implementation was selected. Thank you for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants