CRYPTOCURRENCY

Metamask: Why does the BIP44 derivation path generate the same address in MetaMask as the Ledger Live derivation path?

Understanding of the Derivation Paths in Metamask: A Comparary Between Led Live and BIP44

As a User of the Famous Metamask Cryptocurrency Portfolio, You have probably that it generates The Same Address for Both Live Live and Bitcoin Integration (BIP44) Derivation Routes. But why is it so? In this article, we will explore the base of metamask code to understand what is happening behind the scenes.

The Derivation Paths

In Cryptocurrency Wallets, The Derivation Routes are used to encode the private key of a user in Several Addresses. The Most Common Course of Derivation is BIP44 (Proposal to Improve Bitcoin 44), which divides the private Keys Into Six Children: M/44 '/60'/0/, M/44 '/61'/ 1/, etc. these children’s addresses can therefore be combined to generate a single address.

The Live and Metamask Wallet Has Different Derivation Routes, As Shown in The Code Snipper Below:

`Javascript

Constger_live_path = m/44 '/60'/0 '/0/0;

Const bip44_path = m/44 '/...

Note that bip44_path uses a different prefix (m/) and a slightly different structure for the child's addresses.

The Metamask Code

In the Basis of the Metamask Code, we can see how the derivation paths are code in an address:

Javascript

Const generateaddress = (path) => {

Const [Address] = Path.Split (‘/’);

Return $ {Address}/$ {Getchilden (Address)};

};

Const Getchilden = (Address) => {

// for simplicity, Suppose this function extracts the child directs from a bip44 path

// In reality, this would -mail the analysis of the bip44 output and the extraction of individual components of the address

Constain = [];

for (Let I = 1; I

Children.push (address.substring (I, I + 8));

}

Return the Children;

};

`

This “Getchilden” Function Takes A BIP44 Path as Input and Returns A Series of Guidelines for Children. These children’s addresses are then code in the final address.

because the same path of derivation in Both Wallets

Metamask: Why does the BIP44 derivation path generate the same address in MetaMask as the Ledger Live derivation path?

Now that we understand How the Derivation Paths Work, Let’s See Why Metamask Generates The Same Address Both for the Derivation Paths of the Accounting Book and for the BIP44 Derivation Courses:

In the “generateaddress” function, we simply take a bip44 path as input and divine it in individual addresses use the character /. So we Concaten Thesis Addresses for Children to Form The Final Address.

The Key Intuition here is that when they codify a bip44 path in an address, we can treat each address for children independently. In other words, if we have a bip44 route m/44 '/60'/0 '/0/0', it is equivalent to having a single address with four parts: m/44 ‘/60’/ 0 / `.

In the basis of the metamask code, we do not explicitly codify each child address in an individual. Instead, we deal with the entire process of derivation as a whole and concatenate the resulting addresses.

Consistly, Both the Master Book and the BIP44 Derivation Routes End Up Generating the Same Address in Metamask. This Might Seem Initially Controintumer, but in reality IT is a consequence of How Metamask Manages The Coding of the BIP44 Paths in Addresses.

Conclusion

Understanding the base of the metamask code can help you appreciate the way the portfolio generates addresses for both live and bip44 derivation paths. Recognizing the Differences in theBIP44_Pathis Ledder_Live_Path, we can see that the implementation of Metamask is actual equivalent, even if it uses different prefix and structure.

In the future, when working with metamask or other wallets, you will be able to appreciate the underlying mechanics that make these wallets work perfectly.

ETHEREUM DOES TAKE MINUTES

Leave a Reply

Your email address will not be published. Required fields are marked *