<p>It's true that currently (prior to Plutus release), the only thing influencing the transaction fee for a transaction is its size in bytes.</p>
<p>However the Cardano development team have indicated that it will get more complex when using Plutus smart contracts. Two more factors will come into play:</p>
<ul>
<li>Number of virtual instructions executed</li>
<li>Maximum memory used during execution</li>
</ul>
<p>They are still working on the precise definition of what is a virtual instruction (some operations might count as more than 1, but how many exactly is still work in progress).</p>

CC BY-SA 4.0
2021-05-30T22:14:54.973Z
2021-05-30T22:14:54.973Z
Flavien
<p>I've read here and there, perhaps incorrectly, that the transaction fees depend on the size of the transaction (in bytes). However, with smart contracts, the difficulty to process a transaction is not proportional to its size: for example, there are small SAT-problem that can never be solved in practice, while it is very easy to answer the query &quot;find the first byte of the sequence ab55...&quot; even if the sequence is huge. Obviously, there should be some cost for the size of the transaction as it has to be stored on-chain, but if the cost is only on the size of the transaction, and not on the complexity of the request, then the chosen memory-time trade-offs will be greatly in favor of using time (free) above using memory (costly).</p>
<p>So, what will be the incentive mechanism for fees in cardano?</p>

CC BY-SA 4.0
2021-06-01T02:34:08.253Z
I think there are multiple things to consider. The data, as you pointed out, needs to be stored and thus incurs a cost. However, at least in haskell, that task of reading the first byte of the sequence is indeed rather simple if the laziness of haskell is utilized. It'll be interesting to see the exact fee formula.
Matthias Sieber
CC BY-SA 4.0
2021-06-03T09:19:31.567Z
@MatthiasSieber I do not see how haskell makes anything easier in this context. Indeed, you have to store the complete sequence because you have to check the signature. And it is also very easy to check only the first byte of a sequence in any imperative programming language like python or c. So not sure what you meant.
Distic
<smart-contract><transaction>
Transaction fees and smart contract complexity
# Transaction fees and smart contract complexity

(Asked by: username_0 on 2021-05-28)

I've read here and there, perhaps incorrectly, that the transaction fees depend on the size of the transaction (in bytes). However, with smart contracts, the difficulty to process a transaction is not proportional to its size: for example, there are small SAT-problem that can never be solved in practice, while it is very easy to answer the query "find the first byte of the sequence ab55..." even if the sequence is huge. Obviously, there should be some cost for the size of the transaction as it has to be stored on-chain, but if the cost is only on the size of the transaction, and not on the complexity of the request, then the chosen memory-time trade-offs will be greatly in favor of using time (free) above using memory (costly).

So, what will be the incentive mechanism for fees in cardano?

**Tags:** smart-contract, transaction
> **Comments:**
> **username_1**: I think there are multiple things to consider. The data, as you pointed out, needs to be stored and thus incurs a cost. However, at least in haskell, that task of reading the first byte of the sequence is indeed rather simple if the laziness of haskell is utilized. It'll be interesting to see the exact fee formula.  
> **username_0**: @MatthiasSieber I do not see how haskell makes anything easier in this context. Indeed, you have to store the complete sequence because you have to check the signature. And it is also very easy to check only the first byte of a sequence in any imperative programming language like python or c. So not sure what you meant.  

---

## 1 answers

### Answer by username_2 on 2021-05-30. Score: 6 | Accepted answer

It's true that currently (prior to Plutus release), the only thing influencing the transaction fee for a transaction is its size in bytes.

However the Cardano development team have indicated that it will get more complex when using Plutus smart contracts. Two more factors will come into play:

* Number of virtual instructions executed
* Maximum memory used during execution

They are still working on the precise definition of what is a virtual instruction (some operations might count as more than 1, but how many exactly is still work in progress).


---

