Bytom DAPP Development Notes (1): Architecture Design


brief introduction

In addition, I have done some analysis on the original DAPP chain from the original DAPP to the original DAPP chain, and I have done some analysis on the original DAPP chain, and I have done some analysis on the original DAPP chain Architecture.

DAPP architecture design

This is the basis of all the work. After reading Biyuan’s source code and using Biyuan’s wallet, we are thinking about how to do DAPP of Biyuan chain. We have tried to do DAPP with Ethereum, bitcoin and super ledger. First, summarize the pain points of blockchain DAPP

1) There is no way to ensure the authenticity of the data before the link;

2) TPS is very low;

3) Because of the high cost of access, it is necessary to build nodes by themselves;

DAPP architecture

Now I have summed up two DAPP architecture solutions based on the original chain: (if there is a new version or better solution, welcome to exchange)

DAPP must be inseparable from complex business, so it will definitely use the smart contract of the original chain. The following solutions support smart contract.

1、 Building a blockchain node

In fact, it is to build a node by yourself, and then directly call the interface provided by the node to complete the business content of the blockchain. Compared with the source code of the original chain, the wallet function is integrated, and it is more convenient to build. A few lines of code can be used to complete the construction. However, this kind of business is not reasonable, because the back-end integration is better than the original source code wallet (hereinafter referred to as “PC wallet”) This is equivalent to trusting all the account information to DAPP. In fact, it is a centralized official wallet, and all accounts are managed by the government. In this way, there will be centralization problems. Finally, it will be doubted whether it is necessary to use or not the blockchain.

Bytom DAPP Development Notes (1): Architecture Design

Compared with the original chain, it has a set of user modules. Users can use PC wallet, client wallet, mobile phone wallet, etc., their own user information can be backed up by themselves, and all transaction information can be found in the blockchain browser. This scheme only realizes the transaction chain.

PS: of course, there are still some modifications. That is to say, all interfaces of PC wallet can be implemented once in DAPP, and then combined with the business. However, the source code will be constantly updated, and it will be updated with its version, and then update its own application. Obviously, it is not practical.

Tell me about the pit inside

1)Account BTM issuesIn this scheme, the bottom layer of each DAPP account must be bound with a wallet user, which can show the address user’s own recharge, recharge directly in DAPP, and complete task dispatch. However, it takes time to initialize the account to have BTM. The normal application of such experience has long made the user close.

2)Utxo problemThe original chain is based on the utxo cost free output transaction model. When the transaction involved in by the utxo is not determined, it cannot be used. However, the user bound to DAPP cannot guarantee that he has enough utxo. Unless he splits it when transferring money, it will be similar to the one-way operation, which is also relatively slow.

3)The user cannot get his private keyIn comparison with the original chain PC wallet, it is a set of private keys, which derive multiple accounts. In this way, a wallet has a set of private keys, which cannot be given to users. This goes against the decentralization of the blockchain.

Generally speaking, this scheme only ensures DAPP transaction on the chain, but it is obviously insufficient in various aspects.

2Byone solution

This solution is a new DAPP solution launched this year compared with the original chain. There is a pain point from solution 1. This is also the solution I advocate. Now the smart contract function of the original chain is very powerful. If you want to make a complex DAPP, this method is better.

In short, we developed a plug-in wallet based on chrome. After installing the plug-in, users can directly create an account and use the account transfer function. There are BTM transfer function and account backup function. It is a relatively complete wallet. The biggest function of this wallet is that it contains rich developer API, which can support developers to realize smart contract transaction.

Bytom DAPP Development Notes (1): Architecture Design
Bytom DAPP Development Notes (1): Architecture Design

Let’s focus on this structureTechnical principle, as shown in the figure

Bytom DAPP Development Notes (1): Architecture Design

1)DAPP front end, which is the front-end page. The plug-in wallet is based on chrome, so here is the new page, which integrates the API of byone.

2)Byone, that is, you can search in the chrome app store and click Install. The current version is 2.0.0, which is very easy to use.

3)Bufferserver serverThe official demo module belongs to the cache server. In fact, this should be changed to DAPP back-end. The actual business logic still needs a lot of back-end support, such as leaderboard, non BTM and original asset transactions. (we’ll focus on a chapter later to make it clear). Now we can understand it as a back-end.

4)BlockcenterIn fact, it is a service provided by the government. Providing the interface directly can trigger the transaction function of the original chain. This solves the above solution, avoids the need to build node nodes by themselves, and makes DAPP developers easier to access.


Among the two solutions, one of the solutions thinks that it belongs to the early scheme. With the development of Biyuan chain, we can properly understand it, which helps us understand the architecture design of Biyuan chain. Moreover, in scheme 2, PC wallet must be used. It can help us developers to improve the development efficiency by 100 times, without exaggeration.

Plug in wallet is still in the process of promotion and improvement, but the function is very mature, so DAPP developers should hurry to use it to develop their own DAPP.

In the next chapter, we will focus on the DAPP development process. As well as some pits encountered, and paste source code.

Author: the bucket of genius