I've been really puzzled about how ScriptPubKey and standard transactions connect. They sound similar on the surface, but I'm not sure how they fit together.
ScriptPubKey is basically a set of rules for how Bitcoin can be spent, right? And standard transactions meet all the necessary criteria for validity? That's my take.
Yeah, exactly. ScriptPubKey is just a field that contains raw bytes of the script. But when it’s about ‘IsStandard()’, that’s a function checking if that script can be considered standard or not.
Non-standard transactions are just those that fall outside Bitcoin’s protocol rules. If something isn’t standard, it should generally be rejected by nodes.
For sure. The definition of non-standard is pretty flexible. If it's too big or doesn't follow certain rules, it's labeled as non-standard. But it doesn’t mean it’s invalid.
You can send directly to miners if you want, but normally, transactions go to the mempool first. Each node has its own mempool to filter valid transactions.