Understanding Account Core
Account Core allows you to create and manage accounts used with Orb DLT components, such as Coin Core. This section will introduce the concepts required to use Account Core.
Basic Concepts
Accounts
The most fundamental concept within Account Core is that of an account. An account is simply an identifier within an Orb DLT installation. Each account has an account ID and a name. The account ID is guaranteed to be unique, but the uniqueness of account names is not. The utility of account names will be discussed later
The typical use of accounts is to hold a balance of one or more assets. For example, an account used with Coin Core may hold a balance of coins.
Targets
A target is a role or label that is assigned to an account when the account is created. Accounts may have no targets or may be assigned one or more targets. Targets, themselves, have no semantic meaning in the context of Account Core. They exist exclusively for use by other Core applications. For example, Coin Core uses targets to specify the ways in which an account may participate in transactions.
Advanced Concepts
Parent and child accounts
When creating an account, it is possible to specify an existing account as the new account’s parent. By doing so, it is possible to create a structured hierarchy of accounts.
The above diagram illustrates a simple hierarchical account structure. Each box in the tree represents an account. Accounts are separated into shop accounts and app accounts. App accounts are further separated into accounts for clients and managers. Shop accounts are segregated by geographic region, and further by prefecture.
###Names of child accounts
When a child account is created, its full name is formed by appending the account name to the full name of its parent account, delimited by a slash (/
). For example, in the above diagram, the full name of the account Shop B
is Accounts/Shops/Kanto/Saitama/Shop B
.
This style of naming is primarily used to facilitate easy queries ver entire subtrees of accounts in Query Core. For example, to run a query for all shops in the Kanto Region, one can specify all shops in Kanto using the partial name Accounts/Shops/Kanto/*
.
Restrictions on parent accounts
Account Core does not place any specific restrictions on how accounts may be used, however, it does provide a mechanism for other Core applications to do so. In particular, it provides the ability to make accounts ineligible to be the parent of any child accounts.
As an example of how this is used in practice, Coin Core disallows accounts with non-zero coin balances from having child accounts.
Updated almost 7 years ago