上链费用:一笔交易里的四本账 On-chain fees: the four ledgers behind one transaction
每笔交易都从钱包扣钱,但扣掉的钱并不属于同一类。gas 买区块空间,服务费买协议动作,存储押金是预存的预算,合约价格由合约自己定义。本文按这四层拆开计算过程,并给出当前测试网的真实数字。 Every transaction debits the wallet, but not every debit is the same kind of money. Gas buys block space, service fees buy protocol actions, storage escrow is a prepaid budget, and contract prices belong to the contract. This essay separates the four ledgers and prices them with live testnet numbers.
On this page
一笔交易从钱包扣走的钱,通常不止一种。分清这四层,才能回答三个具体问题:现在扣多少、其中多少能回来、失败时哪些钱仍然会没。
01四本账,不是一笔费
Falari 把交易成本拆成四个互不混用的账户。把它们放在一张表里,差异比名字更重要。
| 层级 | 何时收取 | 去向 | 可退 |
|---|---|---|---|
| Gas | 每一笔 EVM 交易 | fee collector,再分配给验证者 | 否 |
| 服务费 | 每一次协议写操作 | feepool 模块账户 | 否 |
| 存储押金 | 建单与续约 | 存储模块托管,结算时分配 | 未交回执终止全退;已交回执扣补偿后退;结算后不退 |
| 合约价格 | 由合约定义 | 合约指定的地址或销毁 | 由合约决定 |
只有 gas 和服务费是通常意义上的「手续费」。存储押金是预付款:它先被锁进托管账户,等订单结算时再变成基础设施、验证者、检索方和矿工的收入。合约价格则完全在协议费率表之外——例如 FNS 的注册费由合约的 priceOf 决定,并全额转入黑洞地址。
报价 v2 的 total_fee 已经包含 gas,是「押金 + 服务费 + gas」的合计。只有不返回 quote_version 的老网关才需要调用方自己另加 gas。
02Gas:买的是区块空间
EVM 交易的 gas 账单只有两个乘数:实际消耗的 gas,和这笔交易的有效 gas 价格。Falari 把 fee market 固定在非零下限,base fee 与 min gas price 都是 47,619,047,620 wei,也就是 47.61904762 gwei。
gasCost = gasUsed × effectiveGasPrice
effectiveGasPrice = min(maxFeePerGas, baseFee + maxPriorityFeePerGas)
baseFee = 47,619,047,620 wei
这个价格不是随手取的。21,000 × 47,619,047,620 = 1,000,000,000,020,000 wei,约等于 1e15 wei,也就是 0.001 FAR。一笔最普通的原生转账,gas 成本正好落在这个整数上。
| Gas used | 费用 | 典型场景 |
|---|---|---|
21,000 | 0.001 FAR | 原生转账 |
100,000 | 0.004762 FAR | 一次较轻的合约调用 |
200,000 | 0.009524 FAR | 带事件与存储写入 |
500,000 | 0.023810 FAR | 较复杂的合约路径 |
1,000,000 | 0.047619 FAR | 重逻辑或批量操作 |
EIP-1559 钱包可以设 priority fee,但 maxFeePerGas 不能低于 base fee;低于 47.619 gwei 的交易会被拒绝。priority fee 可以为零,gas price 不能为零——链上关闭 no_base_fee 的原因正在这里:钱包需要 eth_gasPrice 返回一个非零值。
gas 在交易被纳入区块时扣除,执行失败也扣。EVM 交易未用完的 gas 按有效价格退回;但通过 /tx/exec 组装的 Cosmos 交易按声明的 fee 整笔扣除,退不回没用完的部分——上传链路的 gas 上限必须估得准。out-of-gas 时两种交易都会消耗掉全部 gas limit。与以太坊不同,这里的 base fee 不销毁:整笔 gas 进入 fee collector,再由分配模块按质押权重结算给验证者集合。
交易 revert 时,状态回滚,但 gas 不退。估算 gas limit 时应留出余量,而不是把 limit 压到刚好够用。
03存储押金:预付款,不是最大的那笔
存储订单的押金按「字节 × 天」计价,再向上取整到整天。当前公式与链上参数如下。
RequiredFee =
BaseFeePerBytePerDay × storedBytes × ceil(days)
+ FixedFeePerIntent
days = ceil(duration / 86400), minimum 1
duration = 0 → 30 years (permanent), +20% reserve
duration > 36 years → billed as permanent
duration cap → 100 years
| 参数 | 测试网当前值 | 含义 |
|---|---|---|
base_fee_per_byte_per_day | 63,578,000 wei | 每字节每天的基础价 |
fixed_fee_per_intent | 50,000 wei | 每单固定部分,几乎可忽略 |
MaxIntentDurationSeconds | 100 年 | 单次时长上限 |
PermanentDurationSeconds | 30 年 | duration = 0 的计费窗口 |
MaxIntentSize | 64 GiB | 单笔订单体积上限 |
三个容易算错的点:
- 计费字节是存储载荷,不是 6 个分片的总和。加密文件按密文大小计费,每个分段多 16 字节 GCM tag;4+2 纠删码带来的 1.5 倍物理冗余不进入押金公式。
- 一秒也算一天。时长向上取整,30 天零一秒会按 31 天计。
- 永久不是免费。
duration = 0没有到期日,但押金按 30 年一次性计,并额外加收 20% 预留;更长的有限时长(超过 36 年)按同一永久价计,不会比永久更贵。
| 订单 | 押金 |
|---|---|
| 1 MiB · 30 天 | 0.00199999094789 FAR |
| 100 MiB · 90 天 | 0.59999728435205 FAR |
| 1 GiB · 90 天 | 6.14397219176453 FAR |
| 10 GiB · 365 天 | 249.172205554892855 FAR |
| 1 GiB · 永久(30 年计费 + 20% 预留) | 897.019939997614188 FAR |
对小文件,押金只是账单的一小部分:1 MiB · 30 天的押金约 0.002 FAR,服务费 0.04 FAR,gas 约 0.145 FAR,合计约 0.187 FAR。押金仍然是治理最可能调整的参数。客户端不应把上述费率写死,而应在签名前重新请求一次报价。
04建单费:唯一按体积计价的服务费
除押金之外,创建 intent 还要付一笔服务费。它按向上取整的 GiB 计价,并以 create_intent 服务费 0.025 FAR 为下限:
createFee = max(
0.005 FAR × ceil(size / 1 GiB),
0.025 FAR
)
| 文件大小 | 建单费 |
|---|---|
| ≤ 5 GiB | 0.025 FAR(下限) |
| 6 GiB | 0.03 FAR |
| 10 GiB | 0.05 FAR |
| 64 GiB | 0.32 FAR |
这笔费在创建 intent 时扣除,之后即使上传失败、订单取消或过期,也不退。它对应的是一次已经发生的链上写入:intent、分片计划、路由与待处理额度都在那一刻落账。
05固定服务费:每个协议动作的价格
其余服务费都是固定值。它们进入独立的 feepool 模块账户,与用户押金隔离;治理可以用它向代付 gas 的中继方报销,但不会把它混进矿工奖励。当前测试网的价目表如下。
| 阶段 | 操作 | 费用 |
|---|---|---|
| 上传 | 建单 create_intent | 0.025 FAR 起 |
提交回执 batch_commit | 0.005 FAR | |
结算 finalize | 0.01 FAR | |
| 管理 | 续约 renew | 0.02 FAR |
终止 terminate | 0.02 FAR | |
清算 settle | 0.01 FAR | |
永久基金 permanent_fund | 0.02 FAR | |
转交 transfer | 0.01 FAR | |
| 矿工 | 注册 miner_register | 0.10 FAR |
调整容量 miner_adjust | 0.02 FAR | |
注销 miner_deregister | 0.02 FAR | |
| 集合 | 创建集合 collection_create | 0.01 FAR |
追加记录 append_record | 0.01 FAR |
服务费只随成功交易扣除。交易在 handler 里回滚时,扣费也一并回滚;但 gas 已经消耗,不会回来。这个区别决定了失败重试的真实成本:重试要再付一次 gas,服务费只在成功那次出现。
06一次上传的完整账单
把四层放回一条上传路径,收费点只有四个。分片上传本身发生在链下,矿工直接接收数据并签名回执,不产生链上费用。
| 步骤 | 链上动作 | 费用 |
|---|---|---|
| 1 | 创建 intent | 建单费 + 押金 + gas |
| 2 | 向矿工上传分片 | 无链上费用 |
| 3 | 提交矿工回执 | 0.005 FAR + gas |
| 4 | 结算订单 | 0.01 FAR + gas |
下面是一份真实的测试网报价:1 MiB、30 天、4+2 纠删码。
{
"quote_version": 2,
"required_fee": "1999990947890000",
"total_fee": "186883919523568500",
"refundable_fee": "0",
"non_refundable_fee": "186883919523568500",
"gas": {
"total": "2253750",
"price_wei": "53571428573",
"fee_wei": "144883928575678500"
},
"refund": {
"on_terminate_uncommitted_wei": "1999990947890000",
"on_terminate_committed_wei": "0",
"cancellation_fee_bps": 1000
},
"fee_breakdown": {
"deposit_wei": "1999990947890000",
"create_intent_wei": "25000000000000000",
"batch_commit_wei": "5000000000000000",
"finalize_wei": "10000000000000000"
}
}
换算成 FAR:押金 0.00199999094789,服务费 0.04,gas 约 0.144884(三笔合计 225.4 万 gas × 53.57 gwei × 1.2 价格余量),总计约 0.186884 FAR。押金只占约 1%。
成功结算(finalize)时,押金全额付给存储受益方,不是现金退回。终止才看 refund:未交回执时押金全退;已交回执时扣 10%(下限 0.01 FAR,封顶为押金)后退回。押金低于 0.1 FAR 时 10% 不足下限,已交回执的订单会损失全部押金——这是下限的正常结果。
07结算:押金最后去了哪里
结算时,托管中的押金按固定比例拆成四份。矿工份额是剩余部分,因此四项之和永远等于押金,不会因取整而漂移。
| 受益方 | 比例 | 1 GiB · 90 天示例 |
|---|---|---|
| 基金会 | 0% | 0 FAR |
| 验证者 | 3% | 0.1843191657529359 FAR |
| 检索方 | 3% | 0.1843191657529359 FAR |
| 矿工池 | 94% | 5.7753338602586582 FAR |
验证者份额转入 fee collector,和 gas 走同一条分配路径;检索方直接收款;基金会份额为 0,只靠块发射获得资金。如果收款地址无效或转账失败,这笔份额会停在 StorageFeePool,等待治理处理,而不是让整笔结算失败。
矿工份额不在结算时一次性付清。它变成一笔延迟释放的负债,在订单的存储窗口内按 epoch 线性解锁。测试网 epoch 为 60 秒,90 天订单对应约 129,600 个 epoch;每过一个 epoch,可领取的份额增加约 1/129,600。这样矿工的收入与「是否持续提供服务」绑定,而不是在结算当天全部落袋。
如果订单没有任何矿工回执,矿工份额没有受益人,会直接退回用户。超额锁定同理:客户端锁得比报价多时,多出的部分在结算时原路退回,不参与 0/3/3/94 分配。
08取消、续约、终止:哪些钱能回来
取消未结算订单。如果已经有矿工提交回执,协议收取 max(押金的 10%, 0.01 FAR) 作为补偿,按回执数量分给对应矿工,其余押金退回。补偿费不超过押金本身。没有回执时,不收取补偿,押金全额退回。
compensation = min(
max(lockedFee × 10%, 0.01 FAR),
lockedFee
)
以 1 GiB · 90 天为例,押金 6.14397219176453 FAR,补偿 0.614397219176453 FAR,退回 5.529574972588077 FAR。以 1 MiB · 30 天为例,押金只有约 0.002 FAR,10% 仅 0.0002,远低于 0.01 FAR 的下限,因此押金会全部作为补偿,退款为 0。
续约。续约按新时长重新计算一整笔 RequiredFee(size, duration),不是按剩余时间补差价;另收 0.02 FAR 服务费并消耗 gas。新窗口从原到期日往后顺延;若订单已经过期,则从当前时间起算。矿工份额按同一套 epoch 规则在新窗口内释放。
终止已结算订单。收 0.02 FAR 服务费。已经释放给矿工的份额不追回,尚未释放的矿工份额退回持有人;验证者与检索方已经收到的 6% 不退回。链上同时为矿工生成删除任务,让分片从磁盘上真正清除。
交易失败。状态回滚,服务费回滚,gas 不退。把失败交易的成本按「gas limit × gas price」估算,比按服务费估算更接近实际。
09读报价,而不是猜价格
三个接口分别回答不同的问题,不要拿错。
| 接口 | 回答的问题 |
|---|---|
POST /storage/quote | 这一单的押金、服务费、gas 各多少,合计多少 |
GET /fee-market | gas 价格、链上服务费、feepool 余额 |
GET /params | 存储计价的全部链上参数 |
/fee-market 里还有一个 storage 区块,列出单位价、最底费用、时长折扣和冗余系数。它是待治理批准的提案,不是当前执行规则;该区块自己的 note 也写明「quote is authoritative」。计价必须以 /storage/quote 返回的 pricing 与 fee_breakdown 为准。
钱包展示时建议拆成三行:押金、服务费、gas 估算。把三者合并成一个「手续费」,会让用户误以为押金也是成本,也会让取消订单时的退款看起来像意外收入。
最后,所有参数都可以由治理修改。报价在请求时计算,签名前重新取一次,比缓存任何数字都可靠。
A transaction usually debits the wallet in more than one kind of money. Separating the four layers answers the only three questions that matter: what is charged now, how much can come back, and what is still lost when the transaction fails.
01Four ledgers, not one fee
Falari books transaction cost into four accounts that never mix. Put them in one table and the differences matter more than the names.
| Layer | Charged when | Goes to | Refundable |
|---|---|---|---|
| Gas | Every EVM transaction | Fee collector, then validators | No |
| Service fee | Every protocol write operation | The feepool module account | No |
| Storage escrow | Creating or renewing an intent | Held by the storage module, allocated at settlement | Full refund on termination with no receipts; minus compensation with receipts; not after finalize |
| Contract price | Defined by the contract | Wherever the contract sends it | Up to the contract |
Only gas and service fees are fees in the ordinary sense. Storage escrow is a prepayment: it is locked in a module account and later becomes income for infrastructure, validators, retrieval providers, and miners. Contract prices sit outside the protocol schedule entirely — FNS, for example, prices names through the contract's priceOf and sends the registration fee to a burn address.
The quote v2 total_fee already includes gas: it is escrow + service fees + gas. Only an old gateway without quote_version makes the caller add gas.
02Gas buys block space
An EVM transaction has only two multipliers: the gas actually used and the effective gas price. Falari pins the fee market to a non-zero floor. Both the base fee and the minimum gas price are 47,619,047,620 wei, or 47.61904762 gwei.
gasCost = gasUsed × effectiveGasPrice
effectiveGasPrice = min(maxFeePerGas, baseFee + maxPriorityFeePerGas)
baseFee = 47,619,047,620 wei
The number is not arbitrary. 21,000 × 47,619,047,620 = 1,000,000,000,020,000 wei, roughly 1e15 wei, or 0.001 FAR. A plain native transfer lands exactly on that round number.
| Gas used | Cost | Typical case |
|---|---|---|
21,000 | 0.001 FAR | Native transfer |
100,000 | 0.004762 FAR | A light contract call |
200,000 | 0.009524 FAR | Events and storage writes |
500,000 | 0.023810 FAR | A more complex contract path |
1,000,000 | 0.047619 FAR | Heavy logic or batching |
An EIP-1559 wallet may set a priority fee, but maxFeePerGas cannot sit below the base fee; anything under 47.619 gwei is rejected. The priority fee can be zero, the gas price cannot. That is why no_base_fee is disabled on chain: wallets need eth_gasPrice to return a non-zero value.
Gas is charged when the transaction is included, and it is charged even if execution fails. An EVM transaction gets unused gas back at the effective price; a Cosmos transaction built through /tx/exec is charged the declared fee in full and does not get the unused part back — the upload path must size its gas limit accurately. An out-of-gas halt consumes the entire gas limit in both cases. Unlike Ethereum, the base fee is not burned here. The whole gas payment enters the fee collector and is then settled to the validator set by the distribution module.
A reverted transaction rolls back state but not gas. Estimate a gas limit with headroom instead of squeezing it to the minimum.
03Storage escrow: a prepayment, not the largest line
A storage order is priced by bytes times days, rounded up to whole days. The current formula and live parameters:
RequiredFee =
BaseFeePerBytePerDay × storedBytes × ceil(days)
+ FixedFeePerIntent
days = ceil(duration / 86400), minimum 1
duration = 0 → 30 years (permanent), +20% reserve
duration > 36 years → billed as permanent
duration cap → 100 years
| Parameter | Live testnet value | Meaning |
|---|---|---|
base_fee_per_byte_per_day | 63,578,000 wei | Base price per byte per day |
fixed_fee_per_intent | 50,000 wei | Flat part per order, negligible |
MaxIntentDurationSeconds | 100 years | Maximum single window |
PermanentDurationSeconds | 30 years | Billing window for duration = 0 |
MaxIntentSize | 64 GiB | Maximum order size |
Three details that are easy to get wrong:
- Billed bytes are the stored payload, not the sum of six shards. Encrypted data is billed at ciphertext size, with 16 extra GCM-tag bytes per segment. The 1.5× physical redundancy of 4+2 erasure coding does not enter the escrow formula.
- One second counts as one day. Duration is rounded up, so 30 days and one second is billed as 31 days.
- Permanent is not free.
duration = 0has no expiry, but the deposit is charged for 30 years up front plus a 20% reserve. A longer finite window (over 36 years) is billed at that same permanent price, so it never costs more than permanent.
| Order | Escrow |
|---|---|
| 1 MiB · 30 days | 0.00199999094789 FAR |
| 100 MiB · 90 days | 0.59999728435205 FAR |
| 1 GiB · 90 days | 6.14397219176453 FAR |
| 10 GiB · 365 days | 249.172205554892855 FAR |
| 1 GiB · permanent (billed 30 years + 20% reserve) | 897.019939997614188 FAR |
For small files the escrow is only a fraction of the bill: 1 MiB · 30 days escrows about 0.002 FAR, service fees are 0.04 FAR and gas about 0.145 FAR, for roughly 0.187 FAR in total. The escrow is still the parameter governance is most likely to change. Clients should fetch a fresh quote before signing instead of hardcoding any of these rates.
04The create fee: the only size-based service fee
Creating an intent also charges a service fee. It is priced per rounded-up GiB and has a 0.025 FAR floor:
createFee = max(
0.005 FAR × ceil(size / 1 GiB),
0.025 FAR
)
| File size | Create fee |
|---|---|
| ≤ 5 GiB | 0.025 FAR (floor) |
| 6 GiB | 0.03 FAR |
| 10 GiB | 0.05 FAR |
| 64 GiB | 0.32 FAR |
The fee is charged when the intent is created. It is not returned if the upload later fails, is cancelled, or expires. It pays for a write that has already happened: the intent, shard plan, routing, and pending-usage counters are all recorded at that moment.
05Flat service fees: the price of each protocol action
Every other service fee is flat. These fees go to a separate feepool module account, isolated from user escrow. Governance can use it to reimburse relayers that front gas, but it never mixes into miner rewards. The live testnet schedule:
| Phase | Operation | Fee |
|---|---|---|
| Upload | Create intent create_intent | from 0.025 FAR |
Commit receipts batch_commit | 0.005 FAR | |
Finalize finalize | 0.01 FAR | |
| Manage | Renew renew | 0.02 FAR |
Terminate terminate | 0.02 FAR | |
Settle settle | 0.01 FAR | |
Permanent fund permanent_fund | 0.02 FAR | |
Transfer transfer | 0.01 FAR | |
| Miner | Register miner_register | 0.10 FAR |
Adjust capacity miner_adjust | 0.02 FAR | |
Deregister miner_deregister | 0.02 FAR | |
| Collection | Create collection collection_create | 0.01 FAR |
Append record append_record | 0.01 FAR |
Service fees are charged only by successful transactions. If a handler returns an error, the charge rolls back with the rest of state; gas has already been spent and does not come back. That distinction defines the real cost of a retry: the retry pays gas again, while the service fee appears only on the attempt that succeeds.
06The full bill for one upload
Put the four layers back onto one upload path and there are only four charge points. Shard upload itself is off-chain: miners receive the data and sign receipts without an on-chain charge.
| Step | On-chain action | Cost |
|---|---|---|
| 1 | Create intent | Create fee + escrow + gas |
| 2 | Upload shards to miners | No on-chain fee |
| 3 | Commit miner receipts | 0.005 FAR + gas |
| 4 | Finalize the deal | 0.01 FAR + gas |
Here is a real testnet quote: 1 MiB, 30 days, 4+2 erasure coding.
{
"quote_version": 2,
"required_fee": "1999990947890000",
"total_fee": "186883919523568500",
"refundable_fee": "0",
"non_refundable_fee": "186883919523568500",
"gas": {
"total": "2253750",
"price_wei": "53571428573",
"fee_wei": "144883928575678500"
},
"refund": {
"on_terminate_uncommitted_wei": "1999990947890000",
"on_terminate_committed_wei": "0",
"cancellation_fee_bps": 1000
},
"fee_breakdown": {
"deposit_wei": "1999990947890000",
"create_intent_wei": "25000000000000000",
"batch_commit_wei": "5000000000000000",
"finalize_wei": "10000000000000000"
}
}
In FAR: 0.00199999094789 of escrow, 0.04 of service fees, and about 0.144884 of gas (2.254M gas across three transactions × 53.57 gwei × a 1.2 price margin), for about 0.186884 FAR in total. The escrow is about 1%.
On a successful finalize the whole escrow is paid to the storage beneficiaries, not returned as cash. Termination is described by refund: with no receipts the escrow returns in full; with receipts, 10% is withheld (0.01 FAR floor, capped at the escrow) and the rest returns. Below 0.1 FAR the 10% is under the floor, so a committed order forfeits the whole escrow — the floor working as designed.
07Settlement: where the escrow goes
At settlement the escrow is split into four fixed shares. The miner share is the remainder, so the four always add up to the deposit exactly, with no drift from rounding.
| Beneficiary | Share | 1 GiB · 90 days |
|---|---|---|
| Foundation | 0% | 0 FAR |
| Validators | 3% | 0.1843191657529359 FAR |
| Retrieval | 3% | 0.1843191657529359 FAR |
| Miner pool | 94% | 5.7753338602586582 FAR |
The validator share goes to the fee collector and follows the same distribution path as gas. Retrieval is paid directly; the foundation share is 0 and is funded by block emission only. If a beneficiary address is invalid or a transfer fails, that share parks in StorageFeePool for governance instead of failing the whole settlement.
The miner share is not paid in one lump at settlement. It becomes a deferred liability, unlocked linearly over the deal's storage window, one epoch at a time. Testnet epochs are 60 seconds, so a 90-day deal spans about 129,600 epochs; each epoch makes roughly another 1/129,600 available. Miner income stays tied to serving the deal instead of landing entirely on settlement day.
If the deal has no miner receipts at all, the miner share has no beneficiary and goes straight back to the user. The same applies to an over-lock: if the client locked more than the quote, the excess is returned at finalize and never enters the 0/3/3/94 split.
08Cancellation, renewal, termination: what comes back
Cancelling an unfinalized deal. If miners have already committed receipts, the protocol charges max(10% of escrow, 0.01 FAR) as compensation, distributed to those miners by receipt count; the rest of the escrow is refunded. Compensation is capped at the escrow itself. With no receipts, no compensation is charged and the full escrow comes back.
compensation = min(
max(lockedFee × 10%, 0.01 FAR),
lockedFee
)
For 1 GiB · 90 days, escrow is 6.14397219176453 FAR, compensation is 0.614397219176453 FAR, and the refund is 5.529574972588077 FAR. For 1 MiB · 30 days, escrow is about 0.002 FAR — 10% of it is only 0.0002, far below the 0.01 FAR floor — so the whole escrow is consumed as compensation and the refund is zero.
Renewal. A renewal charges a full RequiredFee(size, duration) for the new window, not a prorated top-up for the remaining time. It adds a 0.02 FAR service fee and gas. The new window starts at the old expiry, or at the current time if the deal already expired; the miner share is released under the same epoch schedule over that new window.
Terminating a finalized deal. This costs 0.02 FAR. Shares already released to miners are not clawed back; the unreleased miner share returns to the owner; the 6% already paid to validators and retrieval does not. The chain also queues delete tasks so miners actually remove the shards from disk.
A failed transaction. State rolls back, service fees roll back, gas does not. Estimating the cost of a failure as “gas limit × gas price” is closer to reality than estimating it from service fees.
09Read the quote, do not guess the price
Three endpoints answer three different questions. Do not use one for another.
| Endpoint | Question it answers |
|---|---|
POST /storage/quote | The escrow, service fees, and gas for this order, and the total |
GET /fee-market | Gas price, on-chain service fees, and the feepool balance |
GET /params | Every live storage pricing parameter |
/fee-market also carries a storage block with a unit price, minimum fee, duration discounts, and a redundancy factor. It is a proposal awaiting governance, not an enforced rule; the block's own note says “quote is authoritative.” Price against the pricing and fee_breakdown returned by /storage/quote.
For wallet display, keep three lines separate: escrow, service fees, and estimated gas. Collapsing them into one “fee” makes the deposit look like a cost and turns a cancellation refund into a surprise windfall.
Finally, governance can change every parameter. A quote is computed on request; fetching a fresh one before signing is more reliable than caching any number.
Sources
- evm/x/storage/types/params.go — RequiredFee, CreateIntentFee, CancellationFee, service fee defaults
- evm/x/storage/keeper/msg_server.go — create, finalize, renew, terminate handlers
- evm/x/storage/keeper/fee_split.go — foundation / validator / retrieval / miner split
- evm/x/storage/keeper/deal_release.go — deferred miner share and epoch release
- evm/x/storage/keeper/intent_lifecycle.go — cancellation compensation
- evm/app.go — pinned fee market parameters
- evm/gateway/read.go · evm/gateway/feeschedule.go —
/storage/quoteand/fee-market