<p>I been dealing with this problem using Lucid for building the transactions.</p>
<p>When the framework create the transactions it was using wrong protocols parameters.</p>
<p>There is a field in the body of the transaction, called script_data_hash.</p>
<p>This field need to be filled before submitting the transaction.</p>
<p>Script data hash is a hash related with the redeemers of the transactions, the datums and the cost model (protocol parameters)</p>
<p>For example in Lucid, I fixed it updating the cost models and calculating all again:</p>
<pre><code>const redeemers = witness_set_NEW_VERISON.redeemers();
const datums = witness_set_NEW_VERISON.plutus_data();
const costModels_NEW_VERISON = createCostModels_NEW_VERISON(protocolParameters.costModels);
const scriptHash = hash_script_data(redeemers!, costModels_NEW_VERISON, datums);
body.set_script_data_hash(C.ScriptDataHash.from_bytes(scriptHash.to_bytes()));

</code></pre>
<p>The error you are receiving is that the set_script_data_hash in the body is not matching the one that is calculated in the node when trying to validate the transaction.</p>
<p>Check where you initialize:</p>
<pre><code>const tx = new Transaction({ initiator: wallet });
</code></pre>
<p>If there is a way to set manually the protocol parameters or the cost model.</p>

CC BY-SA 4.0
2023-02-18T11:24:22.127Z
Yes but in mesh library, there is no such variable to set the protocol parameters, It just create, build and sign the transmission with it function only. So how can i check these in Mesh library
duaa azhar
CC BY-SA 4.0
2023-02-14T17:20:59.690Z
2023-02-14T17:20:59.690Z
Manu Padilla
<p>Are you sure the redeemer you are passing is correct?</p>

CC BY-SA 4.0
2023-01-15T18:10:14.737Z
Yes, the redeemer here is just a formality as the script is always true script. Also i copied the redeemer format from the tutorial link given.
duaa azhar
CC BY-SA 4.0
2023-01-15T09:22:51.053Z
2023-01-15T09:22:51.053Z
abdelkrimdev
<p>The code you are seeing is returned directly from the node.</p>
<p><code>PPViewHashesDontMatch</code> means that the protocol parameters hash does not match what is on-chain.</p>
<p>Are you sure you are using the latest version of Mesh?</p>

CC BY-SA 4.0
2023-01-13T06:23:39.977Z
yes, I have meshsdk/core 1.3.0 and meshsdk/react 1.1.3 version. And both of these are latest one
duaa azhar
CC BY-SA 4.0
2023-01-12T14:43:25.543Z
2023-01-12T14:43:25.543Z
Marek Mahut - StakeNuts
<p>I am Facing this error while transaction submission.
<code>&quot;&quot;transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (PPViewHashesDontMatch (SJust (SafeHash \&quot;268fc512be7cdc13c5e3da75d2888a5790c01173b32a38b4da2972a3b0059ee2\&quot;)) (SJust (SafeHash \&quot;47120f8f4cf7f65759c1a535d34e593e271bcd69fb9719359f8ec23cd73f0221\&quot;))))])&quot;&quot;</code>
I am following the mesh api tutorial <a href="https://meshjs.dev/apis/transaction/smart-contract#plutusminting" rel="nofollow noreferrer">https://meshjs.dev/apis/transaction/smart-contract#plutusminting</a>
The code is exact same as given in tutorial, but i am stuck at this error for so long. For safe side i am also pasting the code here. Kindly suggest a solution for it, will be very helpful for me.
Thanks in Advance</p>
<pre><code>import { AssetMetadata, Mint, Action, PlutusScript } from '@meshsdk/core';

const script: PlutusScript = {
  code: plutusMintingScriptCbor,
  version: 'V2',
};

const redeemer: Partial&lt;Action&gt; = {
  tag: 'MINT',
};

const tx = new Transaction({ initiator: wallet });

// define asset#1 metadata
const assetMetadata1: AssetMetadata = {
  &quot;name&quot;: &quot;Mesh Token&quot;,
  &quot;image&quot;: &quot;ipfs://QmRzicpReutwCkM6aotuKjErFCUD213DpwPq6ByuzMJaua&quot;,
  &quot;mediaType&quot;: &quot;image/jpg&quot;,
  &quot;description&quot;: &quot;This NFT is minted by Mesh (https://meshjs.dev/).&quot;
};
const asset1: Mint = {
  assetName: 'MeshToken',
  assetQuantity: '1',
  metadata: assetMetadata1,
  label: '721',
  recipient: 'addr_test1vpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0c7e4cxr',
};
tx.mintAsset(
  script,
  asset1,
  redeemer,
);

const unsignedTx = await tx.build();
const signedTx = await wallet.signTx(unsignedTx);
const txHash = await wallet.submitTx(signedTx);```
</code></pre>

<cardano-cli><nft><minting><blockfrost><mesh>
how to resolve this transaction submission error of MintToken with Mesh
# how to resolve this transaction submission error of MintToken with Mesh

(Asked by: username_0 on 2023-01-10)

I am Facing this error while transaction submission.
""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (PPViewHashesDontMatch (SJust (SafeHash \"268fc512be7cdc13c5e3da75d2888a5790c01173b32a38b4da2972a3b0059ee2\")) (SJust (SafeHash \"47120f8f4cf7f65759c1a535d34e593e271bcd69fb9719359f8ec23cd73f0221\"))))])""
I am following the mesh api tutorial https://meshjs.dev/apis/transaction/smart-contract#plutusminting
The code is exact same as given in tutorial, but i am stuck at this error for so long. For safe side i am also pasting the code here. Kindly suggest a solution for it, will be very helpful for me.
Thanks in Advance
import { AssetMetadata, Mint, Action, PlutusScript } from '@meshsdk/core';

const script: PlutusScript = {
  code: plutusMintingScriptCbor,
  version: 'V2',
};

const redeemer: Partial = {
  tag: 'MINT',
};

const tx = new Transaction({ initiator: wallet });

// define asset#1 metadata
const assetMetadata1: AssetMetadata = {
  "name": "Mesh Token",
  "image": "ipfs://QmRzicpReutwCkM6aotuKjErFCUD213DpwPq6ByuzMJaua",
  "mediaType": "image/jpg",
  "description": "This NFT is minted by Mesh (https://meshjs.dev/)."
};
const asset1: Mint = {
  assetName: 'MeshToken',
  assetQuantity: '1',
  metadata: assetMetadata1,
  label: '721',
  recipient: 'addr_test1vpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0c7e4cxr',
};
tx.mintAsset(
  script,
  asset1,
  redeemer,
);

const unsignedTx = await tx.build();
const signedTx = await wallet.signTx(unsignedTx);
const txHash = await wallet.submitTx(signedTx);```

**Tags:** cardano-cli, nft, minting, blockfrost, mesh

---

## 3 answers

### Answer by username_1 on 2023-02-14. Score: 0

I been dealing with this problem using Lucid for building the transactions.
When the framework create the transactions it was using wrong protocols parameters.
There is a field in the body of the transaction, called script_data_hash.
This field need to be filled before submitting the transaction.
Script data hash is a hash related with the redeemers of the transactions, the datums and the cost model (protocol parameters)
For example in Lucid, I fixed it updating the cost models and calculating all again:
const redeemers = witness_set_NEW_VERISON.redeemers();
const datums = witness_set_NEW_VERISON.plutus_data();
const costModels_NEW_VERISON = createCostModels_NEW_VERISON(protocolParameters.costModels);
const scriptHash = hash_script_data(redeemers!, costModels_NEW_VERISON, datums);
body.set_script_data_hash(C.ScriptDataHash.from_bytes(scriptHash.to_bytes()));


The error you are receiving is that the set_script_data_hash in the body is not matching the one that is calculated in the node when trying to validate the transaction.
Check where you initialize:
const tx = new Transaction({ initiator: wallet });

If there is a way to set manually the protocol parameters or the cost model.

> **Comments:**
> **username_0**: Yes but in mesh library, there is no such variable to set the protocol parameters, It just create, build and sign the transmission with it function only. So how can i check these in Mesh library  

---

### Answer by username_2 on 2023-01-15. Score: 0

Are you sure the redeemer you are passing is correct?

> **Comments:**
> **username_0**: Yes, the redeemer here is just a formality as the script is always true script. Also i copied the redeemer format from the tutorial link given.  

---

### Answer by username_3 on 2023-01-12. Score: 0

The code you are seeing is returned directly from the node.

`PPViewHashesDontMatch` means that the protocol parameters hash does not match what is on-chain.

Are you sure you are using the latest version of Mesh?

> **Comments:**
> **username_0**: yes, I have meshsdk/core 1.3.0 and meshsdk/react 1.1.3 version. And both of these are latest one  

---

