Skip to content

Mcashchain Protocol | Account Creation

sn-ntu edited this page Jul 9, 2019 · 1 revision

Account Creation

You can generate an offline keypair, which includes an address and a private key, that will not be recorded by Mcashchain. The user address generation algorithm is as follows:

  1. Generate a key pair and extract the public key (a 64-byte byte array representing its x,y coordinates).
  2. Hash the public key using sha3-256 function and extract the last 20 bytes of the result.
  3. Add 0x20 to the beginning of the byte array. Length of the initial address should be 21 bytes.
  4. Hash the address twice using sha256 function and take the first 4 bytes as verification code.
  5. Add the verification code to the end of the initial address and get an address in base58check format through base58 encoding.
  6. An encoded Mainnet address begins with M and is 34 bytes in length.

Please note: the sha3 protocol adopted is KECCAK-256.

To make this key pair an account in the Mcashchain network, you need to call one of the following three APIs with an account already existing in the Mcashchain network:

  • Directly call the Create Account API
  • Transfer MCASH to the new address
  • Transfer M1 tokens to the new account. Note: M20 token transfer cannot activate the account.

After the transaction is confirmed by the network, you can query the information of the account that matches the address in the Mcashchain network. Creating an account burns 0.1 MCASH from the creator, or consumes the bandwidth acquired by freezing.

Clone this wiki locally