Skip to content

Re-import PSBTv0 code from rust-bitcoin and rust-miniscript#23

Merged
tcharding merged 3 commits intomasterfrom
02-08-re-import
Feb 8, 2024
Merged

Re-import PSBTv0 code from rust-bitcoin and rust-miniscript#23
tcharding merged 3 commits intomasterfrom
02-08-re-import

Conversation

@tcharding
Copy link
Copy Markdown
Member

@tcharding tcharding commented Feb 8, 2024

We would like the PSBTv0 code to be as close as possible to the code we originally imported from rust-bitcoin and rust-miniscript. This gives us a few things:

  • Same code means downstream can easily switch from using the psbt modules in rust-bitcoin and rust-miniscritp, hopefully just need to change import paths.
  • Re-basing on new versions of the original code will be easier and less bug-prone if the files stay as close to the same as possible.

Re-import the original code, make as few a changes as possible to get it to build. Use the same directory structure as the original, unlike what we did when we originally imported the code.

Note, this patch is not PSBTv2 compliant because deserialization of v0 PSBTs does not fail for excluded map keys. That will be added in a subsequent patch.

@tcharding tcharding force-pushed the 02-08-re-import branch 2 times, most recently from 76ed608 to d8405f4 Compare February 8, 2024 02:46
We would like the PSBTv0 code to be as close as possible to the code
we originally imported from `rust-bitcoin` and `rust-miniscript`. This
gives us a few things:

- Same code means downstream can easily switch from using the `psbt`
  modules in `rust-bitcoin` and `rust-miniscritp`, hopefully just need
  to change import paths.
- Re-basing on new versions of the original code will be easier and
  less bug-prone if the files stay as close to the same as possible.

Re-import the original code, make as few a changes as possible to get
it to build. Use the same directory structure as the original, unlike
what we did when we originally imported the code.

Note, this patch is not PSBTv2 compliant because deserialization of v0
PSBTs does not fail for excluded map keys. That will be added in a
subsequent patch.
With the introduction of BIP-370 there are now map keys that must be
explicitly excluded instead of added to the `unknowns` map.

Check for excluded keys when deserializing the three maps (input,
output, and global).
We don't control the function signature that this helper function must
conform to. Just shoosh clippy.
@tcharding tcharding merged commit 7ed916f into master Feb 8, 2024
@tcharding tcharding deleted the 02-08-re-import branch February 8, 2024 02:57
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.

1 participant