Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cost model page in the user guide #6582

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add cost model page in the user guide
  • Loading branch information
zliu41 committed Oct 17, 2024
commit 7226ca20b7aee860dae38aeb00c036330707ff7b
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.