Skip to content

Make signrawtransaction accept P2SH-P2WSH redeemscripts#12427

Merged
laanwj merged 1 commit intobitcoin:masterfrom
sipa:201802_signrawp2shp2wsh
Feb 15, 2018
Merged

Make signrawtransaction accept P2SH-P2WSH redeemscripts#12427
laanwj merged 1 commit intobitcoin:masterfrom
sipa:201802_signrawp2shp2wsh

Conversation

@sipa
Copy link
Member

@sipa sipa commented Feb 13, 2018

This is a quick fix for #12418, which is a regression in 0.16.

It permits specifying just the inner redeemscript to let signrawtransaction succeed. This inner redeemscript is already reported by addmultisigaddress & co.

#11708 uses a different approach, where listunspent reports both inner & outer redeemscript, but requires both to be provided to signrawtransaction. Part of #11708 is still needed even in combination with this PR however, as currently the inner redeemscript isn't reported by listunspent.

@maflcko maflcko added this to the 0.16.0 milestone Feb 13, 2018
@sipa sipa force-pushed the 201802_signrawp2shp2wsh branch 2 times, most recently from 19d27c0 to 3fcdcc1 Compare February 14, 2018 00:05
@sipa sipa force-pushed the 201802_signrawp2shp2wsh branch from 3fcdcc1 to 5f605e1 Compare February 14, 2018 01:38
@Sjors
Copy link
Member

Sjors commented Feb 15, 2018

Manually tested signrawtransaction with explicit private key arguments on regtest, with P2SH-P2WSH. Works on this branch, and throws Unable to sign input, invalid stack size on master.

Also tested with a native P2WSH multisig for good measure. This already worked on master.

@laanwj
Copy link
Member

laanwj commented Feb 15, 2018

utACK 5f605e1

@laanwj
Copy link
Member

laanwj commented Feb 15, 2018

I do think this needs a test, but that can be done later (no need to hold up 0.16.0 for it), thanks @Sjors for doing a manual test.

@laanwj laanwj merged commit 5f605e1 into bitcoin:master Feb 15, 2018
laanwj added a commit that referenced this pull request Feb 15, 2018
5f605e1 Make signrawtransaction accept P2SH-P2WSH redeemscripts (Pieter Wuille)

Pull request description:

  This is a quick fix for #12418, which is a regression in 0.16.

  It permits specifying just the inner redeemscript to let `signrawtransaction` succeed. This inner redeemscript is already reported by `addmultisigaddress` & co.

  #11708 uses a different approach, where `listunspent` reports both inner & outer redeemscript, but requires both to be provided to `signrawtransaction`. Part of #11708 is still needed even in combination with this PR however, as currently the inner redeemscript isn't reported by `listunspent`.

Tree-SHA512: a6fa2b2661ce04db25cf029dd31da39c0b4811d43692f816dfe0f77b4159b5e2952051664356a579f690ccd58a626e0975708afcd7ad5919366c490944e3a9a5
laanwj pushed a commit that referenced this pull request Feb 15, 2018
Github-Pull: #12427
Rebased-From: 5f605e1
Tree-SHA512: caf8c4e1806757d705493de30eea4f6a146a334ca6f6c93bc74cda43abda391b8406dd8ed6765fcde8eb86b3fb55689547ab69a30f34fca0d7896ea8c4e1db67
@theuni
Copy link
Member

theuni commented Feb 15, 2018

post-merge utACK

HashUnlimited pushed a commit to chaincoin/chaincoin that referenced this pull request Mar 16, 2018
Github-Pull: bitcoin#12427
Rebased-From: 5f605e1
Tree-SHA512: caf8c4e1806757d705493de30eea4f6a146a334ca6f6c93bc74cda43abda391b8406dd8ed6765fcde8eb86b3fb55689547ab69a30f34fca0d7896ea8c4e1db67
laanwj added a commit that referenced this pull request Feb 14, 2019
6ca836a Add release note for listunspent P2WSH change (MeshCollider)
928beae Add test for P2SH-P2WSH in signrawtransactionwithkey and listunspent (MeshCollider)
314784a Make listunspent and signrawtransaction RPCs support witnessScript (MeshCollider)

Pull request description:

  This is a reworked version of #11708 after #12427 and the `signrawtransaction` split.

  For a P2WSH address, listunspent should return the witness script, and for a P2SH-P2WSH address, it should also return the inner witness script (because SignTransaction will automatically wrap it in P2SH if required).

  Includes a test which also tests the behaviour of #12427, and release note.

Tree-SHA512: a8e72cf16930312bf48ec47e44a68f8d7e26664043c1b4cc0983eb25aec4087e511188ff9a0f181cd7b8a0c068c60d7f1e7e3f226b79e8c48890039dcf57f7b7
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants