I’m looking to play around with creating a native token.
When building out the token policy script, I’m looking to add a time-lock with the invalidAfter function but I’m unable to find a source in the official Cardano documentation with the invalidAfter keyword. I do see the “after” and “before” keywords however…
I’m looking to generate a policy similar to this one:
I don’t know why there would have to be an invalidAfter keyword. They just chose to encode this as a type of "before" (note that it is inverse – if it shall be invalid after, it is required to be before) in their JSON syntax.
What is actually used on-chain is not this JSON syntax, anyway, but a translation of that into CBOR that is done by cardano-cli when you give such a file to it. If interested, the specification of that actual CBOR structure can be found at (this is for the current Conway era, there are equivalent places for the previous eras):
So, there are no keywords at all in the on-chain bytes, but integers 0 through 5 that encode this in an efficient way.