简体   繁体   中英

Does each DAPP has its own blockchain?

I am learning blockchain technology. I read many tutorials and I got the basic idea of what blockchain is but I am confused with the fact that are there individual separate blockchains for separate DAPPs and the people who are using that DAPP, will only be the part of that DAPP's blockchain and what the blocks in Ethereum blockchain really contain ?

If anyone can clear my novice doubt, that would be very helpful. Thanks in advance :)

A dApp, which is a decentralized application, may or may not have it's own blockchain. It depends.

For example, there's the Ethereum mainnet, which is public, and anyone can have their dApp interact with it. In this case the dApp doesn't have it's own blockchain.

However, anyone can fork or run their own copy of Ethereum, which in this case, it's a separately owned blockchain instance so it'll have it's down data and blocks not pegged to the public mainnet blockchain.

A DApp is a decentralized Application. This is usually a set made of:

  • a smart contract (your backend if you like)
  • some web frontend to interact with it (UI)

A specific smart contract is deployed on one or several chains. It depends what the author decided to do.

Regarding your frontend, you could implement it so it can interact with your smart contract on all the chains you support.

So if your smart contract is deployed on mainnet + testnet for instance, you could write your frontend to support both.

So a given DApp may support multiple chains but an author may also decide to write different Smart Contract + UI depending on the chain it is supposed to run on.

The most basic DAPP you'll write is a (javascript) frontend with a single Smart Contract stored on Ethereum as the backend. A Smart Contract is a Robot Account . It's a regular account WITH code AND storage.

When a transaction hits the Robot Account, the "Ethereum Machine" will start the robot and run its code. Maybe the robot will write to its storage, start other robots, etc. But this is still part of "THE" Blockchain, because it's just a transaction. Slightly more complicated than "move X$ from A to B", but still a simple transaction with a source , target and payload .

There's ONE Blockchain on Ethereum, it's a chain of Block. And a Block is a list of transactions. And a Transaction is a source , target and payload .

Once you start writing more complex DAPPs, maybe Ethereum won't be sufficient anymore. Maybe you need to store large files which is too expensive on Ethereum. That's where you may use other PLATFORMS, that are going to use their own Blockchain.

If you want more implementation details, checkout the Ethereum Yellow Paper :

  • "The Transaction" is described in section 4.3
  • "The Block" is described in section 4.4.

Each Smart Contract have their own Merkle Patricia Trie which ressemble a Blockchain but it's more of an implementation detail.

I wrote in more details about how Ethereum Storage works with gas & cost considerations & why you may want to use something else, I hope that can help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM