Where in Ethereum blockchain do transaction details of a smart contract get written?

336 views Asked by At

I have been reading about blockchain and ethereum, but I cannot seem to get my head around a couple of concepts.

First, where in the blockchain is a newly created transaction stored ? So if the blockchain has been on going for some time, and lets say we are on block X right now. If I deploy my contract today, and it gets executed, will my transaction details reside on every block after block X or only on block X + 1 ? And will my transaction details be the only details on that block, or will that block contain every transaction that happened within that time period ? Again, do all of the prior blocks transactions get written to subsequent blocks as well ? What happens if more than 1 transaction gets executed from the same contract, is just written as 2 different blocks or within the same block ?

Second, when designing a contract I have seen that it is usually restricted to two parties that enter into it, and for other people to use the contract a new instance of the contract has to be created, is this understanding correct ? Or should 1 contract be designed in a way that everyone uses it and only one instance of it is ever created ?

1

There are 1 answers

0
Urko On BEST ANSWER

where in the blockchain is a newly created transaction stored ?

In the blocks that each node stores.

will my transaction details reside on every block after block X or only on block X + 1 ?

Each transaction only resides in a block. Each block is related with the previous block, so your transaction is throughout all the blockchain.

And will my transaction details be the only details on that block, or will that block contain every transaction that happened within that time period ?

It dependes on the implementation of Blockchain. For example, Bitcoin blocks store all the transactions that have been sent throughout 10 minutes, because each block is mined every 10 minutes (more or less).

Second

Blockchain is a distributed system, where all the members are at the same level. So, they get the consensus about what they are going to do, i.e. all the members have to agree about the functions of their Blockchain.

For each Blockchain, you can have more than one contract. But I'm going to explain it more simply. The Smart Contract is the code that is installed on all the nodes of the Blockchain, and every request is executed against it. So, every node/member must have the same.