波卡网络中的交易费用是如何产生,如何计算的?

Polkadot生态研究院Published on 2022-03-24Last updated on 2022-03-24

Abstract

未来波卡网络将可能实现0手续费,这将有助于波卡进一步走向大众。

波卡知识图谱”是我们针对波卡从零到一的入门级文章,我们尝试从波卡最基础的部分讲起,为大家提供全方位了解波卡的内容,当然这是一项巨大的工程,也充满了挑战,然而我们希望通过这样的努力让大家能够正确认知波卡,也让不了解波卡的人方便快速掌握波卡相关知识,今天是该栏目的第37期,为大家介绍波卡网络中的交易费用是怎样的。
Gas费是以太坊首创的概念,当你在区块链网络中发起交易或者是执行程序时,就需要花费Gas费。但这也给以太坊造成了一些问题,导致较为复杂的程序在以太坊上运行会很昂贵。因此波卡采取了与Gas费不同的计量模式,极大程度的改善了用户的体验。
区块链网络中的一些资源是有限的,例如,存储和计算。交易费用可以防止个人用户消耗过多的资源。Polkadot使用基于重量(weight-based)的收费模式,而不是gas计量模式。因此,在交易执行之前要收取费用;一旦支付了费用,节点就会执行该交易。
Web3基金会的研究团队设计了Polkadot交易费用系统,基于以下原则:

  • 每个中继链区块都应进行高效的处理,以避免区块生产的延迟。
  • 中继链的增长率应该是有界限的。
  • 每个区块应该为特殊的、高优先级的交易留出空间,比如不当行为的报告。
  • 该系统应该能够处理需求的高峰。
  • 费用应该缓慢变化,以便发送者能够准确预测需要的交易费用。

费用计算
波卡中继链的费用根据三个参数计算:
重量费(Weight)

  • 基础的重量
  • 调用的重量

按字节收费(也称长度费)
tip小费(可选)
重量(Weight)是在基于Substrate的链中使用的一个固定的数字,用于管理验证区块所需的时间。每笔交易都有一个计算包含开销(例如签名验证)的基础重量,以及一个用于说明执行交易的时间的调用重量。所有的重量,甚至是基础重量,都是在某些标准硬件上执行的时间度量。
Runtime将重量单位转换为平衡单位,作为费用计算的一部分。
重量费是基础重量和调用所消耗的总权重之和。
一个交易可以包括多个调用。例如,一个批次可以包含债券和提名,而重量将是一个基本重量,然后是债券和提名的重量之和。
长度费是固定的每字节费用与交易大小(以字节为单位)的乘积。
还有一个有针对性的费用调整,作为一个乘数,根据网络拥堵情况来调整最终费用。这可以构成调整后的重量费,计算为目标费用调整数乘以重量费。
这些费用共同构成了交易费。交易费是基础费加长度费加上调整后的重量费。
交易费在交易执行前从发件人的账户中扣除。该费用的一部分将归区块链生产者所有,其余的将进入国库。这个比例分别为20%和80%。
小费是一种可选的交易费用,用户可以添加该费用以提高交易的优先级。小费不是手续费的一部分,是对区块作者优先处理交易的一种激励机制,整个小费直接归区块作者所有。

波卡


区块限制和交易优先级
Polkadot中的区块同时具有最大长度(以字节为单位)和最大重量。区块生产者将用不超过这些限制的交易填充区块。每个区块的一部分(目前为25%)被保留用于与链运营相关的关键交易。区块生产者最多只会用正常交易填满区块的75%。链运营交易的一些示例:

  • 不当行为的报告
  • 理事会的运作
  • 对选举中的成员的操作(例如放弃候选资格)

区块生产者根据每笔交易的总费用对交易进行优先级排序。由于部分费用将归区块生产者所有,因此区块生产者将费用最高的交易纳入其中,以最大化他们的奖励。

费用调整
区块链上的交易量非常不规则,因此交易费用需要一种机制来调整。从而用户能够预测交易费用。
Polkadot使用带有提示的缓慢调整费用机制来平衡这两种考虑。除了区块限制,Polkadot还有一个完整的区块目标。根据当前区块相对于目标的完整度,下一个区块的费用会增加或减少。
在24小时内,按重量计费最多可变化30%。这个费率可以捕捉到需求的长期趋势,但不包括短期的峰值。为了考虑短期峰值,Polkadot在长度和重量费用之上使用小费。用户可以选择在费用中添加小费,以赋予交易更高的优先级。

分片交易
在Polkadot分片(平行链和平行线程)中发生的交易不会产生中继链的交易费用。分片应用程序的用户甚至不需要持有DOT通证,因为每个分片都有自己的经济模型,可能有也可能没有通证。然而,在某些情况下,分片本身在中继链上进行交易。
平行链在中继链上有一个用于执行的专用插槽,因此它们的收集者不需要拥有DOT来包含区块。平行链本身会进行一些交易,例如,打开或关闭XCM通道、参与拍卖以续租其插槽或升级其Runtime。平行链在中继链上有自己的账户,需要使用这些资金代表平行链进行交易。
平行线程还将生成与平行链相同的交易。此外,收集人需要参与拍卖的每一个区块以推进他们的链。收集人需要有DOT来参与这些拍卖。

其他资源限制策略
交易重量在执行之前必须是可计算的,因此,只能表示固定的逻辑。有些交易需要用其他策略来限制资源。例如:
债券:某些交易,如投票,可能需要在链上事件后将被退回或被slash。在投票示例中,如果投票人试图做任何恶意的行为,则在选举结束时返回或被slash惩罚。
存款:有些交易,如设置链上身份或索取索引,会无限期地使用存储空间。这需要一笔押金,如果用户决定释放存储空间(例如清除他们的ide),则会退还押金。
烧毁:交易可能会根据其逻辑在内部烧毁资金。例如,如果交易创建新的存储条目,那么它可能会销毁掉发送方的资金,从而增加状态的大小。
限制:有些限制是协议的一部分。例如,提名人只能提名16名验证者。这限制了Phragmen的复杂性。

波卡

高级
以上部分仅涵盖来自普通用户的交易。但是,如果你在区块浏览器中查看区块,你可能会看到一些与这些交易不同的“外部信息”。在Polkadot(以及任何构建在Substrate上的链)中,外部信息是来自链外部的信息。外部信息分为三类:

  • 签名的交易
  • 未签名的交易
  • 固定的

这里仅介绍签名交易,这是大多数用户与Polkadot交互的方式。签名交易来自有资金的账户,因此Polkadot可以收取交易费用以防止垃圾邮件。
未签名交易适用于用户需要从不控制资金的密钥对提交外部信息的特殊情况。例如,当用户在创世之后领取他们的DOT通证时,他们的DOT地址还没有任何资金,因此使用了未签名的交易。
验证者还以“heartbeat”消息的形式提交未签名的交易,以表明他们处于在线状态。这些heartbeat必须由验证者的seession keys之一签名。seession keys从不控制资金。未签名的交易仅在特殊情况下使用,由于Polkadot无法为其收取费用,因此每个交易都需要自己的自定义验证逻辑。
最后,固定的消息(inherents)是未签名或未包含在事务队列中的信息。因此,只有区块作者才能向区块添加固定消息。仅因为足够多的验证者已经同意它们是合理的,所以假定固定消息是“真实的”。
例如,Polkadot区块包含固有的时间戳。没有一种办法证明时间戳是真实的,就像希望通过签名发送资金的方式一样。相反,验证者根据他们找到时间戳的合理程度来接受或拒绝区块。在Polkadot中,它必须在自己的系统时钟的可接受范围内。
在波卡网络中,项目团队会上传程序,这些程序会以区块链来呈现,通过租赁系统的押金来支付平行链的费用,在支付费用后,用户完全不需要关心通证之类的东西。而未来波卡的目标是完全消除对加密currency的使用,实现0手续费,这将使得波卡被更广泛的采用。

Related Reads

Will Changxin Technology Continue to Rise Today?

Changxin Technology made a historic debut on the stock market, with its share price soaring 465.82% to close at 49 yuan. Its market capitalization reached 3.28 trillion yuan, surpassing Industrial and Commercial Bank of China to become the largest company by market cap on the A-share market. Daily trading volume exceeded 140 billion yuan, a first in A-share history. This created a moment of realization for 7.7 million investors who won the lottery for its shares. On the first day, investor strategies varied: some sold immediately and later regretted missing intraday highs, others secured profits to avoid future volatility, while a third group held or even bought more shares, betting on long-term growth. The staggering IPO, massive public enthusiasm, and debut during a peak industry cycle led some to compare Changxin to PetroChina's 2007 listing, which was followed by a long decline. Key similarities noted include comparable fundraising scales (approx. 666 billion yuan for Changxin vs. 668 billion for PetroChina) and both companies listing at a perceived high point in their respective commodity cycles (oil then, memory chips now). However, analysts caution against over-simplifying the comparison. They highlight core differences: Changxin operates in the high-growth semiconductor sector with strong "domestic substitution" tailwinds. Brokerages like Huaxi Securities project significant revenue and profit growth from 2026 to 2028, driven by DDR5 adoption, product mix optimization, and economies of scale. Nomura Securities issued a "buy" rating with a 116 yuan target price, citing AI-driven demand for DRAM, tight supply as major players shift to HBM production, and Changxin's vast room for market share growth. Some analysts position the current memory cycle, fueled by AI, as just beginning, contrasting with the mature energy cycle PetroChina entered. The article concludes that for investors, monitoring the memory cycle's progression and Changxin's breakthroughs in high-end technologies like HBM will be crucial, rather than relying on superficial historical parallels.

marsbit6m ago

Will Changxin Technology Continue to Rise Today?

marsbit6m ago

Claude Designer Lags Behind Engineers, Fires Back by Creating a Million-User Tool

The article tells the story of Nate Parrott, a designer at Anthropic who created Claude Design as a side project to keep pace with his engineering teammates. When Anthropic released Opus 4.5 in November 2025, the two engineers on Parrott's Claude Code team significantly increased their output using the new AI capabilities. Parrott, the sole designer, found himself struggling to match their speed, becoming a bottleneck in the workflow. To catch up, he began experimenting in his spare time. He initially tried prompting Claude to generate designs from text descriptions and screenshots, with limited success. His breakthrough came when he shifted focus from asking Claude to "design" to asking it to generate HTML. He realized HTML could be a rich visual canvas for creating everything from slides and interactive prototypes to full web pages. He built a simple interface with a chat panel on the left and a live HTML preview on the right. The key to making the output useful was incorporating Anthropic's brand system—fonts, colors, assets, and design principles—into the prompts. This ensured generated designs were immediately on-brand. He shared an internal prototype with his team, and other product designers quickly adopted it for creating clickable prototypes, a task traditionally requiring manually drawing every state. The project's "official" turning point came during an Anthropic Labs offsite, where Parrott noticed many attendees were using his tool to build presentation slides on the fly, sometimes right before their turn to speak. This organic adoption convinced the Labs team to formally staff the project, turning the side project into a real product. Claude Design is positioned as a "pre-production" tool for visual communication and exploration—handling slides, landing pages, PDFs, emails, and social media graphics. It integrates with tools like Canva, Adobe, and Vercel. Its core value is accelerating the early stages of design: exploring directions, building consensus, and establishing systems. For actual production code, Anthropic still recommends Claude Code. The story highlights how AI disrupts workflows unevenly and how individuals can respond by building new tools to create their own advantages. Parrott's tool, born from necessity, eventually gained over a million users in its first week.

marsbit16m ago

Claude Designer Lags Behind Engineers, Fires Back by Creating a Million-User Tool

marsbit16m ago

Fields Medalist Warns: AI Could Kill Mathematics

The 2026 Fields Medal award was followed by a startling announcement: laureate Jacob Tsimerman joined OpenAI to pursue AI safety research, predicting AI would surpass humans in all mathematical proof areas within two years. Soon after, Fields Medalists Terence Tao and Timothy Gowers expressed deep concern at ICM 2026. Gorges warned that AI might "kill" mathematics not through stagnation, but through an overwhelming surplus of proofs, likening it to a lake dying from eutrophication. This concern is echoed in the "Leiden Declaration," signed by over 3,000 mathematicians including Tao, Peter Scholze, and Kevin Buzzard, advocating for mathematics as a profoundly human endeavor. However, Gowers, who did not sign, fears a future where AI-generated mathematics proliferates while human expertise and the shared intuition vital to the field vanish, turning math into an unvisited "cemetery of thought." Gowers' perspective shifted dramatically after testing ChatGPT 5.5 Pro. The AI solved a doctoral-level number theory problem and later produced a counterexample for the "unit distance problem," achievements Gorges considered publishable in top journals. He now concedes that large language models can handle advanced research, a realization that left him feeling the "rug pulled out from under" him when AI solved problems he personally contemplated. The debate extends to the nature of mathematical discovery. As noted by Peter Woit, AI agents have no interest in the "credit game" of academia. If theorems cease to be attributed to individual mathematicians, truth may simply return to its impersonal state in the universe. The central question remains: in an age of potentially limitless AI-generated discovery, what is the role and purpose of the human mind in mathematics?

marsbit48m ago

Fields Medalist Warns: AI Could Kill Mathematics

marsbit48m ago

NVIDIA's 20-Year CUDA Moat Collapsed Over a Weekend, Claude Single-Handedly Got AMD's New GPU Running

In a single weekend, Claude, an AI agent from Anthropic, successfully ported and optimized its cutting-edge model to run on a brand-new AMD MI355X server rack without any manual code intervention. This feat demonstrates a potential breakthrough in overcoming NVIDIA's long-established CUDA software ecosystem dominance, built over two decades. Anthropic's team simply instructed Claude to get the AMD machine running. By Monday, it not only worked but was showing a continuously improving performance curve. The achievement impressed AMD CEO Lisa Su and accelerated a major deployment partnership: Anthropic plans to deploy up to 2GW of AMD Instinct GPUs starting in 2027. The key enabler is AMD's new ROCm.AI platform, a toolbox designed specifically for AI agents like Claude. It provides AI-readable documentation, including chip instruction sets (ISA), and tools like the Hyperloom service that allows agents to autonomously profile performance, identify bottlenecks, test configurations, and generate optimized kernels. In a demo, Hyperloom boosted the output speed of a model by 38%. This represents a fundamental shift. While CUDA's strength lies in its vast, human-expert-driven ecosystem of tools and tacit knowledge, AMD's strategy is to make its hardware and software stack directly accessible and optimizable by AI agents. An agent can parallelize tasks—debugging, profiling, coding—that would take human engineers years to master, compressing the traditional software adaptation timeline from years to tasks. The competition is no longer just about peak hardware specs but also about how well AI can read, utilize, and tune a platform.

marsbit48m ago

NVIDIA's 20-Year CUDA Moat Collapsed Over a Weekend, Claude Single-Handedly Got AMD's New GPU Running

marsbit48m ago

Just Now, Peking University Alumna Lilian Weng Announces Resignation: The Best 'Alignment' in the AI Era Is Taking Care of Yourself

Lilian Weng, a Peking University alumnus and former OpenAI executive, has announced her departure from Thinking Machines Lab, the AI startup she co-founded with ex-OpenAI CTO Mira Murati 20 months ago. Her resignation comes shortly after the company released its first open-source model, Inkling. In her farewell message, Weng cited health reasons as the primary factor, stating that the past seven months involved more illness than any other period in her life. The intense pressure and guilt of being unable to work during critical periods, like the Inkling launch, became unsustainable. She expressed that she could not continue in a role where she felt unable to give her full effort. Weng joined OpenAI in 2018, contributing to projects like the Dactyl robotic hand and later building the Safety Systems team from scratch. She is also widely known for her influential technical blog, Lil'Log. Her departure follows a period of high expectations and challenges for Thinking Machines, which secured a record $20 billion seed round at a $120 billion valuation in 2025 but has since seen fluctuations in its valuation and the departure of other key co-founders. Weng emphasized that she remains passionate about AI but needs a more predictable and defined role without the relentless pressure of a co-founder. Her exit highlights the immense personal toll and speed of competition in the AI industry, where the drive for progress often clashes with human limits. Her decision underscores that stepping back to prioritize well-being can be an act of courage.

marsbit1h ago

Just Now, Peking University Alumna Lilian Weng Announces Resignation: The Best 'Alignment' in the AI Era Is Taking Care of Yourself

marsbit1h ago

Trading

Spot
活动图片