简体   繁体   English

每个DAPP都有自己的区块链吗?

[英]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 ? 我阅读了很多教程,并且我对区块链的基本概念有所了解,但我对于单独的DAPP和使用该DAPP的人有单独的区块链这一事实感到困惑,只会是DAPP的区块链的一部分和什么以太坊区块链中的区块真的包含?

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. dApp是一个分散的应用程序,可能有也可能没有自己的区块链。 It depends. 这取决于。

For example, there's the Ethereum mainnet, which is public, and anyone can have their dApp interact with it. 例如,有以太网主网,这是公共的,任何人都可以让他们的dApp与之互动。 In this case the dApp doesn't have it's own blockchain. 在这种情况下,dApp没有自己的区块链。

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. DApp是一个分散的应用程序。 This is usually a set made of: 这通常是由以下组成的集合:

  • a smart contract (your backend if you like) 聪明的合同(如果你愿意,你的后端)
  • some web frontend to interact with it (UI) 一些web前端与它交互(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. 因此,如果您的智能合约部署在mainnet + testnet上,您可以编写前端来支持这两者。

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. 因此,给定的DApp 可能支持多个链,但作者也可能决定根据应该运行的链来编写不同的Smart Contract + UI。

The most basic DAPP you'll write is a (javascript) frontend with a single Smart Contract stored on Ethereum as the backend. 您将编写的最基本的DAPP是一个(javascript)前端,其中一个智能合约存储在以太坊作为后端。 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. 也许机器人会写入其存储,启动其他机器人等。但这仍然是“THE”区块链的一部分,因为它只是一个交易。 Slightly more complicated than "move X$ from A to B", but still a simple transaction with a source , target and payload . 比“将X $从A移动到B”稍微复杂一些,但仍然是一个带有目标有效负载的简单事务。

There's ONE Blockchain on Ethereum, it's a chain of Block. 在以太坊上有一个区块链,它是一个Block的链条。 And a Block is a list of transactions. 而Block是一个交易清单。 And a Transaction is a source , target and payload . 事务是目标有效负载

Once you start writing more complex DAPPs, maybe Ethereum won't be sufficient anymore. 一旦你开始编写更复杂的DAPP,也许以太坊将不再充足。 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. 那就是你可以使用其他PLATFORMS的地方,它们会使用他们自己的Blockchain。

If you want more implementation details, checkout the Ethereum Yellow Paper : 如果您想了解更多实施细节,请查看以太坊黄皮书

  • "The Transaction" is described in section 4.3 “交易”在4.3节中描述
  • "The Block" is described in section 4.4. “块”在4.4节中描述。

Each Smart Contract have their own Merkle Patricia Trie which ressemble a Blockchain but it's more of an implementation detail. 每个智能合约都有自己的Merkle Patricia Trie ,它可以重新组装区块链,但它更像是一个实施细节。

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. 我写了更详细的信息,关于以太坊存储如何处理天然气和成本考虑以及为什么你可能想要使用其他东西,我希望这可以帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该使用以太坊区块链还是为我的 Dapp 创建自己的网络更好? - Should i use the Ethereum Blockchain or is it better to create my own network for my Dapp? 将Web App转换为Dapp以实现区块链 - Convert Web App to Dapp for Blockchain Implementation 如何设计DAPP区块链EVM应用程序? - How to architect the DAPP blockchain EVM app? 每笔交易在 NEAR 中都有自己的 gas 价格吗? - Does each transaction have its own gas price in NEAR? dapp是否需要使用metamask? - Does metamask is necessary for dapp? 如果我想自己开发DApp,哪个是最好的区块链框架? - Which is the best blockchain framework if I want to develop the DApp for myself? 是否有最佳实践解决方案将草稿数据存储在 dapp 中的区块链之外? - Is there best practice solution to store draft data out of blockchain in dapp? 区块链dApp:最终用户如何在不使用以太坊账户的情况下使用dApp - Blockchain dApp: How end user use dApp without care of Ethereum Account 在区块链中完成每笔交易是否需要超过几分钟的时间? - Does each transaction take more than a few minutes to finish in blockchain? 我应该使用 Pallet_membership 来处理 dapp 用户成员资格吗? (智能合约和区块链运行时的区别) - Should I use the pallet_membership to handle dapp user membership? (Differences between smart contracts and blockchain runtime)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM