-
Notifications
You must be signed in to change notification settings - Fork 145
Add PSBT (BIP-174) support #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PSBT (BIP-174) support #118
Conversation
|
Hi @karask, just checking in on this PR! I’ve added PSBT (BIP-174) support with tests and examples. I’ve also mentioned some future enhancements in the PR that I’d love to work on next. Let me know your thoughts or if anything needs adjusting. Thanks! |
|
Thank you for the contribution! I see you have done a lot of cleanup in addition to PSBT. I have not looked in detail the PSBT code or even tried to merge/run the code. It will take some time and I wanted to reply asap given the amount of effort you have put into this. For now I had a quick look at how the existing codebase is modified and check the new files that you have added. Some questions/comments:
Again, thank you for the impressive PR. For future reference, I would suggest that you do several smaller PRs. It is quite challenging to review several changes at once. E.g. one PR to add PSBT, another PR to clean the tests with mock data, another PR for other minor cleanup like adding comments, etc. Due to some time constraints I am skipping SoB this year. However, if the above changes are properly integrated succuessfully in the codebase you would have done half the SoB project already. Send me an email if you are interested to participate. |
|
Hi @karask, Thank you for taking the time to review my PR! I appreciate your feedback and quick response. Let me address your questions:
I apologize for the size of this PR - I understand it makes reviewing more challenging. In the future, I'll submit smaller, more focused PRs as you suggested. I'm happy to make any adjustments you recommend to ensure these changes integrate smoothly with the codebase. Would you like me to start by removing the unnecessary patch/fix files to make the PR cleaner? Regarding Summer of Bitcoin, I'm participating in it . I was actually hoping that this project would be part of the program, and I'm excited by your mention of it. I'll send you an email with more details. Thank you again for your feedback! |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Again, quick reply!
Please make the above changes and I will review. Thanks! |
|
Please also add the tests added by PR #120 in the new framework! |
|
Hi @karask, Thank you for your feedback. I've addressed all the requested changes:
Regarding point #6 (incorporating tests from PR #120), I plan to address this in my next update. I wanted to get these initial changes to you first for review. Please let me know if there are any other adjustments needed. Thank you! |
|
Hi @karask, I've now addressed point #6 from your feedback by incorporating the tests from PR #120 into the new testing framework:
With this update, all requested changes have been completed. Please let me know if you need any further modifications. |
|
Thanks @JAGADISHSUNILPEDNEKAR I assume new.py is still not needed. Hmm, I am quite confused with the mocking test data/framework. I see test_psbt.py and others which use the old test framework (values in the same file, etc.), extra files like ix_imports.py to fix circular imports, etc. I am not convinced this is the cleanest way to do it (and I really want to keep file structure as clean as possible). I would suggest, for this PR, to:
In summary, just include the PSBT code only, using the existing test framework. I would expect something like the 10 files I mentioned above. Later on, we could discuss how we can incorporate a mock data test framework/suite (which is quite challenging to make properly, and is probably another SoB project to be honest) but right now let's focus on PSBT. I have still not reviewed the PSBT code. I assume it is dealing with BIP-174 for now. Please send the above changes and I will do so asap. :-) |
8e22601 to
db367d8
Compare

Add PSBT (BIP-174) Support
Description
This PR adds support for Partially Signed Bitcoin Transactions (PSBT) as defined in BIP-174. PSBT is a critical format used by hardware wallets and multi-signature setups to coordinate transaction signing across multiple devices or parties.
Features Added
PSBTclass for creating, parsing, and updating PSBTsPSBTInputandPSBTOutputclasses for handling PSBT inputs and outputsMotivation
Hardware wallet support and multi-signature capability are crucial for secure Bitcoin management. PSBTs enable wallet developers to:
Example Usage
Testing
All PSBT functionality is covered by unit tests in
test_psbt.py. Tests include:Future Enhancements (Not in this PR)
References
Screenshots
This shows that the implementation has been successful and all test cases are passing:

