1

I have read a lot about smart contracts and also have seen lots of implementation tutorials. But there are some ambiguous points in it that I can’t investigate it completely.

For example: Imagine we have a dapp and its contracts have been deployed. (E.g in ethereum mainnet)

Here are my questions:

1- When we deploy our contracts, does it mean that every node that belongs to the main ethereum network has access to it and must execute it?

2- So does it mean that we have lots of smart contracts in the ethereum blockchain and all of nodes have to execute all of them at the same them?

3- Imagine that person A has deployed smart contracts of his dapp on ethereum and we have done that too. So now there are two different dapps with different contracts in ethereum. Does it mean that we can have a block in ethereum that have a transaction from the first dapp and another transaction from the second dapp? (In other words, I mean whether or not the transactions of different dapps are mined together even if they are from different dapps?)

1

When we deploy our contracts, does it mean that every node that belongs to the main ethereum network has access to it and must execute it?

Correct, every node executes every transaction in a block, and applies the resulting state changes to its local state trie. This includes the deployment of new contracts, and any subsequent interactions with them.

So does it mean that we have lots of smart contracts in the ethereum blockchain and all of nodes have to execute all of them at the same them?

Transactions are executed sequentially in the order they appear in a block. Since nodes receive the same block, they execute transactions in the same order as every other node, and independently verify the block.

Imagine that person A has deployed smart contracts of his dapp on ethereum and we have done that too. So now there are two different dapps with different contracts in ethereum. Does it mean that we can have a block in ethereum that have a transaction from the first dapp and another transaction from the second dapp? (In other words, I mean whether or not the transactions of different dapps are mined together even if they are from different dapps?)

Correct, there is nothing stopping multiple contract or non-contract transactions from appearing in the same block. They are all independent.

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.