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 13 commits into from
May 21, 2020


Copy link

@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 03:02
Copy link
Collaborator Author

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

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

Signed-off-by: Rusty Russell <>
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.
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
Copy link

Rebased and added latest Wally version.

Ack 83d13f2

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

Successfully merging this pull request may close these issues.

None yet

2 participants