Clearing Up ScriptPubKey and Standard Transactions Confusion

12 replies 459 views
Posts: 252 · Reputation: 12
#1Oct 5, 2017, 03:43 AM
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.
10 Reply Quote Share
0xLaserFull Member
Posts: 252 · Reputation: 641
#2Oct 5, 2017, 07:40 AM
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.
17 Reply Quote Share
lonealphaNewbie
Posts: 287 · Reputation: 5
#3Oct 5, 2017, 10:25 AM
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.
7 Reply Quote Share
gang2015Member
Posts: 693 · Reputation: 62
#4Oct 5, 2017, 09:12 PM
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.
8 Reply Quote Share
0xLaserFull Member
Posts: 252 · Reputation: 641
#5Oct 7, 2017, 01:29 PM
But like, non-standard can still be valid, yeah? I mean, there are cases where miners have still accepted them.
6 Reply Quote Share
Posts: 252 · Reputation: 12
#6Oct 8, 2017, 07:23 PM
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.
8 Reply Quote Share
0xChadNewbie
Posts: 514 · Reputation: 3
#7Oct 10, 2017, 10:25 PM
More like guidelines, I guess. I remember transactions being flagged if they exceed 100 vKB or 400,000 weight units.
10 Reply Quote Share
0xLaserFull Member
Posts: 252 · Reputation: 641
#8Oct 12, 2017, 11:56 PM
So, you're saying it’s all about how the majority of nodes perceive a transaction? That's interesting.
10 Reply Quote Share
mr_apeNewbie
Posts: 407 · Reputation: 35
#9Oct 13, 2017, 06:09 AM
Exactly! Some things like uncompressed public keys are valid but still get hit with the non-standard label. It's all about efficiency in block space.
7 Reply Quote Share
0xNodeMember
Posts: 680 · Reputation: 80
#10Oct 13, 2017, 10:27 AM
I see. So the ScriptPubKey acts like a little programming script, pushing and popping values from a stack, depending on the transaction type.
5 Reply Quote Share
Posts: 252 · Reputation: 12
#11Oct 14, 2017, 09:34 AM
So, about non-standard ones, is it a community-wide thing not to include them in blocks? I read somewhere that these get sent directly to miners.
4 Reply Quote Share
mr_apeNewbie
Posts: 407 · Reputation: 35
#12Oct 14, 2017, 01:14 PM
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.
5 Reply Quote Share
Posts: 3546 · Reputation: 35
#13Oct 14, 2017, 06:51 PM
It’s pretty wild how all this works. I’m still trying to wrap my head around who decides what goes where!
4 Reply Quote Share

Related topics