The MetaMask snap platform may usher in a wave of entrepreneurship similar to mini-programs

Recommended Reading
2023-09-18 09:52:03
Collection
In addition to MetaMask providing the largest user traffic in the cryptocurrency space and a foundation of user trust, more importantly, the snap platform also gives developers a front-end page for the wallet, which can be used for various business purposes.

Author: Huang Shiliang, Lightning HSL


MetaMask, as the largest wallet in terms of user base in the cryptocurrency space, has always only supported EVM-compatible chains.

Just last week, MetaMask finally officially launched the long-awaited beta version of the Snap platform.

You can visit https://snaps.metamask.io for specific product details.

In simple terms, Snaps extends the wallet functionality of MetaMask to non-EVM-compatible chains. More accurately, as long as the private key conforms to the HD wallet (Hierarchical Deterministic Wallet) standard, it can use the Snap platform to develop and manage wallets for that chain.

HD wallets, or Hierarchical Deterministic wallets, are now almost the underlying standard for private keys across all blockchains. To understand HD wallets, two concepts must be grasped.

First is the mnemonic phrase.

The mnemonic phrase is the 12, 18, or 24 words that we write down when backing up our wallet. Essentially, the mnemonic phrase is a random number, randomly selecting 12, 18, or 24 words from a pool of 2048 words.

This random selection process is completed by a very complex algorithm, and the entropy of the mnemonic phrase generated by this algorithm is extremely strong. The probability of brute-forcing an existing mnemonic phrase is infinitely approaching zero. Thus, the mnemonic phrase derived from this algorithm is unique in the entire universe and will not collide with those produced by others.

This mnemonic phrase is also commonly referred to as a seed.

The mnemonic phrase is not used to directly manage coins, meaning it is not the private key used to construct and sign transactions. The private key, which is derived from the seed, is what can actually be used to sign transactions.

Second is the derivation path.

Once we have the mnemonic phrase, we can generate multiple addresses in MetaMask. Each address is calculated from the seed using a specific algorithm.

This algorithm and calculation process can be simply understood as the following function:

f(seed, derivationpath) -> (privatekey, public_key)

Derivation_path means the derivation path.

By using the mnemonic seed and the derivation path as parameters in the algorithm, we can calculate the specific private key and address.

The derivation path is essentially a string that looks like this: 'm/44'/0'/0'/0'.

Here, m represents the seed.

44' refers to the BIP44 standard; there are usually other standards, but BIP44 is the most commonly used.

The second number represents different cryptocurrencies, i.e., different chains. 0 is the derivation path for Bitcoin, Ethereum is 60, and Litecoin is 2.

The last digit represents the address index. If the preceding parts of two derivation paths are the same, and the last digits are 0 and 1 respectively, they correspond to the first and second addresses generated in the wallet (like MetaMask).

Additionally, there are several other concepts that are important for wallet-supported coins, such as address format and transaction data structure.

MetaMask has always only supported coins on EVM-compatible chains. All EVM-compatible chains can use the same key derivation path, and the address formats and transaction data structures of these EVM-compatible chains are identical to Ethereum, making it very convenient to use MetaMask for unified management.

However, for non-EVM-compatible chains, such as BTC and Sui, while they use the same mnemonic standard as Ethereum, their derivation paths, address formats, and transaction data structures are different.

This makes it difficult to manage using MetaMask.

Snap was designed to solve these differences.

Snap allows third-party developers to address the issues of differing derivation paths, address formats, and transaction data structures, which prevent MetaMask from managing these coins.

The way Snap manages coins is that MetaMask generates and stores the mnemonic phrase, while third-party developers create a front-end page that includes the derivation path and calls MetaMask to generate the address for that coin, displaying the address format on this front-end page.

The transaction data structure is also constructed by the front-end page.

The final transaction signature is completed by using the private key derived from the mnemonic phrase managed by MetaMask to sign the transaction.

The private keys and addresses generated using the derivation path cannot be reverse-engineered to calculate the mnemonic phrase, so the front-end wallet developed by third-party developers on the Snap platform cannot access the mnemonic phrase stored in MetaMask.

Why do I feel that Snaps will usher in a wave of entrepreneurship?

In addition to MetaMask providing the largest user traffic in the cryptocurrency space and a foundation of user trust, more importantly, the Snap platform gives developers a front-end page for wallets, which can be used for many business purposes.

Moreover, because of the mechanism like snaps.metamask.io, developers can self-certify that they cannot misappropriate users' assets; all asset usage requires users to sign with MetaMask to complete.

Many business logics in the cryptocurrency space can be migrated to Snap.

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
banner
ChainCatcher Building the Web3 world with innovators