<p>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.</p>
<p><a href="https://github.com/lley154/helios-examples/tree/main/nft-multisig" rel="nofollow noreferrer">https://github.com/lley154/helios-examples/tree/main/nft-multisig</a></p>

CC BY-SA 4.0
2023-02-10T00:01:19.030Z
2023-02-10T00:01:19.030Z
lley154
<p>I messed up the keyHashes in the minting policy and was trying to mint with a different wallet.</p>
<p><a href="https://forum.cardano.org/t/minting-token-with-time-base/59214/13" rel="nofollow noreferrer">This</a> was extremely useful.</p>

CC BY-SA 4.0
2023-02-10T21:26:51.570Z
2023-02-10T21:26:51.570Z
Kostia
<p>I'm currently trying to create a minting process with lucid (v. 0.8.9) using Blockfrost on Mainnet.</p>
<p>Minting policy:</p>
<pre><code>const mintingPolicy: MintingPolicy = lucid.utils.nativeScriptFromJson({
    type: &quot;any&quot;,
    scripts: [{
        scripts: [{
            keyHash: &quot;ccb1d97578fe819d6df11095a74a96803e5a50460b5cf895aaf40c0d&quot;,
            type: &quot;sig&quot;
        }],
        type: &quot;all&quot;
    }, {
        scripts: [{
            keyHash: &quot;66f9337a3873f06478d394058ec7fda75909b359df883b8aaf8ba79d&quot;,
            type: &quot;sig&quot;
        }],
        type: &quot;all&quot;
    }, {
        scripts: [{
            keyHash: &quot;6c70c3fc4f73e5bbb54cc87bdf943fad2213da692b260e12749bcc10&quot;,
            type: &quot;sig&quot;
        }],
        type: &quot;all&quot;
    }]
});
</code></pre>
<p>Mint function:</p>
<pre><code>export async function mintNFT(name ? : string, ): Promise &lt; TxHash &gt; {
    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;
    }
}
</code></pre>
<p>Error:</p>
<pre><code>&quot;transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash \&quot;f188522db566255b029de7c30e1e5cc14c30ba6649356d9b1ae8ebb5\&quot;]))))])&quot;
</code></pre>
<p>Where f188522db566255b029de7c30e1e5cc14c30ba6649356d9b1ae8ebb5 is a policyId.</p>
<p>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.</p>

<transaction><blockfrost><error><mintingpolicy><lucid>
ScriptWitnessNotValidatingUTXOW while minting an NFT
# ScriptWitnessNotValidatingUTXOW while minting an NFT

(Asked by: username_0 on 2023-02-08)

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.

**Tags:** transaction, blockfrost, error, mintingpolicy, lucid

---

## 2 answers

### Answer by username_0 on 2023-02-10. Score: 0 | Accepted answer

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

[This](https://forum.cardano.org/t/minting-token-with-time-base/59214/13) was extremely useful.


---

### Answer by username_1 on 2023-02-10. Score: 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>


---

