Accounts

Crypto wallets or accounts play a fundamental role in blockchain ecosystems, acting as gateways for users to interact with and manage their digital assets. They serve as storage for cryptographic keys that enable access to these assets on a blockchain network.

On various blockchains like Bitcoin, Ethereum, CosVM, and others, wallets or accounts can be created and represented in diverse ways. Each blockchain often has its unique method of generating addresses and managing account information.

In the case of CosVM, developers who engage with account types for wallet integration on decentralized application (DApp) front-ends need to comprehend the specific nuances of account management on this blockchain. It's crucial to note that accounts on CosVM are designed to be compatible with Ethereum-type addresses.

CosVM, being designed with Ethereum compatibility in mind, adopts a similar address structure. Therefore, developers working on dApps or integrating wallets with CosVM need to understand that the accounting system employed by CosVM operates in a way that aligns with Ethereum's address format. This compatibility allows for a smoother transition and interaction between applications built on Ethereum and those built on CosVM.

Creating Accounts

Creating an account on CosVM blockchains involves different methods, including generating a private key, a Keystore file (protected by a password), or a mnemonic phrase, which is a string of words granting access to multiple private keys.

The significant distinction between these methods, apart from security features, lies in the account creation count. While a private key or keystore file produces only one account, a mnemonic phrase provides control over numerous accounts, all accessible with the same phrase.

CosVM, like many other blockchains, supports the creation of accounts using mnemonic phrases, employing a system known as hierarchical deterministic key generation (HD keys). This functionality empowers users to generate accounts without the need to manage distinct secrets for each.

HD keys generate addresses by combining the mnemonic phrase with a specific piece of information termed a derivation path. Different blockchains might support varying derivation paths. Thus, to access all accounts associated with a mnemonic phrase on a specific blockchain, it is crucial to use that blockchain's designated derivation path. This ensures seamless access to and management of accounts by using the correct derivation path specific to each blockchain, including CosVM.

// Here is the detailed diagram of Account creation in CosVM

   Account 0                       Account 1                       Account 2

+------------------+        +------------------+        +------------------+
|      Address 0    |        |      Address 1    |        |      Address 2    |
|          ^        |        |          ^        |        |          ^        |
|          |        |        |          |        |        |          |        |
|          |        |        |          |        |        |          |        |
|          +        |        |          +        |        |          +        |
|   Public key 0    |        |   Public key 1    |        |   Public key 2    |
|          ^        |        |          ^        |        |          ^        |
|          |        |        |          |        |        |          |        |
|          |        |        |          |        |        |          |        |
|          +        |        |          +        |        |          +        |
|  Private key 0   |        |  Private key 1   |        |  Private key 2   |
|          ^        |        |          ^        |        |          ^        |
+------------------+        +------------------+        +------------------+
       |                          |                              |
       |                          |                              |
       |                          |                              |
       +----------------------------------------------------------+
                                  |
                                  |
                     +------------+------------+
                     |                         |
                     |   Master PrivKey        |
                     |                         |
                     +-------------------------+
                                  |
                                  |
                     +------------+------------+
                     |                         |
                     |   Mnemonic (Seed)       |
                     |                         |
                     +-------------------------+

Last updated