What is Nostr?
Gavin Andresen [ARCHIVE] /
npub1s4lā€¦44kw
2023-06-07 02:29:19
in reply to nevent1qā€¦d5wy

Gavin Andresen [ARCHIVE] on Nostr: šŸ“… Original date posted:2011-09-26 šŸ—’ļø Summary of this message: A transaction ...

šŸ“… Original date posted:2011-09-26
šŸ—’ļø Summary of this message: A transaction with "non-standard" sig op count is allowed in blocks but not accepted by mainline rules, causing potential DoS attacks.
šŸ“ Original message:> The first one I was referring to is a *transaction* with "non-standard" sig op
> count, which is AFAIK allowed in blocks, just not accepted by the mainline
> rules.

I sit corrected. The context is:
// Checking ECDSA signatures is a CPU bottleneck, so to avoid
denial-of-service
// attacks disallow transactions with more than one SigOp per 34
bytes.
// 34 bytes because a TxOut is:
// 20-byte address + 8 byte bitcoin amount + 5 bytes of ops + 1
byte script length
if (GetSigOpCount() > nSize / 34 || nSize < 100)
return DoS(10, error("AcceptToMemoryPool() : transaction with
out-of-bounds SigOpCount"));

I'm having trouble imagining some future world where valid,
new-versions-agree-to-relay-transactions have more than one SigOp per
34 bytes; can you give an example?

> Maybe the person spending it sees it matured beyond 100 confirmations, and you
> only see 99. An attacker could use these things to get nodes to ban each
> other.

That would imply you're on a blockchain fork of more than 99 blocks
with respect to the person spending the transaction, in which case I'd
argue you have much bigger problems and it is a good idea for the DoS
code to kick in and kick either you or them off the network...

--
--
Gavin Andresen
Author Public Key
npub1s4lj77xuzcu7wy04afcr487f0r3za0f8n2775xrpkld2sv639mjqsd44kw