Support to HD key generation using BIP-44#321
Support to HD key generation using BIP-44#321maneeSHA-256 wants to merge 5 commits intodevelopmentfrom
Conversation
|
./rubixgoplatform createdid -didType 4 -accountType 1 -changeAddr 0 -addrIndex 2 -port 20000 . Is this supposed to give deterministic did everytime I call? |
Yes, a specific path should return deterministic key pair and thus deterministic did everytime. |
I'm sorry, No, this won't give deterministic did. We have to pass the mnemonic file path to get deterministic did. Without passing the mnemonic, it will generate new mnemonic everytime. |
Hierarchical deterministic wallets (HD wallets) provide a convenient way to manage multiple addresses and private keys from a single master seed. HD wallets use a tree structure where parent keys can produce children keys infinitely, allowing for organized transactions by type or entity. They offer the advantage of creating public keys without accessing corresponding private keys, enhancing security.
Rubix already supports BIP-32 and BIP-39. It is time to introduce BIP-44 in Rubix so that RBTs can be easily handled in any HD wallet.
BIP 44 - builds upon BIP 32 by providing a specific organizational structure for multi-account wallets, allowing users to manage different cryptocurrency accounts within the same wallet while maintaining a hierarchical deterministic structure. It introduces the concept of ‘account levels’ and ‘purpose levels’ to create a hierarchical structure for keys. Each account has its own subtree, allowing for better organization and separation of funds.
The derivation path used in BIP44 follows this structure:
m / purpose' / coin_type' / account' / change / address_indexEach element in the path has a specific meaning:
m: This is the master node and represents the root of your HD wallet.
purpose: Always set to 44' for BIP44 compliant wallets.
coin_type: Specifies the type of cryptocurrency. Each cryptocurrency has a specific number assigned, such as 0' for Bitcoin and 60' for Ethereum. For Rubix, it is 1001 for Mainnet DIDs and 1002 for Testnet DIDs.
account: A BIP44 wallet can have multiple accounts, and this number represents each unique account.
change: This is either 0 for external (receiving) addresses or 1 for internal (change) addresses.
address_index: Represents the individual addresses generated under each account.
Using the BIP44 protocol, users can manage multiple coins, accounts, and addresses under a single master seed, created using the BIP39 protocol.
This brings us some extra flags for DID creation. For example,
./rubixgoplatform createdid -didType 4 -mnemonicKeyFile /mnemonic/file/path/ -accountType 1 -changeAddr 0 -addrIndex 2 -port 20000