> For the complete documentation index, see [llms.txt](https://calnix.gitbook.io/eth-dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://calnix.gitbook.io/eth-dev/gas-opt/gaslimit-and-min-cost.md).

# gasLimit & min cost

<figure><img src="/files/jMLE29pHWaau0Pi8wmVH" alt=""><figcaption></figcaption></figure>

**gasLimit**

&#x20;amount of gas that was implicitly purchases from the sender's account balance. basically, how much gas that has to be set aside for the transaction.

* txn is considered invalid if balance cannot support such a purchase
* any unused gas at the end of the txn is refunded

**Why?**

The nodes cannot look a txn and know how much gas it will require beforehand.&#x20;

They have to compute it to know much it will require. So it makes more sense for the customer to set a reasonably high gas limit that would cover the gas costs for a txn.&#x20;

### min gas cost: 21,000

The execution of a transaction defines a state transition. To that end, any transactions executed must first pass the initial tests of intrinsic validity, as mentioned in the yellow paper. These tests require 21,000 gas.

<figure><img src="/files/cBWgtKhEUUz4HOtEmf5X" alt=""><figcaption><p>requires 21,000 gas</p></figcaption></figure>

{% hint style="info" %}
Therefore, every transaction costs at least 21,000 gas
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://calnix.gitbook.io/eth-dev/gas-opt/gaslimit-and-min-cost.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
