Layer 2 built-in support #976
KtorZ
started this conversation in
Core language features
Replies: 1 comment
-
I think it is worth considering the possibility that Layer 2s will end up not only having a custom ScriptContext shape, but additionally there may be some builtins which are enabled on Layer 2s that are not enabled on the Layer 1. In this case, it becomes necessary for additional changes outside of the ones described above. To be clear, I am only arguing here in favor of UPLC generation allowing for these builtins. I am not arguing for supporting evaluation of custom builtins, unless maybe the logic for a given builtin is supplied as an Aiken function?). Not sure what the best approach here is. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Building up on the new V3 syntax:
We could imagine augmenting the syntax to support custom purposes; and use that syntax to define Cardano's purposes themselves. The definition for Cardano would be implicitly provided when unspecified, and would be equivalent to:
The idea would be to have the validator's purpose names be the (lowercased) variants of a defined type + the else branch:
The syntax for defining new purpose should also include ways of specifying the constructor index for the script context corresponding to that purpose (the Cardano ledger currently uses
0
).So for example, if we imagine a layer 2 "Gummiworm" associated with the constructor
1
, we could have:Notice that the names of the validator is the same, such that it compiles to a single program (single hash) across all layers.
Beta Was this translation helpful? Give feedback.
All reactions