Skip to content

Commit

Permalink
Add cost model page in the user guide (IntersectMBO#6582)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliu41 authored and v0d1ch committed Dec 6, 2024
1 parent 2f2f19f commit 6b23fdf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
18 changes: 0 additions & 18 deletions doc/docusaurus/docs/delve-deeper/cost-model-parameters.md

This file was deleted.

20 changes: 20 additions & 0 deletions doc/docusaurus/docs/delve-deeper/cost-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_position: 15
---

# Cost Model

The cost model is used to determine the portion of the transaction fee that accounts for Plutus script execution.
It assigns execution units, consisting of a CPU component and a memory component, to the execution of a Plutus script, which is then used to calculate the corresponding fee in Ada.

Cardano is designed for determinism.
The script execution fee, and indeed the entire transaction fee, can be accurately predicted off-chain before the transaction is submitted.
Unlike some other blockchains, there's no risk of a script incurring higher costs on-chain than expected.
On Cardano, the fee calculated when running the script locally is the exact fee charged on-chain[^1].

To learn more about the cost model, take a look at [An overview of the Plutus Core cost model](https://github.com/IntersectMBO/plutus/blob/master/doc/cost-model-overview/cost-model-overview.pdf).

---

[^1]: A transaction may of course be rejected for reasons such as some input UTXOs no longer exist, in which case the script won't be executed.
If the script is executed, the fee will be exactly as predicted.

0 comments on commit 6b23fdf

Please sign in to comment.