Page MenuHomePhabricator

Create utility RPCs for PSBT

Authored by deadalnix on Nov 2 2019, 01:40.


Group Reviewers
Restricted Project
rABC6e5278d36615: Create utility RPCs for PSBT

decodepsbt takes a PSBT and decodes it to JSON

combinepsbt takes multiple PSBTs for the same tx and combines them.

finalizepsbt takes a PSBT and finalizes the inputs. If all inputs
are final, it extracts the network serialized transaction and returns
that instead of a PSBT unless instructed otherwise.

createpsbt is like createrawtransaction but for PSBTs instead of
raw transactions.

convertpsbt takes a network serialized transaction and converts it
into a psbt. The resulting psbt will lose all signature data and
an explicit flag must be set to allow transactions with signature
data to be converted.

This is a partial backport of Core PR13557 :

Test Plan

Unfortunately, the test have all been dumped at once at the end.

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Nov 2 2019, 01:40
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 2 2019, 01:40
Fabien requested changes to this revision.Nov 4 2019, 12:32
Fabien added a subscriber: Fabien.

This deserves release notes.

1525 ↗(On Diff #13868)

Should be in an else statement.

This revision now requires changes to proceed.Nov 4 2019, 12:32
deadalnix added inline comments.Nov 5 2019, 23:55
1525 ↗(On Diff #13868)

I'm glad there are no tests for that shit...

Good catch.

deadalnix updated this revision to Diff 13957.Nov 6 2019, 00:00

Fix missing else

Fabien accepted this revision.Nov 6 2019, 07:43

The release notes discussion from D4357 applies here as well.
For reference, these changes are documented for core in the 0.17.0 release notes.

I'll green this diff because the code looks good, and this is a large PR so the release notes can (should ?) be added at the end of the backport, together with the BIP174 addition to the file.

This revision is now accepted and ready to land.Nov 6 2019, 07:43
This revision was automatically updated to reflect the committed changes.