Accounts

Register New Account

In order to register a new account in MetaLocker, you will need to provide the following information:

  • email address
  • password
  • account name
  • registration code (optional)

If successful, a new account will be created with the following contents:

  • 1x root hosted identity
    • 1x root hosted unilocker
  • 1x root managed identity
    • 1x root managed unilocker
  • 1x Persona identity
    • 1x unilocker

Options

--email value          Account email
--password value       Password [$PASSWD]
--code value           Registration Code (optional) [$REGCODE]
--identity-file value  Identity file
--name value           Full name

Examples

# you will be prompted to enter a password
metalo --server <your-instance> register --email <your-email> --name "<account name>"

# provide the password in environment variable
PASSWD=<password> metalo --server <your-instance> register --email <your-email> --name "<full name>"

# pass the registration code, if your MetaLocker instance requires it
PASSWD=<password> REGCODE=<code> metalo --server <your-instance> register --email <your-email> --name "<full name>"

# import a custom persona identity instead of generating a new one
PASSWD=<password> metalo --server <your-instance> register --email <your-email> --name "<full name>" --identity-file <path-to-file>

Output

If your account registration is successful, metalo will return the following information:

Your secret recovery phrase is: <recovery phrase>

<did>,<did-verkey>

where

  • <did> is the DID of the newly created identity
  • <did-verkey> is the DID verification key of the newly created identity

Example:

Your secret recovery phrase is: grab wall settle party mobile penalty cargo skate canyon shop tiger reason juice relief cargo tag liquid rent worth witness cube auto cactus possible

did:piprate:QSzWti3D4qQgXXXoKz2JmY,DnF1z1SqYfZrY6gEhy7VeJjd2z1T6XRYhDZEydSgsKcW

Change Email

Use change-email command to change your account’s email.

Options

--email value  New account email [$NEWUSER]

Example

METAPASS=<password> metalo --server <your-instance> --user <old-email> change-email --email <new-email>

If --email parameter is not provided, metalo will prompt to enter it interactively.

Change Password

Use change-password command to change your account’s password.

Options

--password value  New Password [$NEWPASSWD]

Example

METAPASS=<password> NEWPASSWD=<new-password> metalo --server <your-instance> --user <email> change-password

If both NEWPASSWD environment variable or --new-password parameter are not provided, metalo will prompt to enter it interactively.

Recover Account

Use `recover-account’ command to recover your own account using the recovery phrase that was generated at account creation.

Options

--rec-phrase value  Recovery phrase (received at account creation) [$RECPHRASE]
--password value    New Password [$NEWPASSWD]

Example

METAPASS=<password> metalo --server <your-instance> --user <email> recover-account

Delete Account

Use delete-account command to delete your account.

Example

METAPASS=<password> metalo --server <your-instance> --user <email> delete-account

What does it do?

  • Account details will be deleted from MetaLocker, including identities, lockers and properties.
  • Data available in the account’s lockers will remain in MetaLocker.
  • Unless the user exported identity and locker definitions, access to the user’s data and ability to publish new datasets from the user’s identities will be irrecoverably lost.

You can print the account definition in JSON format using print-account command:

Options

--detailed  include all identities and lockers (default: false)

Examples

METAPASS=<password> metalo --server <your-instance> print-account

Sample output:

{
  "account": {
    "id": "did:piprate:3f4enT91RVexWMVnneoWaJ",
    "type": "Account",
    "version": 4,
    "email": "test@example.com",
    "encryptedPassword": "",
    "state": "active",
    "registeredAt": "2022-11-21T01:12:42.063885Z",
    "name": "XX",
    "level": 3,
    "recoveryPublicKey": "9933veOw2J8RQ9cpcvHkVOc31drf25VToaJc7zbeHNI=",
    "encryptedRecoverySecret": "FRMOHV4x...iSPPu/U=",
    "defaultVault": "local",
    "managedSecretStore": {
      "level": 2,
      "masterKeyParams": "fEOGkWO9...AAAAA==",
      "encryptedPayloadKey": "1WFIK4...RswmFvlOg",
      "encryptedPayload": "P1fcBz...MNCstr"
    },
    "hostedSecretStore": {
      "level": 3,
      "masterKeyParams": "3nHq...AAAAABAAAAAAAAAA==",
      "encryptedPayloadKey": "zhUM...HQdYB",
      "encryptedPayload": "2a3Q...xDR7A=="
    }
  }
}

Note: encryptedPassword is emptied by the server to avoid password attacks.

With –detailed Option

You can print the account definition in a detailed form that includes all its identities, lockers and properties using --detailed flag:

METAPASS=<password> metalo --server <your-instance> --user <your-email> print-account --detailed

Sample output:

{
  "account": {
    "id": "did:piprate:3f4enT91RVexWMVnneoWaJ",
    "type": "Account",
    "version": 4,
    "email": "test@example.com",
    "encryptedPassword": "",
    "state": "active",
    "registeredAt": "2022-11-21T01:12:42.063885Z",
    "name": "John Doe",
    "level": 3,
    "recoveryPublicKey": "9933veOw2J8RQ9cpcvHkVOc31drf25VToaJc7zbeHNI=",
    "encryptedRecoverySecret": "FRMOHV4x...iSPPu/U=",
    "defaultVault": "local"
  },
  "identities": [
    {
      "did": {
        "id": "did:piprate:3f4enT91RVexWMVnneoWaJ",
        "verKey": "2SyEZM7WeTESXToEvAnePFEFPqhsg2MmH8DYw3H1q5wX",
        "signKey": "5LbM9qc...DarbB"
      },
      "created": "2022-11-21T01:12:42.030482Z",
      "name": "Root Identity",
      "type": "Root",
      "level": 2
    },
    {
      "did": {
        "id": "did:piprate:QSzWti3D4qQgXXXoKz2JmY",
        "verKey": "DnF1z1SqYfZrY6gEhy7VeJjd2z1T6XRYhDZEydSgsKcW",
        "signKey": "5tias...tY1CSWaE"
      },
      "created": "2022-11-21T01:12:42.0086Z",
      "name": "XX",
      "type": "Persona",
      "level": 3
    }
  ],
  "lockers": [
    {
      "id": "BKUSCuQ9sGPtMhT3Wbov6eoheMaZh37pzDdxw9uxrZL7",
      "name": "Root Managed Locker",
      "level": 2,
      "participants": [
        {
          "id": "did:piprate:3f4enT91RVexWMVnneoWaJ",
          "sharedSecret": "NehXKnDi6XKdWiMZmNhafcwZ36K1Fx8gT6u88zw6UIU=",
          "self": true,
          "rootPublicKey": "xpub661MyM...Xkz2FkMaVkS3848",
          "encryptedRootPrivateKey": "OfMfJ4p7...cWXVaT3x"
        }
      ],
      "created": "2022-11-21T01:12:42.037369Z",
      "firstBlock": 870
    },
    {
      "id": "G9Ac88w7zRaLzybnjLRztsQcXxfvCfJAcTzq2ueR26rz",
      "name": "Root Hosted Locker",
      "level": 3,
      "participants": [
        {
          "id": "did:piprate:3f4enT91RVexWMVnneoWaJ",
          "sharedSecret": "cP/WYDREd33DAR0j3TScnCqq++tRGfOujc5fzbNuD8Q=",
          "self": true,
          "rootPublicKey": "xpub661MyM...mAAeHjUFgZB",
          "encryptedRootPrivateKey": "JEu0bk2...o3kQM0Cq8"
        }
      ],
      "created": "2022-11-21T01:12:42.046057Z",
      "firstBlock": 870
    },
    {
      "id": "9MDSvpG83ZBucQgw7kWhQxEnAze6ZZJ1F171uxn8sW13",
      "name": "John Doe",
      "level": 3,
      "participants": [
        {
          "id": "did:piprate:QSzWti3D4qQgXXXoKz2JmY",
          "sharedSecret": "NloNfOyHjBrEKg3lElG+Xe6FS0TgKKejjYIVjjXvADk=",
          "self": true,
          "rootPublicKey": "xpub661M...bk8u9zC4u",
          "encryptedRootPrivateKey": "w8ypweo2...53H252/QVuyp6kvnWK",
          "acceptedAtBlock": 872
        }
      ],
      "created": "2022-11-21T01:12:42.030464Z",
      "expires": "2032-11-21T01:12:42.0086Z",
      "firstBlock": 870
    }
  ],
  "properties": {}
}

Use print-account-chart command to display a concise view of the account structure, including sub-accounts, identities and lockers.

Example

METAPASS=<password> metalo --server <your-instance> --user <your-email> print-account-chart

Sample output:

└── [ H did:piprate:3f4enT91RVexWMVnneoWaJ ]  John Doe
    └── identities
        ├── [ M did:piprate:3f4enT91RVexWMVnneoWaJ ]  Root Identity
        │   ├── [BKUSCuQ9sGPtMhT3Wbov6eoheMaZh37pzDdxw9uxrZL7]  Root Managed Locker
        │   └── [G9Ac88w7zRaLzybnjLRztsQcXxfvCfJAcTzq2ueR26rz]  Root Hosted Locker
        └── [ H did:piprate:QSzWti3D4qQgXXXoKz2JmY ]  John Doe
            └── [9MDSvpG83ZBucQgw7kWhQxEnAze6ZZJ1F171uxn8sW13]  John Doe

Letters H and M against accounts, sub-accounts and identities indicate the custody type of the entity: hosted or managed.