Portal Wallet: Enabling CKB to connect with wallets around the world

Nervos Network
8 min readAug 23, 2020
Nervos gif

Since the Nervos CKB mainnet went live in November last year, many of our community members have been anxiously awaiting for decentralized applications (dApps) to go live. Would the technology we’ve talked about for so long live up to our dedicated developers’ expectations?

After several months of infrastructure development and organizing the Grants Program, we announced the CKLabs incubator. Now we’re pleased to announce the Lay2 team — one of the members of our first CKLabs cohort — has successfully released the first dApp on CKB: Portal Wallet.

Portal Wallet is not only a wallet but also a complete dApp that leverages various features of Nervos. Users do not need to download new software or generate new keys/addresses to access Nervos, they can use their existing Ethereum addresses and wallets to receive and send CKB directly. To enjoy this seamless experience, users can open the Portal Wallet with MetaMask, imToken, or a variety of other Ethereum dApp browsers to get started.

While this announcement is exciting, this is only the first step for the Lay2 team. Their vision is a wallet that is extremely simple and safe enough for anyone to use — even someone with no blockchain or cryptocurrency experience.

So what exactly is Portal Wallet and what is the technology behind it?

Portal Wallet: Connecting CKB to the world

A wallet is the gateway that connects users to the blockchain world. It is not only used asset management, but it can also serve as a “token integrator” of sorts, holding all kinds of tokens and functionality in one place. For example, DeFi governance tokens, which have become very popular with the concept of liquidity mining, are certificates of governance which would be utilized by signing transactions in wallets tointeract with various contracts.

The wallets that most users are familiar with are still limited. (It’s also worth noting that people who are familiar with blockchain wallets are still the minority, as blockchain is not yet a mainstream technology.) Typically, the wallets users know about are commonly used on Ethereum to interact with contracts. As such, non-Ethereum public chains have difficulty encouraging users to install a plug-in wallet or mobile wallet that works with their own chain, unless the chain’s ecosystem has developed enough to attract frequent users. But so far, that scenario hasn’t happened, and users are not likely to use a wallet from a chain outside of Ethereum. Portal Wallet’s response: Okay, let’s use Ethereum wallets to receive and send CKB.

Portal Wallet: Providing a simple, streamlined user experience

Portal Wallet bids farewell to the old process ofdownloading a new wallet to use a new public blockchain dApp, by allowing users to simply use their existing Ethereum address to send and receive CKB. Portal Wallet supports many mainstream Ethereum wallets, including Metamask, imToken, Coinbase Wallet, Alphawallet, Opera, ABC wallet, Bitpie, TokenPocket, and more. Using Portal wallet is similar to the user experience on many Ethereum dApps, and in many ways, the experience is even better. These transactions run on Nervos, so the congestion and expensive gas fees on Ethereum will not affect Portal Wallet users.

On Chrome with Metamask and other Web3 enabled browsers, users only need to open ckb.pw and Portal Wallet will connect to their Ethereum wallets. The Ethereum address, the Ethereum domain name address (ENS), and the Nervos CKB address can all be used to send and receive CKB. In this way, dApps on Nervos do not require creation of a new wallet or new set of addresses and mnemonics. Now, the mainstream wallets of Ethereum can be used as aCKB wallet.

Portal Wallet is also a convenient platform for users who want to buy CKB, because it provides exchange services directly in the wallet. Any user who holds USDT or ETH can directly exchange these two common tokens for CKB, creating a very easy way for them to get involved in the Nervos ecosystem and eliminates the process of buying tokens on traditional centralized exchanges and then transferring them to the CKB wallet.

When a user exchanges ETH or USDT for CKB through Portal Wallet’s flash exchange function, they can also directly access Nervos DAO. This means that general users who are not developers can finally deposit their funds into Nervos DAO without being required to synchronize a node because the Nervos DAO functionality is readily available in Portal Wallet.

Finally, Portal Wallet also has an interesting Lay2 mall, where users can buy Starbucks redemption vouchers, imKey hard wallets and other items. This mall will allow more payment options in the future and serve as a gateway from the real world to the blockchain world, enabling more opportunities for users to actually utilize wallets in their daily lives.

Portal Wallet’s impact on the Nervos ecosystem

So we can see that Portal Wallet has taken advantage of addresses and many wallet infrastructures in the Ethereum ecosystem, but in fact, there are even more use case possibilities. Since the transaction signatures used by Ethereum can be verified on Nervos through a smart contract supporting Portal Wallet (more details below), it should start to become clear that the infrastructure of other public chains or other cryptographic verification methods on the Internet may be potential user gateways as well. For example, Facebook’s public chain Libra could billions of users in the future. If Nervos can verify signatures from Libra wallets, Libra users could also use Portal Wallet to access the Nervos ecosystem.

If that possibility seems a little too far-fetched, consider fingerprint unlocking, Face ID, email, e-passports, and other tools and features we use every day. These are all based on the principle of cryptographic signature verification. For example, fingerprint unlocking, Face ID, and YubiKey are all generated based on WebAuthn standards. If WebAuthn signature verification is added to Portal Wallet, user will be able to directly sign transactions through the fingerprint ID and Face ID that they have become so accustomed to using. Users don’t need to know that this is a dApp on Nervos — or even that it is a blockchain product — because the experience isso similar to the tools they already use in their everyday lives.

Diagram showing the wallets Portal Wallet supports

Portal Wallet is a dApp based on Lay2’s Nervos Grants project PW-SDK. Now you may catch on to the fact that if Portal Wallet can directly use Ethereum wallets, as well as those of other public chains (and other Internet verification methods), other dApps built using PW-SDK can as well. As long as the PW-SDK has deployed the signature algorithm to Nervos that is required by the dApp, all of these verification methods and access through different public chain wallets are available.

Diagram demonstrating the potential for Nervos dApps based on PW-SDK

It should be apparent now that with Portal Wallet and PW-SDK, users will not have to do much in order use dApps on Nervos. This reduction of learning costs, software installation and the need to create new mnemonic phrases and addresses is a huge differentiating factor for Nervos.

For CKB dApp developers, the obstacles to user acquisition are also reduced, which is a valuable boost to the expansion of Nervos as a public chain. After all, a chain’s user base and performance are very important factors for growth.

How it works and the potential for innovation on Nervos

Portal Wallet is the first Nervos dApp, and we believe it’s also a wallet that truly has the potential to connect CKB to the rest of the world. At this point you may be wondering, “How is it possible that can a Nervos dApp can use Ethereum or verification methods on the Internet to sign transactions?”

The underlying design of Nervos was designed for situations just like this. The underlying virtual machine CKB-VM of Nervos is built on the RISC-V instruction set and can interpret various cryptographic primitives. The Nervos programming model, the Cell Model, is also built to be flexible enough that tthe verification method used to unlock a Cell l can be arbitrarily swapped in the script that allows a cell to spent (Lock Script).

With this architecture, the address construction and signature verification are part of the application layer. The signature verification rules that prove asset ownership in CKB can be customized as needed.. The default signature algorithm and hash function of Nervos CKB are secp256k1 and blake2b, respectively. The signature algorithm and hash function of Ethereum are secp256k1 and keccak256.

Once the code to create a keccak256 hash is deployed to Nervos, we have everything required to use Ethereum’s verification method to lock and unlock cells on CKB. A lock script would extract the public key from the secp256k1 signature and then call keccak256 calculate the public key hash, and derive the Ethereum address of the signer. This address is then compared against the Ethereum address that owns the cell, if they match the transaction can be completed.

Diagram demonstrating Portal Wallet’s connection with the Ethereum ecosytem and Nervos

Similarly, other public chains or the common Internet signature algorithm of WebAuthn could be deployed on Nervos in the same way, so that all dApps can freely use various types of common signature verification systems that have been in usefor a long time.

And this is only the beginning. There are more opportunities than ever for Nervos dApps thanks to the flexible underlying design of CKB-VM and the Cell model. Not only will there be more product use cases with immense potential, but these dApps will also be able to connect to the existing Internet ecosystem and will easily translate to developers’ and users’ existing knowledge and technical skills.

Now that Portal Wallet has launched, other dApps that make good use of the existing infrastructure and reduce user entry barriers may also become a new paradigm for blockchain dApp design. We’re excited to see what the future holds!

To stay updated on all things Nervos:

Join our community: DiscordGithubNervos Talk ForumTwitter

For discussions or questions join the conversation on Discord or check out one of our community Telegram channels: English, Korean, Russian, Japanese, Spanish, Vietnamese and Chinese

--

--