Author

Topic: Bitcoin pushTx fail - Non-canonical signature (Read 1173 times)

newbie
Activity: 4
Merit: 0
September 15, 2024, 01:59:09 AM
#5
link=topic=1356430.msg64521325#msg64521325 date=1726081985]
The signature is composed of two values, the r value and the s value.  In your third input, the s value is greater than N/2, which is not allowed.  Just add in some code that if s is greater than N/2, then s = N - s.

Change the third signature from

Code:
3046022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d0022100a1e3f5c6fa3ad96bcd32c72a66f007674f56ca3b09d88370f28dde3aa88d011901

to

Code:
3045022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d002205e1c0a3905c5269432cd38d5990ff8976b5812aba5701ccacd44805227a9402801

--------

Edit:  I fixed the transaction and broadcast it for you.  Here's the correct transaction with the lower s value:

Code:
0100000003caf0e05ef3f7d195bd7435115646500e64a15296757780b63d796a54bab0984e010000008a47304402204d144cfd31e9067a2527764969691c6a3907769f13aa77ef47cd0015190932680220424fdbc2b6f13e3ebb072510bb142f79eee52fd48761de9e7395b5f334f5fe0b014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffff0b8217e399dd102db81a714bdfbf1c4882adc8fdd630fa9cd694cf3c4a06d2d3000000008b483045022100b382b39a8411cb15ec5bd4e59fe6d158735d6eba56fcf7534e59a5c09088492d022007191d92cad52da1f7a6e630900aa62634cc013f081dd659053d37faca4aa2c0014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffffed976408d3b5fc7eb9a69611b978b9ee720d58265dfc37c80ffdfedc438bc676000000008b483045022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d002205e1c0a3905c5269432cd38d5990ff8976b5812aba5701ccacd44805227a94028014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffff02204e0000000000001976a914f1db8572433f9c06e1fc5d72a11674d5869c88cb88ac52370100000000001976a914ddcb1a55b031999e108df4a0bfa0fa23695aff9688ac00000000

with transaction ID

0b174b04b294f70be355b4ca86023153af65a3f99db79cb48dd2dc0abe206f9f

Hi luv2drnkbr i can't send priv message.I read that years ago you managed to fix a transaction hex that had a problem with high s value.
I have the same problem with broadcasting transaction becouse of high s value.

Code:
0100000001085c98b109ffa44c5bc5abab510ec66b579670356507ae29a0647d28eba9121c010000008c493046022100ac792f9d39b644835b9eabbeba9d48897385c721291267d07a850fbb07e5d9a1022100a552e1f28efb3dbd3ca6a360bc0e28f5cf0d73f4ba96202451be1129433a67b501410493249c6c4b75ce574e4f1ecc07117668f5ca7fd73ead514843ad4a9d4195c8f7b41662586dc61bcf920ef53031770afa183be244e88d6cc75d16de97f2da6d1dfeffffff02402c5480000000001976a9141f09fde9d6084a7ec3315bf32cf40809c6ea893688ac3c9085bf000000001976a914687ff91a13091d31303c1bd7d27f23b610d52ac488aca6210d00

Could you help me with broadcasting this transaction?
[/quote]
newbie
Activity: 4
Merit: 0
September 11, 2024, 02:13:05 PM
#4
The signature is composed of two values, the r value and the s value.  In your third input, the s value is greater than N/2, which is not allowed.  Just add in some code that if s is greater than N/2, then s = N - s.

Change the third signature from

Code:
3046022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d0022100a1e3f5c6fa3ad96bcd32c72a66f007674f56ca3b09d88370f28dde3aa88d011901

to

Code:
3045022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d002205e1c0a3905c5269432cd38d5990ff8976b5812aba5701ccacd44805227a9402801

--------

Edit:  I fixed the transaction and broadcast it for you.  Here's the correct transaction with the lower s value:

Code:
0100000003caf0e05ef3f7d195bd7435115646500e64a15296757780b63d796a54bab0984e010000008a47304402204d144cfd31e9067a2527764969691c6a3907769f13aa77ef47cd0015190932680220424fdbc2b6f13e3ebb072510bb142f79eee52fd48761de9e7395b5f334f5fe0b014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffff0b8217e399dd102db81a714bdfbf1c4882adc8fdd630fa9cd694cf3c4a06d2d3000000008b483045022100b382b39a8411cb15ec5bd4e59fe6d158735d6eba56fcf7534e59a5c09088492d022007191d92cad52da1f7a6e630900aa62634cc013f081dd659053d37faca4aa2c0014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffffed976408d3b5fc7eb9a69611b978b9ee720d58265dfc37c80ffdfedc438bc676000000008b483045022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d002205e1c0a3905c5269432cd38d5990ff8976b5812aba5701ccacd44805227a94028014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffff02204e0000000000001976a914f1db8572433f9c06e1fc5d72a11674d5869c88cb88ac52370100000000001976a914ddcb1a55b031999e108df4a0bfa0fa23695aff9688ac00000000

with transaction ID

0b174b04b294f70be355b4ca86023153af65a3f99db79cb48dd2dc0abe206f9f

Hi luv2drnkbr i can't send priv message.I read that years ago you managed to fix a transaction hex that had a problem with high s value.
I have the same problem with broadcasting transaction becouse of high s value.

Code:
0100000001085c98b109ffa44c5bc5abab510ec66b579670356507ae29a0647d28eba9121c010000008c493046022100ac792f9d39b644835b9eabbeba9d48897385c721291267d07a850fbb07e5d9a1022100a552e1f28efb3dbd3ca6a360bc0e28f5cf0d73f4ba96202451be1129433a67b501410493249c6c4b75ce574e4f1ecc07117668f5ca7fd73ead514843ad4a9d4195c8f7b41662586dc61bcf920ef53031770afa183be244e88d6cc75d16de97f2da6d1dfeffffff02402c5480000000001976a9141f09fde9d6084a7ec3315bf32cf40809c6ea893688ac3c9085bf000000001976a914687ff91a13091d31303c1bd7d27f23b610d52ac488aca6210d00

Could you help me with broadcasting this transaction?
hero member
Activity: 793
Merit: 1026
February 07, 2016, 09:50:31 PM
#3
The signature is composed of two values, the r value and the s value.  In your third input, the s value is greater than N/2, which is not allowed.  Just add in some code that if s is greater than N/2, then s = N - s.

Change the third signature from

Code:
3046022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d0022100a1e3f5c6fa3ad96bcd32c72a66f007674f56ca3b09d88370f28dde3aa88d011901

to

Code:
3045022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d002205e1c0a3905c5269432cd38d5990ff8976b5812aba5701ccacd44805227a9402801

--------

Edit:  I fixed the transaction and broadcast it for you.  Here's the correct transaction with the lower s value:

Code:
0100000003caf0e05ef3f7d195bd7435115646500e64a15296757780b63d796a54bab0984e010000008a47304402204d144cfd31e9067a2527764969691c6a3907769f13aa77ef47cd0015190932680220424fdbc2b6f13e3ebb072510bb142f79eee52fd48761de9e7395b5f334f5fe0b014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffff0b8217e399dd102db81a714bdfbf1c4882adc8fdd630fa9cd694cf3c4a06d2d3000000008b483045022100b382b39a8411cb15ec5bd4e59fe6d158735d6eba56fcf7534e59a5c09088492d022007191d92cad52da1f7a6e630900aa62634cc013f081dd659053d37faca4aa2c0014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffffed976408d3b5fc7eb9a69611b978b9ee720d58265dfc37c80ffdfedc438bc676000000008b483045022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d002205e1c0a3905c5269432cd38d5990ff8976b5812aba5701ccacd44805227a94028014104bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffdffffffff02204e0000000000001976a914f1db8572433f9c06e1fc5d72a11674d5869c88cb88ac52370100000000001976a914ddcb1a55b031999e108df4a0bfa0fa23695aff9688ac00000000

with transaction ID

0b174b04b294f70be355b4ca86023153af65a3f99db79cb48dd2dc0abe206f9f
sr. member
Activity: 412
Merit: 287
February 07, 2016, 04:08:24 PM
#2
The error is rather well documented - it leads to malleability so is forbidden by local node policy. It's probably a good idea to inform bitcoinjslib about this!
newbie
Activity: 1
Merit: 0
February 07, 2016, 01:05:42 PM
#1
Hello, we're trying to develop a way to push bitcoin transactions from scratch using the lib bitcoin.js

We've managed to successfully push some transactions, however some are failling, resulting on a blockchain.io error : "Non-canonical signature: High S Value"
Can someone explain what this error means ?

I paste here one of the failing decoded transactions :

{
  "txid": "a700ba0a3f3b0fb046b95f4666e174adda3b3eb66f99028eee4103ad3a2e98d1",
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "4e98b0ba546a793db68077759652a1640e504656113574bd95d1f7f35ee0f0ca",
      "vout": 1,
      "scriptSig": {
        "asm": "304402204d144cfd31e9067a2527764969691c6a3907769f13aa77ef47cd0015190932680220424 fdbc2b6f13e3ebb072510bb142f79eee52fd48761de9e7395b5f334f5fe0b01 04bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1 b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffd",
        "hex": "47304402204d144cfd31e9067a2527764969691c6a3907769f13aa77ef47cd00151909326802204 24fdbc2b6f13e3ebb072510bb142f79eee52fd48761de9e7395b5f334f5fe0b014104bfcb3a6d64 f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e73 e469d0e6d1a08cc829a1e46b05fc2a826b06ffd"
      },
      "sequence": 4294967295
    },
    {
      "txid": "d3d2064a3ccf94d69cfa30d6fdc8ad82481cbfdf4b711ab82d10dd99e317820b",
      "vout": 0,
      "scriptSig": {
        "asm": "3045022100b382b39a8411cb15ec5bd4e59fe6d158735d6eba56fcf7534e59a5c09088492d02200 7191d92cad52da1f7a6e630900aa62634cc013f081dd659053d37faca4aa2c001 04bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1 b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffd",
        "hex": "483045022100b382b39a8411cb15ec5bd4e59fe6d158735d6eba56fcf7534e59a5c09088492d022 007191d92cad52da1f7a6e630900aa62634cc013f081dd659053d37faca4aa2c0014104bfcb3a6d 64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a3866e 73e469d0e6d1a08cc829a1e46b05fc2a826b06ffd"
      },
      "sequence": 4294967295
    },
    {
      "txid": "76c68b43dcfefd0fc837fc5d26580d72eeb978b91196a6b97efcb5d3086497ed",
      "vout": 0,
      "scriptSig": {
        "asm": "3046022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d002210 0a1e3f5c6fa3ad96bcd32c72a66f007674f56ca3b09d88370f28dde3aa88d011901 04bfcb3a6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1 b024a3866e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffd",
        "hex": "493046022100fdd65dad87f8583d2fec6f9251cf8c4ba78063c036013fc5f17a77c58b6825d0022 100a1e3f5c6fa3ad96bcd32c72a66f007674f56ca3b09d88370f28dde3aa88d0119014104bfcb3a 6d64f87bd9b303eeb2cfa9140d930a133106ac99b4ca9f5ed23d72c1264276b1fbcc8a1b024a386 6e73e469d0e6d1a08cc829a1e46b05fc2a826b06ffd"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.0002,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 f1db8572433f9c06e1fc5d72a11674d5869c88cb OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914f1db8572433f9c06e1fc5d72a11674d5869c88cb88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1P3ppqXekCWxJQhp18XoYoA9nnZh5LuK9h"
        ]
      }
    },
    {
      "value": 0.00079698,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 ddcb1a55b031999e108df4a0bfa0fa23695aff96 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914ddcb1a55b031999e108df4a0bfa0fa23695aff9688ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1MDjeEJTX6ie1nZXwPhENpVGwUcD6PyU3K"
        ]
      }
    }
  ]
}


And some additional infos provided by blockr.io :
Additional info
Sum of inputs: 0.00109698
Sum of outputs: 0.00099698
Fee: 0.00010000

As you can see im not trying to spend more than i have on my address.
Its a transaction with some change going back to the exp address in order to not loose any coins.

I can show more decoded transactions if needed.

Thanks,
Simon
Jump to: