Bitcoin Forum
September 13, 2025, 03:37:44 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why was this transaction validated?  (Read 134 times)
miquel1001 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 1


View Profile
May 10, 2025, 02:27:16 PM
Merited by stwenhao (1)
 #1

txid: b3e977a2c48145255d84e1c82d4ea07522528991d50ead1cf3a783559d9733e3

As can be seen, the r and s values of the signature are r = 0x52 and s = 0x53. It is simply impossible for them to have been derived from a k, which means the signature is invalid. How is it possible that a transaction with an invalid signature was able to be validated?

While looking for information about the transaction, I found a document mentioning that transactions like this were more costly to verify and therefore it was advisable not to allow them: https://gnusha.org/pi/bitcoindev/1577abe4a84.e9b9c8da3882.6224549273767153798@xbt.hk

This still doesn't explain why the transaction ended up being validated.
stwenhao
Hero Member
*****
Offline Offline

Activity: 492
Merit: 953


View Profile
May 10, 2025, 05:17:26 PM
Merited by vapourminer (6), hosemary (6), pooya87 (5), ABCbits (4), nc50lc (1)
 #2

Quote
How is it possible that a transaction with an invalid signature was able to be validated?
Because the Script required any invalid signature.

There are many things, which can be done by scripts: you can require a single key, multiple keys, or even no keys at all. Or: you can also require some valid signature, some invalid signature, some identical signature for the same public key, some different signature for the same key, or even some valid signature, which will take less than N bytes. There are a lot of options, probably much more, than people already tried.

Classically, you can have something like that: "<pubkey> OP_CHECKSIG". However, nothing stops you from doing "<pubkey> OP_CHECKSIG OP_NOT" instead, which would require any invalid signature, and will be strictly rejected, if you make a valid one. Or you can even use "OP_CHECKSIG" alone, and it would then require any valid key, with any valid signature. Or even "OP_CHECKSIG OP_NOT", to accept anything, what wouldn't pass through OP_CHECKSIG for various reasons.

Quote
transactions like this were more costly to verify and therefore it was advisable not to allow them
Yes, because using OP_CODESEPARATOR will enforce re-hashing transaction data. And even if producing some invalid signature is trivial, then validating it requires similar effort, as checking some valid one, because you have to be 100% sure, that nobody produced a matching signature.

And also, slow things can be combined. So, you can mix OP_CODESEPARATOR with OP_CHECKMULTISIG. And in case of Taproot, you can make even more tricky cases, like "OP_SHA256 OP_CHECKSIG OP_NOT", which would hash your message, use it as x-value of your public key, and make sure, that it won't pass Schnorr signature verification.

Proof of Work puzzle in mainnet and testnet4.
miquel1001 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 1


View Profile
May 10, 2025, 07:12:52 PM
 #3

Quote
How is it possible that a transaction with an invalid signature was able to be validated?
Because the Script required any invalid signature.

There are many things, which can be done by scripts: you can require a single key, multiple keys, or even no keys at all. Or: you can also require some valid signature, some invalid signature, some identical signature for the same public key, some different signature for the same key, or even some valid signature, which will take less than N bytes. There are a lot of options, probably much more, than people already tried.

Classically, you can have something like that: "<pubkey> OP_CHECKSIG". However, nothing stops you from doing "<pubkey> OP_CHECKSIG OP_NOT" instead, which would require any invalid signature, and will be strictly rejected, if you make a valid one. Or you can even use "OP_CHECKSIG" alone, and it would then require any valid key, with any valid signature. Or even "OP_CHECKSIG OP_NOT", to accept anything, what wouldn't pass through OP_CHECKSIG for various reasons.

Quote
transactions like this were more costly to verify and therefore it was advisable not to allow them
Yes, because using OP_CODESEPARATOR will enforce re-hashing transaction data. And even if producing some invalid signature is trivial, then validating it requires similar effort, as checking some valid one, because you have to be 100% sure, that nobody produced a matching signature.

And also, slow things can be combined. So, you can mix OP_CODESEPARATOR with OP_CHECKMULTISIG. And in case of Taproot, you can make even more tricky cases, like "OP_SHA256 OP_CHECKSIG OP_NOT", which would hash your message, use it as x-value of your public key, and make sure, that it won't pass Schnorr signature verification.

I hadn't realized that it was the Bitcoin scripting opcodes that explicitly required an invalid signature. Thank you so much for your response Smiley
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!