bloxbean / yaci

A Cardano Mini Protocols implementation in Java
MIT License
22 stars 3 forks source link

[ENHANCEMENT] QuickTx attaches Minting Script even in presence of Reference Input #59

Open nemo83 opened 6 months ago

nemo83 commented 6 months ago

Hello team!

I am building a complex ScriptTx similar to:

var mintingScript = PlutusBlueprintUtil.getPlutusScriptFromCompiledCode("590b9...73c1", PlutusVersion.v2);
var mintingScriptHash = mintingScript.getScriptHash();
var scriptTx = new ScriptTx()
                .collectFrom(...)
                .payToContract("addr1w...", ValueUtil.toAmountList(amount), datum)
                .payToAddress(account.baseAddress(), ValueUtil.toAmountList(amount2))
                .mintAsset(mintingScript, asset, BigIntPlutusData.of(0))
                .readFrom("<minting script ref input>", 0)
                .withChangeAddress(account.baseAddress());

First of all the minting script object is loaded from the CBOR of the script.

When I use QuickTx, the TX built, that is correct and passes offchain validation (I haven't submitted it yet onchain!), contains the CBOR of the minting script despite the Ref Input for such script is already present.

I would like to request 2 enhancements:

  1. the minting script should not require the actual CBOR of the script to be available, in theory, script hash should suffice for quick tx to fetch it, whether required, during validation.
  2. if a ref input for a minting script is available, no minting script CBOR should be added to the tx body (I think in the witnesses section)

Hope this makes sense, and as usual great work in this amazing library.

:pray: