Post
Topic
Board Development & Technical Discussion
Re: Error: Script was NOT verified successfully.
by
NotATether
on 20/01/2024, 05:01:58 UTC
I see they haven't spent it yet.
Here are some things to check:
Code:
prevHash: c53efc1e8592cbe103c732a1dae6f94c339a529190ee1ee9ee3699fa9f711c96
prevId:   0
prevValue:1.00651112
prevPk:   0014f185700cc698b3732dce291550a5343ddf241fda
SigHash:  908eb3dc1eeb3bbe81a8c9a021ef1d5c18099c89bd05a2820c645bd6341001d1
SigR:     009ce0f2e09109b7890329813d62feac316183287c1da9e06c4119d8c49fb5388f
SigS:     1ed7a92550c11a8ab4c7025c0f4371fd1039d7f46b0842fa78f424df3f2d7fd4
PubKey:   038b0254d8b428b0516b9337ce48f7549eb429637c8fa445ee7594eda21c511762
The signature is NOT correct!
Check the SigHash first!

before SigHash:
Code:
SigHash = SHA256²(01000000e32ee50d3590001a0ecaf1230d7da066bccf1fedd4d3522bcc04468dbd505fb08f64b0c3a7d964081e85a1401845112be7ea0c37947b7e57a9dc74a20ff19dc2961c719ffa9936eee91eee9091529a334cf9e6daa132c703e1cb92851efc3ec5000000001976a914f185700cc698b3732dce291550a5343ddf241fda88ac68d0ff0500000000000000802d8ec028e17bdc13acf29fd0776da8d5eea92844f6885d6c91ade88005fc60c80000000001000000)

That's not good.

I realized that I was not double hashing the outpoints list before putting them in the sighash, but I still get an error.

Sighash for a new transaction (before signing):

0100000046111bba17bad101669337a4c13f11953520347f16e5757949e9bebf52d01a068f64b0c 3a7d964081e85a1401845112be7ea0c37947b7e57a9dc74a20ff19dc294dabca706fe011969ea96 490924a40e961d7573af034d28513718d6b9dccc2f0000000076a91480f785495c8f30a13402ca3 37b21f6d5c65fb0f688acfacfff05000000000000008055c6c38707420170e30c334bcc539feec4 e469bdab6711dddff92ef11e97ba3c0000000001000000

Version is 1, hashPrevouts (before double hashing) is 94dabca706fe011969ea96490924a40e961d7573af034d28513718d6b9dccc2f00000000 [i.e. the input is txid 94dabca..., #0]

hashSequence is 00000080 (note: It is not 0xffffffff because I want to use RBF, but it should mean that timelocks are not enabled)

hashOutputs is 021027000000000000160014c2229d66eeff61900b4678b23853e0a8502df56a000000000000000 0160014c2229d66eeff61900b4678b23853e0a8502df56a (the single output of this transaction along with script pubkey)

The script added (directly without hashing is 76a91480f785495c8f30a13402ca337b21f6d5c65fb0f688ac - P2PKH script, since I was told that P2WPKH UTXOs requie this

Locktime is 00000000 and sighash type is SIGHASH_ALL ie 01000000.

Sorry for the really long output, I'm really confused here to be honest Sad