blockchainethereumsmartcontractsconsensus

Relation among Blockchain Concepts


I am starting to learn about blockchain. After reading about the main concepts composing a blockchain network, I have some doubts that I am not able to solve despite performing many searches on the internet.

On the one hand, it is clear that transactions are grouped into blocks and the miner node that solve the consensus algorithm is the one putting the block in the distributed ledger. However, I have read that Ethereum (usually used for cryptocurrency with Ether) could be used as blockchain platform for different applications such as food traceability, assets management, etc. In this case, all these applications are using the same distributed ledger, i mean, the Ethereum distribution ledger can store different kinds of blocks, i.e. blocks from a food traceability application, from the assets management one or those derived from cryptocurrency?

On the other hand, I understand the role of smart contracts but it is not too clear for me which is the difference among the consensus and contract layer and when smart contracts are needed.

Could you help me with these doubts?

Thank you in advance for your help


Solution

  • Can the Ethereum distribution ledger store different kinds of blocks, i.e. blocks from a food traceability application, from the assets management one, or those derived from cryptocurrency?

    Food traceability, assets management, cryptocurrency, whatever the use case or name you provide at the marketing layer will have no effect on the stored data in a smart contract that runs on EVM. For example, if you use postgresql as your backend database for your next food delivery or asset management app does that changes how postgresql stores data in blocks, it's internal data representation, its indexing mechanism, or its query interface?

    When smart contracts are needed?

    The need for smart contracts is to provide permanent, transparent logic in a programming language like solidity, vyper which gets converted to bytecode, and only that bytecode is deployed in the network (Internally, it's just a transaction sent to zero address). In return, you get the contract's address to interact with the contract's ABI and you do have that permanently with its state.

    Additionally, the consensus layer will be handled by eth-node implementation so don't worry about it. You may have a look at layer 2 scaling in later phases.

    More reading should help: