Original title: "DApp developers, are you here to embarrass me? "
Original author: Alex Roan
Translation: Nuka-Cola
Although decentralized applications do not Less tantalizing promises, but really well-rounded results don't seem to be coming on a large scale. The good news is that some projects are already making explorations and attempts, including Torus, Fortmatic, Portis, Unilogin, and Authereum, which hope to be used for next-generation wallet solutions that compete with Metamask and emphasize de-bottomization. But personally, I feel that these current projects are not enough to truly represent the future of DApps.
Over the past few years, DApps have left me The user experience is not very good. As a user, every time I try to send a transaction on the blockchain, an ugly window pops up, prompting me for confirmation, warning that there will be a cost, and just plain uncomfortable.
I already have a lot of experience in using it, so I'm still getting used to it. But other newcomers are likely to be intimidated away from the blockchain platform. This kind of problem is still unchanged today, and every time you try to operate, there will be a scary pop-up window, which eventually leads to a very high churn rate for DApps.
I can understand that as the operator of the platform, they want to ensure that users are aware of some of their The operation will incur a fee. After all, if the reminder obligation is not fulfilled, the user group will definitely complain soon, and even be surprised that there is no money in their Ethereum account. However, to achieve the goal, a more scientific and reasonable method should be used.

Figure 1: Metamask transaction confirmation blockquote>
Take Figure 1 as an example, unless you are very familiar with Ethereum wallets, DApps, and even the entire cryptocurrency industry, you have no idea what this window is for , some users may even think that this is a fraudulent website, because the design of the pop-up window generated by clicking the button is often linked to words such as poor quality and unreliable. However, this has instead become the industry norm, and whenever a user wants to interact with a smart contract, a pop-up will appear.
More than that, sometimes users even need to install a full extension to interact with the DApp. Fortunately, the situation is slowly changing, Opera has released support for DApps in its mobile browser, and other wallets are now starting to have built-in DApp browsers. But all of this is only in the niche stage, and it has not yet entered the mainstream.
In other words, unless Google can support DApps in its Chrome browser, or Mozilla provides a similar option on Firefox, this problem will never be solved. No matter how nice and friendly the pop-ups are designed (Fortmatic uses a curved frame design), and how many niche products start to support Web3 injection, the problem will continue to exist.
"Hide" your backend
Using Metamask and other Web3 injectors Users are already familiar with this way of working, they have a lot of experience, so they will not be intimidated by DApps. But I think it's a waste of time to simply make the experience more fancy, smoother, or more rounded. That's not enough to really attract a mainstream audience, as substantial barriers still exist. In other words, what really scares them off is that they don't quite understand what's going on.
Instead of focusing on simplifying the injection experience for Web3, it should be completely scrapped. We can build a platform that allows users to interact directly with smart contracts without involving any smart contracts or blockchain elements. Only through this "de-substratum" measure can the public truly accept this new trading platform and user experience.
You might as well learn to think like a bank - the bank will never show off the internal functions of the system, but provide a visible and understandable Options let the user decide. This de-basic design strips out the heavy background system to ensure that users will not easily touch it.
But how to realize all this?
Most DApp development tutorials teach about Web3.js or Web3.py knowledge, and how to interact with the injected Web3 instance in the browser through these libraries. This is how most DApps are built, often exposing the underlying plumbing and causing Metamask usage to be filled with annoying popups. As mentioned before, this design is suitable for advanced users, but we can also hide the pipeline completely, that is, we do not require Web3 support on the client side.
It is necessary for us to build a platform that does not require Web3 injection. Specifically, users should be able to sign up with their own email and password, or even social logins like Twitter, Google, and Facebook. In short, the more familiar and relatable everything is, the better.
Many friends may think that this is difficult to achieve, but proven trusted frameworks such as Laravel can fully work, bringing more "normal" to mainstream users perception and experience.
After logging in and entering the dashboard, we should guide the user to create their own account. Just click a button and the backend generates a new Ethereum address.
But some friends may ask: "What about the private key?"
First of all , for mainstream users, whether the private key is in their hands or not is actually not a big problem. I know that centralizing all the private keys is not a good idea, and even goes against the whole value proposition of blockchain technology. Therefore, we should help users retain private keys at a minimum, purely for the purpose of enhancing ease of use.
Secondly, please do not store the private key as plaintext or even as a hash value. Both Web3.js and Web3.py provide encryption and decryption functions, and these functions require the use of private keys. As long as you cooperate with the password specified by the user, you can ensure that the private key is safe and worry-free.
So you can store these keys with your account on a centralized platform, thus eliminating the need to expose Web3 and use Metamask.
Focus on expanding user scale
Suppose you are building a set of Ethereum smart contracts as For the back-end payment platform, you need to know that your users need to interact with the platform, but you don't want to set too high a barrier to entry in terms of Metamask and wallet usage. This is the mainstream situation - users just want to use your product, not spend hours learning Web3. Therefore, the most important thing is to first establish a platform that can register and log in through Facebook, Google and other social networks.
Build a set of dashboards for users to create accounts. If you’re worried about blockchain jargon scaring them off, try to use more friendly expressions. During the creation process, users can be asked to provide a pin code or encrypted password, or they can directly use their login password for private key encryption. The encrypted private key will be stored in the database along with the user details.
Of course, transacting on the blockchain is not free, and neither is the product itself. FIAT is still the best in the crypto space, and you can use Stripe or similar as your primary payment method. Regardless of how you end up choosing a payment method, including a one-time fee or a subscription model, you can load user wallets with Ether when receiving payments. What users see is that they need to pay a regular monthly fee. But in the bottom layer, the user's account has been recharged and can interact smoothly with your smart contract ecosystem.
Whenever a user submits a transaction to a smart contract through your platform, the platform should control how the prompt message is worded. Since their key is already encrypted within the database, decrypting the key and submitting a transaction through the account should only require the user to enter a pin code for confirmation. That's what traditional banking apps do, never with scary notifications via ugly Metamask. In short, everything should give priority to customer satisfaction, familiarity and habit.
Web3.py Example
The following code examples require that you already have Python3, Web3.py (installable via pip) and the Infura account and URL to access the blockchain.
Below, we will introduce step by step how to create an account, use the password to generate an encrypted version of the account, and then decrypt it through the Web3.py server according to user requirements. In conclusion, the whole process should not expose any functionality on the front end. Web3.js also provides this functionality.
In the Python terminal, run the following command:
< p>Since the encrypted keystore is saved, the platform does not know the content of the private key. The only prerequisite for decrypting and signing a transaction is knowing the value of userPassword. Here's how to do this:
Only need to use this private key to sign the transaction on behalf of the address.
Original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia