Skip to content
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

Initial PSBT support #3738

Merged
merged 13 commits into from May 21, 2020
Merged

Conversation

niftynei
Copy link
Collaborator

@niftynei niftynei commented May 19, 2020

First pass at including PSBT structs into the transaction mechanics. We now can carry witness scripts around in the psbt instead of serializing them separately as witscripts, so we strip the witscript support.

Finally, as a showpiece, we return the PBST version of the transaction from txprepare.

@niftynei niftynei added this to the v0.9.0 milestone May 19, 2020
@niftynei niftynei requested a review from cdecker as a code owner May 19, 2020
@niftynei
Copy link
Collaborator Author

@niftynei niftynei commented May 19, 2020

depends on ElementsProject/libwally-core#190 to pass VALGRIND tests

rustyrussell and others added 10 commits May 21, 2020
Includes an important PSBT fix (ElementsProject/libwally-core#190)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
add the missing psbt helpers for adding and removing an input and output
we can now keep associated witness data with the output in the psbt
struct, so we do that.
Make sure that we permute them also!

Fixes weird spacing also
Pass scriptSig + witness info down to the PSBT struct
Move all psbt creation into single method, new_psbt

note that if a psbt is init'd for a transaction that's
deserialized with scripts etc already attached, then set_global_tx
will fail. instead, we empty all of this out first.

if the tx is being re-init'd from a tx source that had a psbt attached
(e.g. fromwire_) then the script/witness data will get populated
appropriatel from there.
niftynei added 3 commits May 21, 2020
now that witness script data is saved into the tx/psbt which is
serialized across the wire, there's no reason to use witscript to do
this. good bye witscript!
Changelog-Added: JSON-API: `txprepare` returns a psbt version of the created transaction
@rustyrussell
Copy link
Contributor

@rustyrussell rustyrussell commented May 21, 2020

Rebased and added latest Wally version.

Ack 83d13f2

@rustyrussell rustyrussell merged commit 1fb9a07 into ElementsProject:master May 21, 2020
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants