1

When you deploy smart contract and then alter it's state in Ethereum networks (at least master and Rinkeby) you need to spend some gas = ether.

Can there be networks that don't need gas to run?

1

Sort of. In Ethereum networks there is always gas involved. And as this is Ethereum StackExchange, I assume you are referring only to Ethereum networks.

The trick is how the gas price is specified. You have at least two ways how to get free transactions:

1) Send a transaction with zero gas price to whichever network (even the mainnet). No matter how much gas the transaction uses, the price is zero so you don't have to pay anything. The problem is that the transaction will probably never be mined because miners are not incentivized to include the transaction in blocks - the transaction will probably never go through. Even if someone wants to mine a zero price transaction, it may never get propageted to his node (https://ethereum.stackexchange.com/a/2221/31933).

2) Create (or use some existing one) a private network where the miners are sure to include whatever transaction they see inside the blocks. Either the miners are controlled by you or they have some other incentive to mine zero-price transactions.

  • The miners decide their own gasprice when starting their node. It has nothing to do with choosing to include those transactions... If the gas of a tx is below the gasprice a miner has set it will not be picked up. simple as that. – Nico Vergauwen Aug 28 '18 at 7:51
  • Thanks for the comment. That depends just on the client implementation. In essence the user decides what prices to accept and if the client supports it, they can include whatever transactions they wish. Or they can even write their own client which takes only zero-priced transactions for example. – Lauri Peltonen Aug 28 '18 at 7:54
  • No it doesn't depend on the client implementation and it doesn't depend on what prices the user wants to have accepted. It depends on the node settings of the independent validators. – Nico Vergauwen Aug 28 '18 at 7:57
  • I disagree. Read for example ethereum.stackexchange.com/questions/2209/… . I edited my answer to add info about the tx propagation difficulty for 0 price tx. And there is no such thing as "independent validators". If you believe my answer is wrong or misleading, feel free to downvote it. – Lauri Peltonen Aug 28 '18 at 8:13
2

The EVM has the notion of gas because computations need to be ending. Each block has a gas limit and different operations cost a certain amount of gas, thus we can only have a limited amount of computations in a block. Otherwise the blockchain wouldn't progress, all validators would be stuck trying to validate the computation. This would be the case if infinite loops were allowed to happen.

That being said, you can set the gasprice on your validators on a PoA network to 0 , that way no ether has to be spent. Also don't forget to set that price as default on your RPC transaction calls.

The only downside is that spamming transactions becomes possible, but a PoA network with limited nodes can handle plenty of throughput.

Start your geth nodes with --gasprice '0'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.