Author

Topic: Purpose of IsStandard (Read 1344 times)

hero member
Activity: 555
Merit: 654
July 11, 2012, 10:28:01 AM
#6
When I analyzed and found the DoS vulnerabilities in 0.6.2, I remember having also found potential DoS vectors that were prevented by the IsStandard() check. The attack surface is a lot greater if the check is absent, so I think the check is completely necessary right now.

legendary
Activity: 1526
Merit: 1134
July 11, 2012, 03:58:13 AM
#5
It raises the difficulty of doing things like flooding the network with ultra-expensive transactions and hitting other weird unexpected edge cases. It's not the case that the only bugs you need to consider are "see tx in block -> crash".
legendary
Activity: 1372
Merit: 1008
1davout
July 06, 2012, 02:35:12 PM
#4
There is a reason that the quote function creates a back link.  Context would be useful.

[...]

Eventually IsStandard will likely go away but I don't see any rush.  Bitcoin is BETA v0.6.x right now.  Having sanity checks in place is a good idea.  The codebase is still very young and portions of it cumbersome which makes producing bug free updates more difficult.
Wrong.

IsStandard is not a sanity check, it's a DOS protection.
A transaction is either valid or not, it has nothing to do with being "standard" in the IsStandard check semantics.
newbie
Activity: 19
Merit: 0
July 06, 2012, 08:56:24 AM
#3
I can't hit quote on threads I can't post in, so I used copy&paste for quoting. I've added a link.

My point is that the sanity check is at a point where it doesn't really help. Clients will receive non standard transactions once they're in the block-chain. So I don't see how IsStandard protects them from bugs in handling non-standard transactions.
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 06, 2012, 08:46:52 AM
#2
There is a reason that the quote function creates a back link.  Context would be useful.

The network "could" probably operate just fine without the IsStandard check BUT IsStandard is a sanity check of sort.  Bitcoin is complex, very complex and the number of people who understand it completely is probably less than ten (I would argue it is zero).  Bugs and unanticipated side effects are rare but do happen.  

IsStandard provides the ability to unit test at least "standard transactions" (a definition which is continually evolving).  If a non-standard transaction can be clearly defined and gains popularity it can be added to the IsStandard check in future versions.  

The purpose of not relaying standard transactions is to limit the effect of unpatched clients on the network.  Pools, miners, major exchanges/merchants/service providers, and developers tend to be good at upgrading to patch vulnerabilities.  Many "casual users" tend to be very bad (look at the version breakdown charts if you need proof).  By making default action to not relay non-standard transactions the threat from these unpatched nodes is reduced.

Eventually IsStandard will likely go away but I don't see any rush.  Bitcoin is BETA v0.6.x right now.  Having sanity checks in place is a good idea.  The codebase is still very young and portions of it cumbersome which makes producing bug free updates more difficult.
newbie
Activity: 19
Merit: 0
July 06, 2012, 08:03:25 AM
#1
My understanding of `IsStandard` is that non standard transactions:

* are considered valid when they're part of the block-chain.
* don't get relayed, and many miners won't mine them.

See https://en.bitcoin.it/wiki/Nonstandard_block

This means that clients must be able to handle non standard blocks correctly, and bugs in the handling of non standard transactions are still problematic. So see no security gain, and it doesn't simplify clients either.

Quote from: Gavin
You're right, I think even without blockexplorer Satoshi would've added the IsStandard() check.  There were a series of "oops, didn't think of that" moments that pushed him to disable a bunch, tighten up some requirements on existing opcodes, and add IsStandard().

In general, I believe in "whitelisting" instead of "blacklisting" to try to prevent harm. Enable functionality that you can prove (or convince yourself beyond a reasonable doubt) will not cause problems. I'm strongly influenced from watching web content systems that fail repeatedly trying to detect malicious HTML or CSS.
https://bitcointalksearch.org/topic/m.476436
I don't understand this quote. Since those block can and do occasionally occur in the blockchain, what is the security gain he's talking about?

So what's the purpose of `IsStandard`? It hinders innovation at no gain I can see.
Jump to: