0

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<Action> = {
  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);```

3 Answers 3

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?

1
  • yes, I have meshsdk/core 1.3.0 and meshsdk/react 1.1.3 version. And both of these are latest one
    – duaa azhar
    Jan 13, 2023 at 6:23
0

Are you sure the redeemer you are passing is correct?

1
  • 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
    Jan 15, 2023 at 18:10
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.

1
  • 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
    Feb 18, 2023 at 11:24

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.