Principal Account

To be able to carry out blockchain transactions you need a public-/private keypair. The hash of the public key is the address and also called principal account.

Mnemonic Phrase

A mnemonic phrase aids information retention or retrieval (remembering) in the human memory. In connection with a principal account the Mnemonic Phrase is a list of words that stores all the information needed for the recovery of a private key. The owner of the mnemonic phrase is able to recover the private key. It must be kept very secure!

Create Principal Account

To create a principal account you need to post a JSON file in the following format to post.aspx or the WebSocket API:

POST /post.aspx HTTP/1.1
Host: coin.codeb.io
Content-Type: application/json

{
“@type”:”specs/commands”,
“@command”:”createaccount”,
“password”:”aloaha123″,
“access_token”:”…HZ6ZiJ9.eyJzd….ZCJ9.Gl0N….J6KGu5Q”
}

The parameter @type and @command are required and have the above static values.

The content of variable password is used to encrypt the private key in the server based secure wallet.

The access_token is a bearer token and can be created with any other principal account as explained HERE.

Note: We require authentication with any valid bearer token to avoid any form of SPAM or Brute Force attacks.

The node will send an answer in the following format:

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache

{
“@type”:”specs/commands”,
“@command”:”createaccount”,
“account”:”0x4041FD82E93FF0E7d46DA7ECa64932A76FDeF731″,
“recovery_phrase”:”feature supreme change admit group glare pyramid treat project boost plug spawn”
}

The content of variable account is the address of your new principal account. You can use it also to login to our user interface: https://ssi.codeb.io/login.aspx

The value of recovery_phrase needs to stored at a secure place as it is required to recover a lost private key or password.

Note: Any owner of the mnemonic phrase is able to recover the private key. It must be kept very secure!

Recover Principal Account

To recover the private key / principal account you need to post a JSON in the following format:

POST /post.aspx HTTP/1.1
Host: coin.codeb.io
Content-Type: application/json

{
“@type”:”specs/commands”,
“@command”:”createaccount”,
“password”:”newpass”,
“recovery_phrase”:”feature supreme change admit group glare pyramid treat project boost plug spawn”,
“access_token”:”…HZ6ZiJ9.eyJzd….ZCJ9.Gl0N….J6KGu5Q”
}

As you can see the syntax is the same as when creating the account. The value recovery_phrase instructs the server NOT to generate a new keypair but to recover it from the mnemonic phrase.

Note: You can also do the above tasks via our web based user interface: https://ssi.codeb.io/register and https://ssi.codeb.io/import

Please note that after creating a new principal account it is not able from the beginning to carry out transactions. First it needs to be enable by a node operator. Also incoming transactions automatically enable a new account.