Doubts about policy.script

I saw that it is possible to add more, or less information, to policy.script before creating the policyID for a token.

I’m talking about this while still in the directory, without touching the registry token yet.

This is being created only with keyhash

“keyHash”: “00000000000000000000000000”,
“type”: “sig”

This already has a slot date so you can no longer mint it after a certain period

“scripts”: [
“keyHash”: “0000000000000000”,
“type”: “sig”
“slot”: 000000000,
“type”: “before”
“type”: “all”

Could anyone point me to a guide with information that talks about everything I can add to policy.script, and what will influence the creation of the token.

Simple scripts are documented here:

The basic possibilities you have already seen. There is not only before, but also after. And you not only have all, but also any and atLeast. You could also nest all, any, and atLeast to create more complicated structures – the transaction has to be after this slot, before this slot, and has to be signed by two of these three keys or this key.

You could also use full Plutus scripts instead of these simple scripts as policies which would then allow arbirtrary complicated logic like it is used in other smart contracts.

And, yes, of course that is before touching the token. Each change of the policy will change its hash value and the hash is the policy ID. Different policy script means totally different token.

1 Like

Thanks man, this really helped.