Skip to content

Psbt extensions and elements psbt serialization - #186

Closed
achow101 wants to merge 8 commits into
ElementsProject:masterfrom
achow101:psbt-ext
Closed

Psbt extensions and elements psbt serialization#186
achow101 wants to merge 8 commits into
ElementsProject:masterfrom
achow101:psbt-ext

Conversation

@achow101

Copy link
Copy Markdown
Contributor

Implements the latest additions to BIP 174 (version field, types are compact size unsigned int, proprietary types) as well as the Elements PSBT proprietary fields.

achow101 added 3 commits May 13, 2020 18:06
Byte vectors in a PSBT could have a 0 length and thus result in duplicate
keys in a PSBT as length 0 is also assumed that there is no vector for
that field. Instead of checking length, check that the pointer is non-null.

To ensure the pointers are non-null, malloc 1 byte. The length is still
stored as 0.
@achow101
achow101 force-pushed the psbt-ext branch 3 times, most recently from a612c7d to ad9c84d Compare May 15, 2020 20:55
achow101 added 4 commits May 15, 2020 17:00
wally_psbt_elements_init_alloc is added to set an elements magic

wally_psbt_init_alloc, wally_psbt_to_bytes, and wally_psbt_from_bytes
are updated to deal with this magic instead of the hard coded magic.

wally_psbt_is_elements is added.
@achow101

Copy link
Copy Markdown
Contributor Author

Someone who is more familiar with elements should probably add the elements specific things to wally_sign_psbt and wally_finalize_psbt and whatever other functions are needed to use elements psbt. This PR is primarily serialization.

Additionally, it is not clear to me how to test these changes as elements doesn't have serialization tests like there are for BIP 174.

@achow101

Copy link
Copy Markdown
Contributor Author

Redoing this on top of #191

@achow101 achow101 closed this May 29, 2020
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