Logo Gas

Gas

Tổ chức
Starchild-ai-agent
gas

How gas pricing works on Monad and how it differs from Ethereum. Monad charges gas based on gas_limit (not gas used), has a different base fee controller, and different block gas limits. Fetch this skill whenever writing smart contracts, setting gas limits, estimating gas, or building any transaction-related UI on Monad incorrect gas handling can cost users real money.

Tổng quan

Nhà phát hànhStarchild-ai-agent
Kho mãofficial-skills
Tên kỹ nănggas
Sao
32
Bản fork
13
Tệp đi kèm
1
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được Starchild-ai-agent công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Gas trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Starchild-ai-agent/official-skills/tree/main/monad/gas
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Starchild-ai-agent/official-skills.git /tmp/official-skills
mkdir -p .claude/skills
cp -r /tmp/official-skills/monad/gas .claude/skills/gas
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Gas trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Gas ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Gas với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Monad's gas pricing is EIP-1559 compatible but differs from Ethereum in critical ways. If you're building apps that submit transactions, estimate gas, or display gas costs, you need to understand these differences.

Key Difference: Monad Charges on Gas Limit, Not Gas Used

On Ethereum, users pay for the gas actually consumed by their transaction. On Monad, users pay based on the gas limit they set:

gas_paid = gas_limit * price_per_gas

This exists because Monad uses asynchronous execution — block leaders build blocks before executing them, so actual gas consumption isn't known at inclusion time. This prevents DOS attacks where transactions claim cheap gas but consume expensive computation.

What this means for developers:

  • Setting an unnecessarily high gas limit directly costs users more MON.
  • Always set tight, accurate gas limits especially for transactions with known fixed costs.
  • For native MON transfers, the gas cost is always 21,000. Hardcode this instead of relying on eth_estimateGas.

EIP-1559 Transaction Pricing

Monad uses type 2 (EIP-1559) transactions:

price_per_gas = min(base_price_per_gas + priority_price_per_gas, max_price_per_gas)

Users specify two values when signing:

  • priority_price_per_gas — tip for transaction prioritization within a block
  • max_price_per_gas — safety cap on total gas price

The network controls base_price_per_gas, which is the same for all transactions in a block.

Block and Transaction Limits

ParameterValue
Block gas limit200M gas
Transaction gas limit30M gas
Minimum base fee100 MON-gwei (100 x 10^-9 MON)

These are significantly higher than Ethereum's 30M block gas limit, which means Monad blocks can fit more transactions.

Base Fee Controller

Monad's base fee controller is different from Ethereum's. It increases more slowly and decreases more quickly to prevent blockspace underutilization from overpricing.

Controller parameters:

  • max_step_size = 1/28
  • target = 160M gas (80% of block capacity)
  • beta = 0.96
  • epsilon = 160M

The base fee updates each block using an exponential adjustment based on how full the block was relative to the target. The formula uses exponential smoothing (beta = 0.96) to track historical variance in block fullness, producing smoother fee transitions than Ethereum's simpler mechanism.

In practice, this means gas prices on Monad are more stable and recover faster after spikes.

Transaction Ordering

The default Monad client orders transactions using a Priority Gas Auction, transactions are sorted by descending total gas price (base fee + priority fee).

Developer Guidelines

Always Set Explicit Gas Limits for Known Costs

For operations with fixed gas costs, set the gas limit explicitly before submitting to wallets:

typescript
// Good: explicit gas limit for a native transfer
const tx = {
  to: recipient,
  value: parseEther("1.0"),
  gasLimit: 21000n,
};

This is important because some wallets (like MetaMask) use eth_estimateGas to determine the gas limit. If that call reverts (e.g., the contract call would fail), the wallet may fall back to a very high gas limit. On Monad, the user would then pay for that entire inflated limit since gas is charged on the limit, not on actual usage.

Gas Estimation in Frontend Code

When using viem or wagmi to estimate gas, remember that the estimate is what users will actually pay not a lower bound. Add only a small buffer if needed:

typescript
// If you must estimate, keep the buffer small
const estimate = await publicClient.estimateGas({ ... });
const gasLimit = estimate + (estimate / 10n); // 10% buffer at most

Displaying Gas Costs to Users

When showing gas costs in your UI, calculate from the gas limit (not "gas used" from receipts on other chains):

typescript
const gasCost = gasLimit * gasPrice;

Smart Contract Considerations

  • Monad's 30M transaction gas limit is the same as Ethereum's block gas limit, so individual transactions can be very large.
  • Optimize your contracts to use less gas on Monad this directly saves users money since they pay for the limit, and tighter estimates mean tighter limits.
  • If your contract has functions with predictable gas costs, document them so frontends can set explicit limits.

Opcode Pricing Differences

Monad adjusts a few opcode prices upward rather than discounting everything. This achieves the same relative effect with minimal disruption. The changes reflect different resource scarcity in Monad's high-performance architecture, particularly for disk-based state operations.

Cold State Access is Much More Expensive

OperationEthereumMonadIncrease
Account access (cold)2,600 gas10,100 gas+7,500
Storage access (cold)2,100 gas8,100 gas+6,000
Account access (warm)100 gas100 gasunchanged
Storage access (warm)100 gas100 gasunchanged

Affected opcodes:

  • Account access: BALANCE, EXTCODESIZE, EXTCODECOPY, EXTCODEHASH, CALL, CALLCODE, DELEGATECALL, STATICCALL, SELFDESTRUCT
  • Storage access: SLOAD, SSTORE

What this means for developers:

  • Contracts that touch many cold storage slots or call many external contracts will cost significantly more on Monad.
  • Warm access is identical to Ethereum, so accessing the same slot/account repeatedly within a transaction has no extra cost.
  • Batch operations that access a storage slot once (cold) and then reuse it (warm) are fine. But patterns that do single cold reads across many different slots will be more expensive.
  • If your contract reads from many different storage slots in a single call, the gas estimate will be higher on Monad. Account for this when setting gas limits.

Precompile Repricing

Cryptographic precompiles cost 2-5x more on Monad:

PrecompileAddressEthereumMonadMultiplier
ecRecover0x013,0006,0002x
ecAdd0x061503002x
ecMul0x076,00030,0005x
ecPairing0x0845,000225,0005x
blake2f0x09rounds x 1rounds x 22x
point evaluation0x0a50,000200,0004x

What this means for developers:

  • Contracts relying heavily on signature verification (ecRecover) will use 2x the gas for those operations.
  • ZK-related operations (ecMul, ecPairing, point evaluation) are 4-5x more expensive. If your contract does on-chain ZK proof verification, gas estimates from Ethereum will be significantly off.
  • Factor these higher precompile costs into gas limit calculations if your contract uses them.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Gas làm được gì?

How gas pricing works on Monad and how it differs from Ethereum. Monad charges gas based on gas_limit (not gas used), has a different base fee controller, and different block gas limits. Fetch this skill whenever writing smart contracts, setting gas limits, estimating gas, or building any transaction-related UI on Monad incorrect gas handling can cost users real money.

Vì sao nên dùng Gas trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Gas là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Gas trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Starchild-ai-agent/official-skills/tree/main/monad/gas. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Gas?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Gas với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Gas với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Gas có miễn phí không?

Kỹ năng này được Starchild-ai-agent phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇