Bitcoin Forum
October 27, 2026, 02:46:59 AM *
News: Latest Bitcoin Core release: 31.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: non-standard CHECKMULTISIG usage  (Read 175 times)
amaclin1 (OP)
Hero Member
*****
Offline

Activity: 1582
Merit: 549


View Profile
October 05, 2026, 01:34:45 PM
Merited by d5000 (1), nc50lc (1)
 #1

Have a look  Grin
https://mempool.space/tx/5482617024fb1aedcd29828547d5e169d5be28261468a6df9066cfdd5886e780
(I am not a sender/receiver of it)
Clearnet
Newbie
*
Offline

Activity: 23
Merit: 0


View Profile
October 05, 2026, 01:42:38 PM
 #2

Would you please elaborate on what it means?
achow101
Moderator
Legendary
*
expert
Offline

Activity: 4018
Merit: 7862


Just writing some code


View Profile WWW
October 05, 2026, 07:01:27 PM
Merited by ABCbits (5), d5000 (3)
 #3

For those wondering, the inputs have a witness stack of

Code:
00
3044022055fd9cf5b3fecff35bf3a4fcc517fa7e781d5411b5624a8c6ee12a47f34d90dd02203b829b7b700a2a59349b9d137a25e46be5df3104e2f14748f0c18f64b3f9092701
304502210095813f6a74f44a5fafac59b4d1616e79e64c1b18286357588b37c082b385b30602200a99e7d47286442e10ed83610020fcc3ee787f449d2fe4a82acfeaea9cb05efe01
02
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
522103416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a62103157e46f7e48d3aa5440a478ddb2c040dcaa5ecf061e820cccbf8763eabb697632102eb3b6b93f6dfdebea68febac071422a94a0fddf3727ebc50fe29906c14c25cb65fae

The witness script decodes to

Code:
OP_2 03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6 03157e46f7e48d3aa5440a478ddb2c040dcaa5ecf061e820cccbf8763eabb69763 02eb3b6b93f6dfdebea68febac071422a94a0fddf3727ebc50fe29906c14c25cb6 OP_15 OP_CHECKMULTISIG

This is an interesting anyone can spend construction. Presumably it must have been done on purpose as it would be rather difficult to guess the correct witness script. But why?

amaclin1 (OP)
Hero Member
*****
Offline

Activity: 1582
Merit: 549


View Profile
October 08, 2026, 11:31:46 AM
 #4

The witness script decodes to
No.
It decodes to

OP_2
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
02                                                  <---- this is not a pubkey but the script passed
03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
03157e46f7e48d3aa5440a478ddb2c040dcaa5ecf061e820cccbf8763eabb69763
02eb3b6b93f6dfdebea68febac071422a94a0fddf3727ebc50fe29906c14c25cb6
OP_15
OP_CHECKMULTISIG
athanred
Full Member
***
Offline

Activity: 207
Merit: 387


View Profile
October 08, 2026, 12:19:26 PM
Last edit: October 08, 2026, 01:07:10 PM by athanred
Merited by nc50lc (1)
 #5

Quote
this is not a pubkey but the script passed
So what? It is 2-of-15, which means only two keys needs to be valid. But in case of this particular Script, it could be 0-of-15 as well.

Another example of 0-of-1 multisig, which doesn't seem like it, when you first look at the Script: https://mempool.space/address/37iy592iNBLTPyF4y2iyxpacHsbvV48ZyZ

See? If you have "OP_1 OP_1 OP_CHECKMULTISIG", then you would think it is a 1-of-1 multisig with no keys. But this interpretation is wrong: it is anything-of-1 multisig, with the last public key being invalid, and set to "OP_1". And anyone can put "OP_0", and make it valid: https://mempool.space/tx/7521d8bd0ffabd75de220d5b8f343e462076769498902784d17af5c9fa4015f4

Edit:
Quote
But why?
Because someone wanted to make 2-of-3 multisig, and made anything-of-15 instead. Which can be easily seen, if you notice, where coins went:
Code:
OP_PUSHNUM_2
OP_PUSHBYTES_33 03416299921f66491349cf663df1da76e8aa7866f00c31578182a5ab7ca15a67a6
OP_PUSHBYTES_33 03157e46f7e48d3aa5440a478ddb2c040dcaa5ecf061e820cccbf8763eabb69763
OP_PUSHBYTES_33 02eb3b6b93f6dfdebea68febac071422a94a0fddf3727ebc50fe29906c14c25cb6
OP_PUSHNUM_3
OP_CHECKMULTISIG
See? Someone intended to use bc1qyuvla6uqhdfs3w807aqzuuw0l8z4xrn4u98ecpqmueq5fv7463zsnw86wj, but by replacing OP_3 with OP_15, ended up with bc1qac7ra58m8qjv5u30xs26wucdvnpwdzzap08yv8dpyllaj04nfv5q26eklz. Fortunately, it was moved by the rightful owner, which was not the case in some other weak scripts, where someone probably intended to make an inscription, but forgot about OP_0 before OP_IF, and it was moved without any signatures.

Quote
Presumably it must have been done on purpose as it would be rather difficult to guess the correct witness script.
Well, the owner was probably lucky. By knowing this transaction, someone could replace OP_3 with OP_15, and steal these coins, by making 0-of-15 signature, or using some custom keys. Usually, coins like that are either unspendable, or spendable by anyone, but it seems the rightful owner acted before others noticed.
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!