以太坊gas limit什么意思
一、智能合约这么好,可不是白用的
"Strong" one, smart contracts are so good, they're not for nothing.
智能合约,顾名思义,是指计算机代码可以自动执行的合同;以太坊虚拟机是用来执行智能合约的;智能账户是智能合约能够被执行的载体。换句话说,智能账户,这个“账户”是可以被以太坊虚拟机操控的,依据什么操控呢,依据智能合约来操控。
Smart contracts, by definition, refer to contracts in which computer codes can be executed automatically; Ether's virtual machine is used to execute smart contracts; smart accounts are vehicles in which smart contracts can be executed. In other words, smart accounts, this “account” can be controlled by a Tai's virtual machine, based on what, and by which, smart contracts.
天下没有免费的午餐,智能合约这个功能这么好,可不是白用的,你在以太坊进行交易的时候也要付给矿工手续费的,那么在以太坊系统上,你要付出的手续费是怎么回事,
There's no free lunch in the world, there's no such thing as a smart contract, it's not for nothing, you pay a fee to a miner when you're dealing in Ether, so what's the charge on the Ether system?
Gas和手续费之间又有什么关联呢?
What's the connection between Gas and the fees?
二、 以太坊 Gas 是怎么回事?
以太坊Gas类似于汽车燃油,智能合约的驱动,需要以太坊Gas。Gas是一个英文单词,中文意思是:瓦斯、汽油,这个东西在日常生活中,是一种消耗品。以太坊为什么会产生“燃料”呢?
Gas, which is like car fuel, is driven by a smart contract. Gas is an English word, meaning: gas, gasoline, this is a consumer in everyday life. Why does Etheria produce "fuels"?
以太坊里面的Gas是什么意思呢?其实,以太坊的Gas和交易费息息相关。以太坊交易需要手续费,这个Gas就是以太坊手续费的计算模式。
What do you mean, Gas? In fact, Gas is related to transaction costs. This Gas is a method of calculating fees.
在以太坊的设定中,交易费类似于一种加密的燃料,也就是Gas,这个东西可以驱动智能合约的运动。当以太坊在区块链上执行交易时,燃料将按照特点的规则而逐渐被消耗。
In Ether's setting, the transaction fee is similar to an encrypted fuel, Gas, which drives the intelligent contract movement. When Ether carries out the transaction on the block chain, the fuel will gradually be consumed according to the characteristic rules.
从这一点看呢,Gas真的是和它的本意一样,像汽车燃油一样,想要发动汽车,必须需要燃油。
From this point of view, Gas is really what it was meant to be, like car fuel, to start a car, it had to be fueled.
三、 以太坊 Gas 和比特币交易费有哪不同?
III, what difference does it make between the trade fees in Ethio Gas and Bitcoin?
说到手续费,大家可能很熟悉。天下没有免费的午餐,无论是以太坊,还是比特币,都需要手续费,但是二者的手续费模式是不一样的。比特币是直接支付比特币作为转账手续费的,以太坊却不是这样的。
As far as fees are concerned, they may be familiar. No free lunches in the world, whether in Etheria or Bitcoin, require fees, but they are in a different way. Bitcoins pay Bitcoin directly as a transfer charge, not in Ethio.
以太坊本质上是一个虚拟机,这个虚拟机是去中心化的,全世界各国人民各自掌控的虚拟机,联合起来形成一个“世界级的计算网络”。当你发送token,执行合约、转移以太坊,或者在区块上做其他事情时,计算机在处理这笔交易时,需要进行计算,这个计算过程需要消耗网络资源。这样一来,你必须支付“燃料费”(也就是Gas),才能让计算机为你工作,让矿工为你处理交易。
In essence, Ether is a virtual machine, which is decentralized, a virtual machine owned by the peoples of the world, that unites to form a “world-class computing network.” When you send token, execute contracts, transfer Ether, or do something else on the block, the computer has to calculate the transaction, and the calculation process has to consume network resources. In this way, you have to pay “fuel fees” (that is, Gas) in order for the computer to work for you and for the miners to handle the transaction for you.
通常情况下,发送方愿意支付的Gas价格越高,矿工从交易中获得的价值就越大,矿工们也就越有可能选择这个交易。通过这种方式,矿工可以自由地选择交易。为了给发送者设置Gas 价格做参考,矿工们可以直接提出他们执行交易所需的最低Gas 价格。
Typically, the higher the price the sender is willing to pay for Gas, the greater the value the miners get from the transaction, the more likely the miners are to choose the transaction. In this way, miners are free to choose the transaction.
四、 以太坊 Gas 的消耗量该如何计算?
以太坊虚拟机处理交易时,虚拟机会根据交易中确定的一个一个的操作指令进行逐个处理,而每个操作指令都有明文规定的Gas消耗量。
When dealing with transactions with the Taiwan virtual machine, the virtual opportunity is handled on a case-by-case basis on the basis of one of the operational instructions identified in the transaction, each of which has a specified level of Gas consumption.
以太坊系统规定了两个账户:一个是正常账户,一个是智能账户。
The Etherbank system provides for two accounts: one is a normal account and one is a smart account.
普通的转账交易,也就是调用“正常账户”,所需要的Gas是固定的21000;
(a) The normal transfer transaction, i.e. the call to the “normal account”, requires that the Gas be fixed at 21,000;
而调用“智能账户”的的话,因为智能合约的复杂程度不同,使得所需要的Gas也不同。处理交易占用的资源(计算量、内存等)越多,那么所需要的Gas也就越多,比如:执行一次加法运算将消耗 3Gas,如果执行更复杂的运算,那么消耗的Gas就更多。
The more resources (calculations, memory, etc.) are needed to handle a transaction, the more Gas is needed, for example, to run a one-up operation that will consume 3 Gas, and if more complex calculations are performed, the more Gas is consumed.
那么大家可能会问一个问题:当用户的交易涉及一个恶意的智能合约,这个合约超级复杂,执行这个合约要消耗无限的燃料,怎么办呢?以太坊系统的方案是:为了避免恶意
So you might ask one question: when a user's deal involves a malicious smart contract, which is so complicated, what happens when the contract is executed with unlimited fuel? The idea of the Etherwood system is to avoid malice.
智能合约引起无限的Gas消耗,用户需要在发送交易时设定允许消耗的燃料上限,即
Smart contracts cause unlimited gas consumption, and users need to set a maximum allowable fuel consumption limit at the time of the transaction, i.e.,
GasLimit,这样一来,就算有恶意智能合约,最坏情况也只是消耗 GasLimit 所规定的燃料范围之内。
GasLimit, even with malicious intelligence contracts, the worst-case scenario is to consume the fuel range specified by GasLimit.
五、以太坊 Gas 和交易手续费有什么关系?
What does it have to do with the transaction fee?
以太坊上,你所支付的手续费等于:GasPrice 乘以GasUsed。
By the way, the fee you pay is equal to: GasPrice multiplied by GasUsed.
你可以把 GasPrice 理解为是燃油单价, GasUsed 理解为汽车所需多少升燃油。
You can interpret GasPrice as the unit price of fuel, and GasUsed as how many litres of fuel would be needed for cars.
对于汽车,假如说每升汽油是20块钱,一万升汽油就是20万块钱。对于以太坊,每
For cars, if every litre of gasoline is 20 dollars, 10,000 litres of gasoline is 200,000 dollars.
Gas是20吉伟(吉伟是以太币的数量单位),一万个 Gas 就是:20乘以一万,等于20 万吉伟,2万吉伟等于0.0002以太坊,也就是说,本次交易手续为 0.0002以太坊。
Gas is 20 gigabytes, 10,000 of which is: 20 times 10,000, which is 200,000 gigabytes, and 20,000 gigabytes, which means that the transaction is 0.0002 and 0.0002.
具体的兑换值见下表:
The specific exchange values are shown in the table below:
气体的限制
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。