IntersectMBO / cardano-ledger

The ledger implementation and specifications of the Cardano blockchain.
Apache License 2.0
258 stars 158 forks source link

document: how to calculate script integrity hash for Plutus v3 #4319

Closed ashisherc closed 5 months ago

ashisherc commented 5 months ago

regarding plutus v1/2, a text file with the key names for cost model was provided as part of cddl. which is missing for Plutus v3. Please document the spec for calculating script integrity hash for plutus v3.

This is required for non-haskell tools to support building transactions with plutus scripts.

lehins commented 5 months ago

Could you please elaborate? I am not aware of any text files with key names.

The process of script integrity hash calculation did not change for PlutusV3. Also names for parameter keys for CostModels never participated in hash integrity calculation, CostModels were always represented as a list of integers. Moreover this list will no longer be static for all Plutus versions. Starting with Conway it will be possible to add new primitives, thus number of elements in that list will change.

ashisherc commented 5 months ago

@lehins found this, https://github.com/IntersectMBO/cardano-ledger/commit/8e0419193b92e161cea833664bf1919df8fb9775#diff-4683b5e894b0b003ec15f7ff32c5cd5725debf47894e3f6aa70c5dda85bc7fd2

lehins commented 5 months ago

I am glad you were able to find the explanation on why ledger does not provide the names for the cost model parameters. Commit message 8e0419193b92e161cea833664bf1919df8fb9775 has the correct explanation of why we can't provide such list. To expand on it:

Most importantly, as far as this ticket is concerned, those parameter names do not participate in hash integrity computation and there is nothing different from PlutusV3 to PlutusV2 in that perspective. I am going to close this ticket as won't fix. Please feel free to reopen if you believe I misunderstood your request.