2

I am stuck with this error, what's a NonOutputSupplimentaryDatums?:

""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (NonOutputSupplimentaryDatums (fromList [SafeHash \"13866df5e21887cb0d2c27b8d8ccf03d1cb7f93e929dffa9a91c8a4b83c98c60\"]) (fromList [])))])""

For the reference:

  • I am spending a script input with inline datum
  • I am using add_plutus_script_input on TransactionBuilder to add the input
  • I am using txBuilder.calc_script_data_hash(TxBuilderConstants.plutus_vasil_cost_models()); to get the script witnesses and script hash set up

Thanks for any help!

2 Answers 2

5

I don't use cardano-serialization-lib but I can tell you that NonOutputSupplimentaryDatums is the ledger error thrown when datum is unneceserilly included in the tx when using inline datum. When inline datum is being used you can't have the same datum also in the tx body's witness set.

2
  • Thanks for the error explanation! The only datum I am attaching is via TxBuilder#add_plutus_script_input which requires a PlutusWitness that is made up of the script, the datum and redeemer.
    – Will
    Commented Oct 3, 2022 at 16:32
  • This actually helped me solving "unspendableDatums" error from Ogmios. I could not find any docs for it, only the mapping from NonOutputSupplimentaryDatums here: github.com/CardanoSolutions/ogmios/blob/…
    – mirelon
    Commented May 11, 2023 at 8:01
1

So I was able to resolve the issue. The problem was caused by the way I attached the datum as PlutusWitness. So instead of creating directly instantiating a PlutusWitness I created one with the help of the newly made available constructor PlutusWitness.new_with_ref in CSL version 11.1.0:

const txIn = TransactionInput.new(TransactionHash.from_bytes(Buffer.from(o.txId, 'hex')), o.idx);
...
// Caused error:
const errorCausingPlutusWitness = PlutusWitness.new(myContract, myDatum, myRedeemer);

// Valid way:
const plutusWitness = PlutusWitness.new_with_ref(PlutusScriptSource.new(myContract), DatumSource.new_ref_input(txIn), myRedeemer);

const amt = Value.new(BigNum.from_str(`${o.value.coins}`));

// The script input to be spent
txBuilder.add_plutus_script_input(plutusWitness, txIn, amt);

1
  • This essentially allowed me to spend an inline-datum script output.
    – Will
    Commented Oct 4, 2022 at 14:23

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.