0

I'm currently trying to create a minting process with lucid (v. 0.8.9) using Blockfrost on Mainnet.

Minting policy:

const mintingPolicy: MintingPolicy = lucid.utils.nativeScriptFromJson({
    type: "any",
    scripts: [{
        scripts: [{
            keyHash: "ccb1d97578fe819d6df11095a74a96803e5a50460b5cf895aaf40c0d",
            type: "sig"
        }],
        type: "all"
    }, {
        scripts: [{
            keyHash: "66f9337a3873f06478d394058ec7fda75909b359df883b8aaf8ba79d",
            type: "sig"
        }],
        type: "all"
    }, {
        scripts: [{
            keyHash: "6c70c3fc4f73e5bbb54cc87bdf943fad2213da692b260e12749bcc10",
            type: "sig"
        }],
        type: "all"
    }]
});

Mint function:

export async function mintNFT(name ? : string, ): Promise < TxHash > {
    try {
        const unit: Unit = policyId2;
        const tx = await lucid.newTx().mintAssets({
            [unit]: 1n
        }).attachMintingPolicy(mintingPolicy).validTo(Date.now() + 100_000).complete();
        const signedTx = await tx.sign().complete();
        const txHash = await signedTx.submit();
        console.log(txHash) return txHash;
    } catch (e: any) {
        console.log('Error occured:');
        console.log(e.message);
        return e.message;
    }
}

Error:

"transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash \"f188522db566255b029de7c30e1e5cc14c30ba6649356d9b1ae8ebb5\"]))))])"

Where f188522db566255b029de7c30e1e5cc14c30ba6649356d9b1ae8ebb5 is a policyId.

I'm not entirely sure, but the error seems to be fixable by adding invalid-hereafter parameter to a raw transaction in cli OR by signing a transaction with both skey and vkey (I think that currently lucid only signs with vkey), but I didn't find a way to do it properly.

2 Answers 2

0

I'm not sure if this will help, but I have an example that includes both on-chain and off-chain code for minting a multi-sig NFT using Helios.

https://github.com/lley154/helios-examples/tree/main/nft-multisig

0

I messed up the keyHashes in the minting policy and was trying to mint with a different wallet.

This was extremely useful.

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.