Skip to content

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 03:02
@niftynei niftynei force-pushed the nifty/psbt-support branch from bbf9724 to 2ea4826 Compare May 19, 2020 17:39
@niftynei
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 <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 13:27
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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants