can i put p2sh and p2wsh input in one transaction

51 views
Skip to first unread message

闫培苓

unread,
Jun 24, 2019, 12:21:16 AM6/24/19
to bitcoinj
if i put p2sh and p2wsh input in one transaction, when i sign the transaction, is there any different between i put two kind of type address input to two transaction?

thanks

闫培苓

unread,
Jun 25, 2019, 6:40:50 AM6/25/19
to bitcoinj
 anyone who can help me,thanks

Nelson Perez

unread,
Jun 26, 2019, 12:15:06 AM6/26/19
to bitcoinj
I'm not sure I understand your question. But it seems like you want to build a transaction that spends from 2 inputs, one being a good old P2SH and the other a P2WSH. While I think that is certainly possible, I don't think it is what you'd usually see in the wild because wallets work with segwit or without.

Then again, I'm not sure what your question is.

Nelson

闫培苓

unread,
Jun 26, 2019, 2:19:28 AM6/26/19
to bitcoinj
yes 
i want to build a transaction that spends from 2 inputs, one being a good old P2SH and the other a P2WSH,When I want to include p2sh and p2wsh input in a transaction, can you tell me what should I pay attention to, or can you give me an example use bitcoinj to spend p2sh and p2wsh in a transaction?

when i use bitcoinj build the transaction and sign it, then i broadcast raw transaction with litecoin core cli i get error as follow
error code: -26
error message:
non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 64)

raw tx hex generated with bitcoinj:
010000000001030af1147fc55dcf0a3c873f113fb4c261377a8f28ee99af2a8b8a3d947ec8690201000000fdfd0000483045022100dd7c67af696b52cd4ff731d96f15d4da088df9f7529204cd1862c678055b7ee502205b3dcda1a710b838a0659cb8d3e247f40e239bd72e3fb939a9934e90fe760efc014730440220687c1978d89dd758209b854ff21af35a80376b5f4f17849bb359adc727bab26502206baaf707dd4a9af66e56a159b2dfd231bf57dca006318d4c85b3acb8c0804d79014c6952210211ac0e98256ca976d23f2f07713b09fa202e06d75676f15ca50c25eedab7ebb121025d2762e6051dc727996a142d05431a8080dfbcab9dcea0f1ed8ad317b2d3ba432103d68c6be54f5bd46eaf54b2aa3310258e74dcfe73f546897854adec5442d2558553aeffffffff5895de7dc9662d625d5b875b442e69c2a3331ce6a224a840283234e1761f1f290000000000ffffffffc7216bc1adcb9a621534d588f2940f1947a03c285328201d950657d51ff616330000000000ffffffff011c0c000000000000220020369eb73a6d47d923d96f7be24417363b7fc328affd34a4d20b8ed01989bfba270004473044022003e0fda981992f063794cdaea5733060649bfbca87c348022dab2dd9a1a8c7a202200a2c06d605a0df9d0d3dc38c30d4869aadcbc38f54cec4321a2c29836460b9b6014730440220324a4e58fd23dcd2d0e9aa2d50673fa2c2644bb49fe9c194ba109cf1b1bfa84f02207fa77b835923a468fef8258850960789b6c0a1da8725a13f2fba529b7d4701d201006952210211ac0e98256ca976d23f2f07713b09fa202e06d75676f15ca50c25eedab7ebb121025d2762e6051dc727996a142d05431a8080dfbcab9dcea0f1ed8ad317b2d3ba432103d68c6be54f5bd46eaf54b2aa3310258e74dcfe73f546897854adec5442d2558553ae0447304402207d0b68f8e4febb9826cc07819ed0dec0a94c06a0d22e1ba8b0b68c3229c49c490220072b9f314185cbd7e7161c2cddd6644d278f0b2dd98ae8398d8a08ccddaa7889014830450221009562130ca434300a6244f0537bda7ceb3ae066ac7dea86e07fe1db4c58bd7a3f02207a1db015f325932523cf51f1b68866ba59f83dc1c569f1bb8aa8d9dc707c622b01006952210211ac0e98256ca976d23f2f07713b09fa202e06d75676f15ca50c25eedab7ebb121025d2762e6051dc727996a142d05431a8080dfbcab9dcea0f1ed8ad317b2d3ba432103d68c6be54f5bd46eaf54b2aa3310258e74dcfe73f546897854adec5442d2558553ae00000000

在 2019年6月26日星期三 UTC+8下午12:15:06,Nelson Perez写道:
Reply all
Reply to author
Forward
0 new messages