> I think we would want to have a cleanstack rule at some point
Ah is this a rule where a script shouldn't validate if more than just a true is left on the stack? I can see how that would prevent the non-soft-fork version of what I'm proposing.
> How large is the critical mass needed?
Well it seems we've agreed that were we going to do this, we would want to at least do a soft-fork to make known jet scripts lighter weight (and unknown jet scripts not-heavier) than their non-jet counterparts. So given a situation where this soft fork happens, and someone wants to implement a new jet, how much critical mass would be needed for the network to get some benefit from the jet? Well, the absolute minimum for some benefit to happen is that two nodes that support that jet are connected. In such a case, one node can send that jet scripted transaction along without sending the data of what the jet stands for. The jet itself is pretty small, like 2 or so bytes. So that does impose a small additional cost on nodes that don't support a jet. For 100,000 nodes, that means 200,000 bytes of transmission would need to be saved for a jet to break even. So if the jet stands for a 22 byte script, it would break even when 10% of the network supported it. If the jet stood for a 102 byte script, it would break even when 2% of the network supported it. So
how much critical mass is necessary for it to be worth it depends on what the script is.
>
Than using a dynamic lookup table, which is how I understood your previous email about "scripts in the 1000 past blocks".
Ah, I didn't mean using a dynamic lookup. This was about the idea of jet registration, where registered jets would be kept a count of for some number of blocks (eg 1000) and dropped if they don't reach a threshold rate of usage. A static lookup table would work for this, I agree.
> It would have to validate as well that the SCRIPT sub-section matches the jet
Seems like a good idea.
> Adler32 seems a bit short though
You might be right. Certainly some more care would need to be taken in an actual implementation than I've taken writing my back of the napkin idea out ; )
> nothing prevents anyone from using a different SCRIPT subsection for a particular Adler32 hash if they find a collision and can somehow convince people to run their modified software.
Someone that can convince people to run their modified software can *always* cause those people to chainsplit from the main chain, so I don't think the above ideas are special in this regard.
>> it might not be worth doing it this way without a soft fork
> Which is why I pointed out that each individual jet may very well require a softfork, or enough buy-in that you might as well just softfork.
I'm saying something rather different actually. I don't think each individual jet requires a softfork to be quite useful. What I meant by "it might not be worth doing it this way without a soft fork" is that we probably want to implement a soft fork to allow all jet scripts to have reduced blockweight. However, once most nodes support that soft fork, new individual jets do not need a softfork for the network to take advantage of them. As I mused about above, even 10% of the network supporting a jet standin for a medium length script could result in significant network bandwidth savings. Different sections of the network could decide individually what jets they want to support without needing the usual chaos of a soft fork for each one, but of course the more the better for a popular jet. There would be benefits for eventually soft forking such jets in (to make them weigh even less based on implementation of optimized validation functions), and real life usage of those jets could inform the decisions around them. They could already be well tested in the wild before being upgraded in a softfork.
> Yes, but that implies additional operations (and execution overhead), increasing the costs to use jets, which makes it even less palatable to use jets, *in addition to* the witness hack disincentivizing jets.
For the use of a single jet, this can be completely solved by that jet. All the additional operations you're talking about only need to happen in a general bitcoin script evaluator. But a jet evaluator can be hand optimized for that jet, which could operate in exactly the the function-like way you suggested, because it would actually be a function, under the hood.
> this helps jets compose more easily; if we want a SCRIPT that incorporates an existing jet, we do not have to manipulate the stack in a way that the existing jet expects, we just load the proper data into the constants table.
I think I see what you're saying about multiple jets composing together easily. I think your idea about loading constants from their initial positions has merit - basically function arguments that you can reference by position rather than needing to arrange them in the right order on the stack. Such is the existence of a stack-based language. I like the idea of eg `c1` to `c26` paralleling the pushdata opcodes. The question I have is: where would the constants table come from? Would it reference the original positions of items on the witness stack?