**SOLVED** Failed to verify this transaction?

2

I came across this P2SH multisig transactions 255942b1... on the testnet chain that I failed to verify.

I just couldn't find any matching signatures and public keys in the list provided and there seems to be an empty public key(OP_0 in the pub key script) given in the redeem script.

The scripts I found was

sig script:
OP_0 
3046022100a6ad0304388a4df35b444cb96ffee0b393700a6a8612f1e35cc3dc131314f893022100bcc8b2849b04dee59dcedc4fb21a96dda3fd067a381522f37a2b6813c4e1581d01
30450220371b8ee29370e0d23f547163e3c238a40fe279e8edb2b838811cfca7bf5778e0022100f7e81c88ff7ea1c8da2666cae90c6a3c73a6817070c657068c678254fdb0b3f501
520021039039f617d4bd3751bc0550d38e138e7ddd2042f2b137050c872e1be8df4d6aae2103a2b5af230018a36044a0638916829ed8cf6bf745a608fe6dd22ea266a7408e7e53ae

pub key script:
HASH160 bcce3f7e690e5f3bbd1ed6db54dc7317659fa87c EQUAL

redeem script:
2 OP_0
039039F617D4BD3751BC0550D38E138E7DDD2042F2B137050C872E1BE8DF4D6AAE 
03A2B5AF230018A36044A0638916829ED8CF6BF745A608FE6DD22EA266A7408E7E
3 OP_CHECKMULTISIG

signature msg:
54481C2DE6433EA934EB5F46B7E5D1A60FDC584873FC0210991C692058E26D4E

And my rebuilt tx for signing(same for both public keys) is

# version
01000000

01

# input 0
46CEA01182F6B49A49BA06C7BA4C7A95F66B0E5B5FD32B29E7BA2F1DF952E6B8 01000000

49

# sig script(now pkscript)
524C0021 039039F6 17D4BD37 51BC0550
D38E138E 7DDD2042 F2B13705 0C872E1B
E8DF4D6A AE2103A2 B5AF2300 18A36044
A0638916 829ED8CF 6BF745A6 08FE6DD2
2EA266A7 408E7E53 AE

FFFFFFFF

02

# output 0
E07CD50400000000
19
76A914ED99B585A4C7B1578A08C599BF7E87351FE3E78E88AC

# output 1
0C57060000000000
17
A914BCCE3F7E690E5F3BBD1ED6DB54DC7317659FA87C87

00000000
01000000

Could anyone please help me check this transaction? Thanks!

R. Lin

Posted 2018-03-10T13:55:15.987

Reputation: 120

1Transaction validity is identical between prodnet and testnet.Anonymous 2018-03-10T14:36:51.717

@eponymous I see... double checking now.R. Lin 2018-03-10T15:36:39.140

oh, you have edited the question, and removed the first part :-) On this second part, I'd like to know how you came to the sig message? The tx would have to be rebuilt, the sigscript removed, pkscript inserted and length updated. But which of the two outputs?pebwindkraft 2018-03-10T16:17:22.523

sorry about the editing... I realized that it was me putting the signature in the wrong order in the first tx... I edited the question to include my rebuilt tx for signing. I think I used the redeem script instead of pkscript.R. Lin 2018-03-11T00:37:55.787

@pebwindkraft ah... silly me, my program added an OP_PUSHDATA in the second byte of redeem script so the script is actually different from the original one... Sorry about the trouble. It's solved now.R. Lin 2018-03-11T00:45:35.580

1You can help the site by writing up your solution as an answer and marking it as accepted so that the question does not remain as "unanswered".Willtech 2018-03-11T00:49:41.040

Answers

1

I mistakenly added an OP_PUSHDATA(0x4c) before the second byte of the redeem script and got a wrong hash. The problem is solved...

R. Lin

Posted 2018-03-10T13:55:15.987

Reputation: 120

You're doing great. If this is the correct answer you can help by making it as accepted so that the question does not remain as "unanswered".Willtech 2018-03-11T01:12:16.107

I couldn't... It says "You can accept your own answer in 2 days".R. Lin 2018-03-11T01:20:56.157

Ahh, okay. Good work then, I haven't come across that.Willtech 2018-03-11T01:21:48.583

1Probably because of my low reputation haha.R. Lin 2018-03-11T01:30:16.617