0

minting script

    "type": "all",
    "scripts":
    [   
        {
            "type": "after",
            "slot": 155761
        },
        {
            "type": "sig",
            "keyHash": "e9ce8633aef95b632bfbffc12a83cc4c589132c46cd03f8dae146ec2"
        }
     
    ]
}

metadata-json-file

    "721": {
        "ca8fc6bf8d698d5752e6c700c8a5818c2abe5a17877121ae99604e24": {
            "cat": {
                "name": "Nikki",
                "image": ["ipfs://QmQQqHaitxGkzNTRCSxJxTU5JaVvSoGGxocBcU246BZA7M"],
                "mediaType": "image/png",
                "description": "remember when?",
                "files": [
                    {
                        "mediaType": "image/png",
                        "src": ["ipfs://QmQQqHaitxGkzNTRCSxJxTU5JaVvSoGGxocBcU246BZA7M"]
                    },
                    {
                        "mediaType": "image/png",
                        "src": ["ipfs://QmYCbn5Nj3Xq28QwDkerMBAXsLBDa26f1k8jruuKn5gzXn"]
                    }
                    
                ],
                "type": "Nadan",
                "color": "white and brown"
            }
        }
    }
}

cardano-cli query tip --testnet-magic 1

{
    "block": 153845,
    "epoch": 19,
    "era": "Alonzo",
    "hash": "789909e77ba308c069b0e09809a6ec7508da0d2c0c474565caed2688afe3618e",
    "slot": 6674546,
    "syncProgress": "100.00"
}

command line variables

POLICYID=ca8fc6bf8d698d5752e6c700c8a5818c2abe5a17877121ae99604e24
TXIN="02a037b9649eb62f17549bf33114763568b59a4be20beba6132f7b996a0825e2#0"
TOKENNAME1="6e696b6b69"
POLICYSCRIPT="ppbl-nft-2.script"
MINTER=addr_test1vr5uap3n4mu4kcetl0luz25re3x93yfjc3kdq0ud4c2xassvq0wsd
METADATA_JSON_FILE="mynft.json"
RECIEVER=addr_test1qzdquurtx940tpyfgt7pu2h8zgrgfepf7quwcqqh3kmacd83z2naq8a2cltaqyxexml30wh77uyu3sll7feyp2nzqgnqfdpnsa

// transaction cardano-cli transaction build \ --alonzo-era \ --testnet-magic 1 \ --tx-in $TXIN \ --tx-out $RECIEVER+1500000+"1 $POLICYID.$TOKENNAME" \ --change-address $MINTER \ --mint "1 $POLICYID.$TOKENNAME" \ --minting-script-file ppbl-nft-2.script \ --metadata-json-file mynft.json \ --protocol-params-file protocol.json \ --out-file nft.raw

//transaction sign

cardano-cli transaction sign \
--signing-key-file payment.skey \
--testnet-magic 1 \
--tx-body-file nft.raw \
--out-file mint-nft.signed

//submit transaction

cardano-cli transaction submit \
--tx-file mint-nft.signed \
--testnet-magic 1

ERROR

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash "c867c502e249d681b35a8df2e3df5e58ec2c16d3df445429484a1793"])))])

2 Answers 2

0

You are using,

{
    "type": "after",
    "slot": 155761
}

while the current slot on preprod is ~154042. This policy allows using it only after slot 155761, for more info see (1). Also make sure that,

cardano-cli address key-hash --payment-verification-key-file payment.skey

is equal to e9ce8633aef95b632bfbffc12a83cc4c589132c46cd03f8dae146ec2.

5
  • i changes the script ``` { "type": "all", "scripts": [ { "type": "after", "slot": 6702243 }, { "type": "sig", "keyHash": "e9ce8633aef95b632bfbffc12a83cc4c589132c46cd03f8dae146ec2" } ] }``` and key hash is also the same still same error Sep 5, 2022 at 13:50
  • Hmm, that's weird, I also think I had the slot of preprod wrong (your query is correct).
    – Fermat
    Sep 5, 2022 at 14:59
  • Can you use the --invalid-after to make the transaction valid even if it is send before the after slot?
    – Fermat
    Sep 5, 2022 at 15:55
  • ``` cardano-cli transaction build \ --alonzo-era \ --testnet-magic 1 \ --tx-in $TXIN \ --tx-out $RECIEVER+1500000+"1 $POLICYID.$TOKENNAME" \ --change-address $MINTER \ --mint "1 $POLICYID.$TOKENNAME" \ --minting-script-file ppbl-nft-2.script \ --invalid-hereafter 6753799 \ --metadata-json-file mynft.json \ --protocol-params-file protocol.json \ --out-file nft.raw``` Sep 6, 2022 at 4:08
  • still same error Sep 6, 2022 at 4:26
0

You're missing the --invalid-before flag when building the transaction. It sets the lower bound of the transaction's validity interval, which is required for the script to determine whether the interval range is greater than slot 155761. You must use a slot that is lower than the current slot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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