Ethereum Introduction - Discussion

Welcome to the discussion thread about this lecture section. Here you can feel free to discuss the topic at hand and ask questions.

1 Like

I don’t see any intro video to Ethereum. Just forum links and questions. Am I missing something or it’s some server side error?

They should all be there @tvnaresh! I see them on mine no problem! Just click the ones with the Youtube-looking arrow for the videos :slight_smile:

@FaierPlay The point is ‘Ethereum Intro’ has assignment questions even before the actual video started. Hope you got it. Thanks anyways

Ah understood! My bad.

Hmmm…I’m not seeing anything in this section other than the forum link. Am I missing something?

This seems to be out of order. The questions come before the content?

What will happen when we will deploy malicious app into the Ethereum network, I mean technical aspect of the security in EVM, how it will behave?

@filip

As with Bitcoin, are all of the newly created transactions (including ones that activate a smart contract operation) distributed throughout the Ethereum network for validation by the nodes before they are included in blocks by the miners? Do Ethereum nodes have mempools?

Do both mining and non-mining nodes execute smart contracts with the EVM?
Do both mining and non-mining nodes execute a smart contract to check and validate a transaction created to activate it, and the resulting new state of the smart contract, before this data is included in blocks by the miners?
Do all nodes then execute the same smart contract again when they receive a newly mined block containing the transaction and updated state of the smart contract, in order to check and validate this data before appending the block to their copy of the blockchain?

Are both the new account balances AND the amount transferred recorded on the Ethereum blockchain, or only the new account balances?

It will work just like any other app. No one is there to decide what’s malicious or not.

As with Bitcoin, are all of the newly created transactions (including ones that activate a smart contract operation) distributed throughout the Ethereum network for validation by the nodes before they are included in blocks by the miners? Do Ethereum nodes have mempools?

Yes and yes. But just like in bitcoin, there is no difference on a network level between full nodes and miners. The tx’s propagate to all of them at the same time. Only difference is that miners produce the blocks.

Do both mining and non-mining nodes execute smart contracts with the EVM?

Yes.

Do both mining and non-mining nodes execute a smart contract to check and validate a transaction created to activate it, and the resulting new state of the smart contract, before this data is included in blocks by the miners?

Yes, everyone does it. But it’s done after the tx is included in the block. Before that point, we can’t know what the state of the contract is going to be, since we haven’t ordered the tx yet. The tx could be included the next day, so there is no point in running the transaction and checking the state before it has been included in a block. Both mining and non-mining nodes do this. Here is a really good article that goes into detail about the entire process: https://medium.com/blockchannel/life-cycle-of-an-ethereum-transaction-e5c66bae0f6e

Do all nodes then execute the same smart contract again when they receive a newly mined block containing the transaction and updated state of the smart contract, in order to check and validate this data before appending the block to their copy of the blockchain?

Only done after a tx has been included in a block due to the reasons above.

Are both the new account balances AND the amount transferred recorded on the Ethereum blockchain, or only the new account balances?

Yes, both transactions and the current state is saved. But all the data is not saved directly on the blockchain, it only has the roots of the trie’s. You can read more about this here: https://hackernoon.com/getting-deep-into-ethereum-how-data-is-stored-in-ethereum-e3f669d96033

1 Like

Newb question… So in ETH can you only execute transactions with one other address at a time, or can you send funds to multiple different addresses in one transaction?

Thanks for those informative links! :smiley:

A few follow-up questions I’m still left with:

  • When a signed tx (one which activates a smart contract operation) is broadcast through the network and validated by the nodes before being selected by a miner and included in a block:
    Even though it doesn’t execute the smart contract, does each node still check that the smart contract operation makes sense in terms of the current state of the smart contract data stored in the Storage Trie? i.e. do the nodes do this as one of their many validation checks before adding a tx to their mempools?

  • The first article seems to suggest that only miners have a mempool (termed “transaction pool” in the article). However, both mining and non-mining nodes have a mempool, which they add validated txs to, don’t they?

  • The first article also says that the miners validate the txs they select from the mempool, before including them in a candidate block. Is this in addition to the validation checks that are performed by all nodes before adding txs to their mempools?

  • When a new block has been mined, and before distributing it to the other nodes in the network, will the miner have executed all of the smart contracts activated by the txs included in the block, and then included the State Trie’s Root Hash within the block - this root hash referencing all of the updated account balances, and the new updated states of all smart contracts by also including the Storage Trie’s Root Hash?
    When the nodes receive the newly mined block, will their validation checks include executing the smart contracts and verifying that the State Trie’s Root Hash (included in the block) corresponds to the new updated states of the smart contracts after execution? So, will they execute the smart contracts with the EVM before adding the block to their version of the blockchain, rather than after?

You can only send to one address at a time. You can of course always build a smart contracts that sends to multiple people as part of a function call. But generally, on a transaction level, it’s only to one receiver.

1 Like

When a signed tx (one which activates a smart contract operation) is broadcast through the network and validated by the nodes before being selected by a miner and included in a block:
Even though it doesn’t execute the smart contract, does each node still check that the smart contract operation makes sense in terms of the current state of the smart contract data stored in the Storage Trie? i.e. do the nodes do this as one of their many validation checks before adding a tx to their mempools?

According to what I’ve seen, the non-mining nodes only check the signatures, that the sender has enough eth to pay for gas, and that gas is sufficiently high. Apart from that they don’t check the state changes of every tx before it has been included in a block. It would probably be too much computation for a non-mining node. Unfortunately I haven’t been able to confirm this with a credible source, rather I’ve only found community forum posts which confirms this.

The first article seems to suggest that only miners have a mempool (termed “transaction pool” in the article). However, both mining and non-mining nodes have a mempool, which they add validated txs to, don’t they?

They do have a transaction pool, regardless if they mine or not. But yes, the article doesn’t mention that when discussion the non-mining nodes.

The first article also says that the miners validate the txs they select from the mempool, before including them in a candidate block. Is this in addition to the validation checks that are performed by all nodes before adding txs to their mempools?

Yes, miners would do the same validation as the non-mining nodes. They would also execute the transaction to see what changes it is making to the state. They need to know that so that they can get the new trie hash.

When a new block has been mined, and before distributing it to the other nodes in the network, will the miner have executed all of the smart contracts activated by the txs included in the block, and then included the State Trie’s Root Hash within the block - this root hash referencing all of the updated account balances, and the new updated states of all smart contracts by also including the Storage Trie’s Root Hash?

Yes, as I said above. They need to know the changes to both the state trie and transaction trie.

When the nodes receive the newly mined block, will their validation checks include executing the smart contracts and verifying that the State Trie’s Root Hash (included in the block) corresponds to the new updated states of the smart contracts after execution? So, will they execute the smart contracts with the EVM before adding the block to their version of the blockchain, rather than after?

Yes, and if, after executing all contracts, their state trie root doesn’t match the one in the block. They would discard the block.

1 Like

Hi Guys. I’m new here. Just did the Bitcoin 101 course and moving on to the rest. So far, so good.

1 Like

So, just to confirm, we are saying that:

  • When signed txs are first broadcast through the network, ALL nodes …

… then, each node will place the txs which are valid according to these initial criteria (i.e. signatures and gas) in its transaction pool (which is effectively the same as the Bitcoin mempool).

  • After miners have selected txs from the transaction pool (either from their own, another miner’s, or a non-mining node’s transaction pool), and BEFORE including these selected txs in a candidate block and starting the PoW algorithm …

…because…

… so they can also include the new State Trie’s Root Hash within the block BEFORE trying to solve the cryptographic puzzle.

Yes, correct! You are killing it dude!

1 Like

Hi there! In video about gas and gas costs, Ivan had an excel sheet about specific gas prices for every instruction in EVM. Where can I find the actual sheet with prices? I am going to learn how to do Solidity, so I think it will be very useful tool, thanks and have a great day :wink:

I am working on supply chain related project. I have tokenised some asserts as ERC 20 token and managing through an open-source wallet.
Currently only the Name (Token Name) and short Name (as a symbol) only available as standard ERC 20 token. I want to add some additional features like Manufactured data, batch number, expiry date as fixed and price as a variable information.

  1. Can I continue to use the same ERC 20 token with the additional fixed feature while creating a smart contract?
  2. How can I add a logo to each type of token ( According to my understanding it has to be added through our customised wallet, am I right)
  3. Can I add additional fixed features while creating the ERC 20 token itself?
  4. I need bulk transfer function as my asserts are in millions (small items) can I use other types of tokens.