Bitcoin Forum
May 07, 2024, 05:21:56 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help: Unserendipitous Multisig Transaction  (Read 1239 times)
greaterhongkong (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
April 13, 2015, 09:06:09 PM
 #1

Please forgive for my English. I have manual transaction receive error:

64: non-mandatory-script-verify-flag (No error) (code -26)

Transaction:

Code:
0100000002c80e4cab53d77932329f13991c8dcecac332ec96a4e48e77c874dfb7cf24833b01000000fdfd0000483045022100bc0e789a6b8a42062ac62cfe81b3593d515f7d6407d50dcda82c095b83403d77022000a601b727ef3141c344072b51b96a5a52064e079eb76ffd62044e80406799dd01473044022021efaa0b875a691eb9d279619443f74fc6b50b349e4e2f98a3ce8f2fbb8658d702204d18d4ba03f4f29a8d10d66ba6ba2602e68aca6a6ea1d0aad0b7f92161068e6f014c69522102c1d7b4cd3d3eaa7f78273821f837a2d050b3982d684b8d7c530203cbb5fa7de6210349d8034876a8528fafb5424ea482cac1212b585e670127b889ad9c7ac993ed262103b6f776158f58011ecea29fedf175f11410f6b08761cc72b0efe2250c5e4fe10a53aeffffffff9d3bb1c83e30c5b2976832759008f0dd9f1679c51e896bcc44d563e0ed1a177100000000fdfd00004730440220521baa167e46b7ee8a5a1194ba8ec9a27b26aa3df2b9e2f68a229770becddbbb02200003fa03e29a0ab057533f0a2f11c36695456199b8feb0f4c0ffbeea312b9d9d01483045022100dad1b9377e5a43fe7228b6148b11a1e6ef2eeae2c18a4655f8eeaeff949d359002205bf15d581924eeefa7d963782906fded242d36b6d6330eec2baed37e9a105dba014c69522102c1d7b4cd3d3eaa7f78273821f837a2d050b3982d684b8d7c530203cbb5fa7de6210349d8034876a8528fafb5424ea482cac1212b585e670127b889ad9c7ac993ed262103b6f776158f58011ecea29fedf175f11410f6b08761cc72b0efe2250c5e4fe10a53aeffffffff0368180700000000001976a9144fe1deb3351ae4832a11920a59bce71f862f5c8b88aca8610000000000001976a914fa8cfcebce094a1ac169cff48c2f814a29151cbf88ac400d0300000000001976a91473a7d47fbaf28daba0799e5780b6035f99cfcb2c88ac00000000

K number enters being from RFC-6979, S number always the lesser than (N/2).  My mind inquires that problem exists from S number beginning "00".  Are the probability for my mind's explanation vastly probable?

How to alter signature to make happy propogate network?
1715102516
Hero Member
*
Offline Offline

Posts: 1715102516

View Profile Personal Message (Offline)

Ignore
1715102516
Reply with quote  #2

1715102516
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715102516
Hero Member
*
Offline Offline

Posts: 1715102516

View Profile Personal Message (Offline)

Ignore
1715102516
Reply with quote  #2

1715102516
Report to moderator
1715102516
Hero Member
*
Offline Offline

Posts: 1715102516

View Profile Personal Message (Offline)

Ignore
1715102516
Reply with quote  #2

1715102516
Report to moderator
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
April 13, 2015, 09:32:14 PM
Last edit: April 13, 2015, 09:52:50 PM by amaclin
 #2

https://blockchain.info/tx/437fd815857b77a2adf1b5607576386fe4b8f962942dec04015cb910b0b63956

01000000
02
c80e4cab53d77932329f13991c8dcecac332ec96a4e48e77c874dfb7cf24833b
01000000

fdfd00
00
48
  30450221 00bc0e789a6b8a42062ac62cfe81b3593d515f7d6407d50dcda82c095b83403d77
      0220   00a601b727ef3141c344072b51b96a5a52064e079eb76ffd62044e80406799dd 01
47
  30440220   21efaa0b875a691eb9d279619443f74fc6b50b349e4e2f98a3ce8f2fbb8658d7
      0220   4d18d4ba03f4f29a8d10d66ba6ba2602e68aca6a6ea1d0aad0b7f92161068e6f 01
4c69
  52
    2102c1d7b4cd3d3eaa7f78273821f837a2d050b3982d684b8d7c530203cbb5fa7de6
    210349d8034876a8528fafb5424ea482cac1212b585e670127b889ad9c7ac993ed26
    2103b6f776158f58011ecea29fedf175f11410f6b08761cc72b0efe2250c5e4fe10a
  53ae
ffffffff

9d3bb1c83e30c5b2976832759008f0dd9f1679c51e896bcc44d563e0ed1a1771
00000000

fdfd00
00
47
  30440220   521baa167e46b7ee8a5a1194ba8ec9a27b26aa3df2b9e2f68a229770becddbbb
      0220   0003fa03e29a0ab057533f0a2f11c36695456199b8feb0f4c0ffbeea312b9d9d 01
48
  30450221 00dad1b9377e5a43fe7228b6148b11a1e6ef2eeae2c18a4655f8eeaeff949d3590
      0220   5bf15d581924eeefa7d963782906fded242d36b6d6330eec2baed37e9a105dba 01
4c69
  52
    2102c1d7b4cd3d3eaa7f78273821f837a2d050b3982d684b8d7c530203cbb5fa7de6
    210349d8034876a8528fafb5424ea482cac1212b585e670127b889ad9c7ac993ed26
    2103b6f776158f58011ecea29fedf175f11410f6b08761cc72b0efe2250c5e4fe10a
  53ae
ffffffff

03
6818070000000000
1976a9144fe1deb3351ae4832a11920a59bce71f862f5c8b88ac
a861000000000000
1976a914fa8cfcebce094a1ac169cff48c2f814a29151cbf88ac
400d030000000000
1976a91473a7d47fbaf28daba0799e5780b6035f99cfcb2c88ac
00000000

One signature marked blue has invalid der-encoding
1) instead of 02200003 should be 021F03
2) after changing it you should also change der length 44 to 43
3) also change push length 47 to 46
4) also change scriptSig length fdfd00 to fc
greaterhongkong (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
April 13, 2015, 09:51:38 PM
 #3

Thank you for help to investigate!

What to replace with blue zeros?  Number opposite has height beyond (N/2) correct?  How does number fix?

Perhaps K number to be random and not to be RFC-6979 and make signature all over is solely the method of harmonous reconstruction.  Does your mind present alternatives?


The addition of your green bottom numbers provides solution!  Thank you!
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
April 13, 2015, 09:57:06 PM
 #4

What to replace with blue zeros?  Number opposite has height beyond (N/2) correct?  How does number fix?
No. This is a number
0x03fa03e29a0ab057533f0a2f11c36695456199b8feb0f4c0ffbeea312b9d9d
You should not use any zeroes at the head of if, because it is positive number
There are only 31 bytes in this number, not 32
So, we encode S-prefix as 021F (1F stands for 32decimal)


Quote
Perhaps K number to be random and not to be RFC-6979 and make signature all over is solely the method of harmonous reconstruction.  Does your mind present alternatives?
K does not matter here
greaterhongkong (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
April 13, 2015, 10:00:19 PM
 #5

S number the first is also of beginning "00".  What reason is there for S value the first to stay unaltered?
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
April 13, 2015, 10:08:54 PM
 #6

S number the first is also of beginning "00".  What reason is there for S value the first to stay unaltered?
I can not explain this  Grin Grin Grin Grin Grin Grin
Read standards yourself.

DER-encoded integers in bitcoin signatures
must be positive, so they can not start with 8,9,a...f
if you have such value - you must append zero byte in front

But
you must also check that there are no extra zero-bytes in front of positive integers


Example from your transaction:

0xbc0e789a6b8a42062ac62cfe81b3593d515f7d6407d50dcda82c095b83403d77
this is negative number
you must convert it to positive adding zero at front
So, der-encoding will be 0221 00bc0e789a6b8a42062ac62cfe81b3593d515f7d6407d50dcda82c095b83403d77

0x21efaa0b875a691eb9d279619443f74fc6b50b349e4e2f98a3ce8f2fbb8658d7
this is positive number
der-encoding is 0220 21efaa0b875a691eb9d279619443f74fc6b50b349e4e2f98a3ce8f2fbb8658d7

0x0003fa03e29a0ab057533f0a2f11c36695456199b8feb0f4c0ffbeea312b9d9d
this is positive number with a zero in the head
remove zero
0x03fa03e29a0ab057533f0a2f11c36695456199b8feb0f4c0ffbeea312b9d9d
this is the same number
der-encoding is 021F 03fa03e29a0ab057533f0a2f11c36695456199b8feb0f4c0ffbeea312b9d9d





greaterhongkong (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
April 13, 2015, 10:11:30 PM
 #7

Thank you for the quantity of time you have commited for my mind!
greaterhongkong (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
April 15, 2015, 12:01:53 AM
 #8

I have discovered a vast explanation for the mysteries of the schematics for DER encoding. Thanks with your help, I am in full possession of the knowledge to make flawless multisig transactions occur. It is exciting!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!