2

how can i get the script information for a given policyID. I am mostly interested in the "invalidAfter" Slot number. So far i could not find any option for example by using Blockfrost API.

Background: i minted a token and appropriate policy on testnet. Never published the policy-Script. The cardanoscan is able to show it to me, question how does it work?

https://testnet.cardanoscan.io/tokenPolicy/c958da9d1ba00cbd58019a45cb1481e2ef3be4406c1d80cb3fdacf3d

Thank you and Greetings Andro

3 Answers 3

1

When minting a token in Cardano, we sign (witness) the transaction with the input credentials for consuming the input, and ALSO it is required to provide the minting native script (token policy) as a witness to the transaction.

We read the witnesses from the transactions on the chain and parse the script for the tokens. Unfortunately, currently, there is no easy way that you can follow to get this information.

1
  • Thank you very much for that explanation
    – Andro
    Oct 28, 2021 at 8:43
3

As stated in other answers the minting policy script is used as a witness in the minting transaction and thus available on chain. Community members made tools for extracting such data. Here is a great forum post about the same question and links to different sources where you can find such scripts!

The post

All scripts onchain (credits to Brain W Bush)

You can parse the scripts in the above link by transaction hash.

1
  • 1
    Thank you very much for directing me to already discussed thread in other forum. Very much appreciated!
    – Andro
    Oct 29, 2021 at 10:38
1

You can't get that information, unless the creator publish it because the policy id is the hash of the policy script.

For example, here: Spacebudz policy and here Spacebudz FAQ - Is this actually an NFT

Creator already published it on pool pm, so you can find all details there.

2
  • Thank you, i got it. Remains the question how does cardanoscan gets the script information e.g here: cardanoscan.io/tokenPolicy/… also i minted a token to test-net, never published my policy script but cardanoscan is able to show it: testnet.cardanoscan.io/token/…
    – Andro
    Oct 25, 2021 at 15:57
  • You're right. Can you please update your question to add these details regarding to cardanoscan. Thanks.
    – georgeos
    Oct 25, 2021 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.