Author

Topic: Transaction problem with converting a high-S value to a low-S value (Read 63 times)

newbie
Activity: 4
Merit: 0
Thank You BitMaxz and pooya87 for your replays.

To clarify, I am not the creator of the transaction or the owner of the wallet, but the recipient of the transaction.

I've looked through all the topics with similar problems, probably I'm making a mistake by adding the s-value manually, because I have no idea about how to do it correctly.

In this post https://bitcointalksearch.org/topic/bitcoin-pushtx-fail-non-canonical-signature-1356430, user luv2drnkbr corrected and broadcasted this transaction by having only hex. I'm following this but I'm not sure if I did everything right, but since I don't have access to wallet, I assume this is my only hope.

Assuming I calculated the low-S value correctly, what should I do to add it to the hex properly?

BTW.
I'm also considering the possibility that I was scammed... any help figuring this out would be greatly appreciated.

legendary
Activity: 3472
Merit: 10611
In ECDSA when you create a signature (r,s) using your private key, the (r,-s) signature is also a valid signature and anybody can compute -s without needing your private key.
That creates a malleability issue. Meaning any node receiving your transaction can just negate the s value in your signature(s) and create a malleated transaction that would also have a different transaction ID for legacy transactions.

To prevent that, the nodes only accept one of the two equivalent "s" values that is considered a "low s" meaning a value that is lower than half the curve order and reject the other one with the error message you saw.

So whenever you sign a transaction, you just need to check your final s value and if it were bigger than N/2 you simply negate it.
Code:
s ≡ -s ≡ N - s (mod N)
legendary
Activity: 3374
Merit: 3095
BTC price road to $80k
I'm not familiar with the error code is this from openssl when broadcasting a transaction?

I tried to search a bit and I found a similar issue but the error code is different. I tried to search here on the forum and  I found a similar error code he fixed the issue so it might also work for you check the post from this link below

- https://bitcointalksearch.org/topic/m.53958884
newbie
Activity: 4
Merit: 0
I created a bitcoin transaction but I'm getting an error when trying to broadcast it:

mandatory-script-verify-flag-failed (Non-canonical signature: S value is unnecessarily high) (code 16)


HEX-WITH-HIGH-S

Code:
0100000001fe84d378379a44b5751e89f5145916abe2ec18c03735ad811fc656a34628dd22000000008c493046022100ac792f9d39b644835b9eabbeba9d48897385c721291267d07a850fbb07e5d9a1022100a552e1f28efb3dbd3ca6a360bc0e28f5cf0d73f4ba96202451be1129433a67b501410493249c6c4b75ce574e4f1ecc07117668f5ca7fd73ead514843ad4a9d4195c8f7b41662586dc61bcf920ef53031770afa183be244e88d6cc75d16de97f2da6d1dfeffffff02006d7c4d00000000160014bce56fa1231ff207fee8c421060faeb08f47813cf09c8a29000000001976a914687ff91a13091d31303c1bd7d27f23b610d52ac488ace2220d00

I googled it and seems the problem is that S value in ScriptSig is High. I probably found a working method to convert my High-S value
Code:
a552e1f28efb3dbd3ca6a360bc0e28f5cf0d73f4ba96202451be1129433a67b501
to Low-s value
Code:
aad1e0d7104c242c3595c9f43f1d708eba168f1f4b280176e144d638cfbd98c01
, but im not sure does it implement it well, because it still doesn't work.


HEX-WITH-LOW-S

Code:
0100000001fe84d378379a44b5751e89f5145916abe2ec18c03735ad811fc656a34628dd22000000008c493046022100ac792f9d39b644835b9eabbeba9d48897385c721291267d07a850fbb07e5d9a1022100a552e1f28efb3dbd3ca6a360bc0e28f5cf0d73f4ba96202451be1129433a67b501410493249c6c4b75ce574e4f1ecc07117668f5ca7fd73ead514843ad4a9d4195c8f7b41662586dc61bcf920ef53031770afa183be244e88d6cc75d16de97f2da6d1dfeffffff02006d7c4d00000000160014bce56fa1231ff207fee8c421060faeb08f47813cf09c8a29000000001976a914687ff91a13091d31303c1bd7d27f23b610d52ac488ace2220d00

Could someone help me with that? Any help would be appreciated.

Jump to: