Skip to main content

Accounts

The hierarchical DRM ledger has two types of accounts:

TypeDescription
issuance accountsAn issuance account can not have a balance higher than zero (0). When an issuance account transfers funds ("issues" funds) to a holding account, the issuance account balance goes negative and the holding account balance increases.
holding accountsHolding accounts are children of issuance accounts.

An entity (such as a bank) on the DRM ledger can have both a holding account and an issuance account.

Transfers between two accounts traverse the account hierarchy to find the path between two accounts. For more details, see Transfers.

An issuance account with child accounts (holding accounts) can obtain a recursive sum of all the child accounts balances in the issuance.issued_balance field. This is useful for a bank or central bank to query all the money issued to its child accounts.

note

There is a system limit of 256 root accounts. Plan your issuance hierarchy accordingly.

The diagram below outlines the basic account structure of the hierarchical DRM ledger. The USD root account, which is provided by the currency sponsor (central bank, or one or more appointed commercial banks), has no balance because it's at the root of the hierarchy but is negative 200 in issuance, meaning it has issued a total of 200 to child accounts:

  • Tungsten Bank has a balance of 90.
  • Iron Bank has balances of 110
  • The sum of 90 + 110 being 200, which matches the negative issuing balance of the root account.

Tungsten Bank has issued 500 to its child accounts, which include its own holding account and the holding accounts of Alice and Bob. Likewise, Iron Bank issued 100 to Chris (30) and Diego (70).

For Iron Bank to create a new ledger account for one of its customers, it would create it under its issuance account. To fund the new account, Iron Bank would create a transfer from its issuance account to the user's holding account (from parent account to child account).

In this example, the hierarchical ledger has three levels. However, the number of levels is technically unlimited.

Account hierarchy

Model

The data model for an DRM hierarchical ledger account is defined in transaction.proto:

API Requests

Create

To create an account on the ledger:

  • Rust
  • TypeScript
  • Dart
  • CLI
M10 REPLFOO

List (Find)

To list accounts, filter by account name or account owner:

  • Rust
  • TypeScript
  • Dart
  • CLI
M10 REPLFOO

Get

Get account details:

  • Rust
  • TypeScript
  • Dart
  • CLI
M10 REPLFOO

Output

The JSON response from the get account command should be something like

{
"id": "00000000000100000000000000000001",
"balance": 10403,
"frozen": false,
"code": "USD",
"decimals": 2,
"balance_limit": 10000,
"issuance": null
}

HTTP/1

To submit requests over HTTP/1 instead of HTTP/2 with the SDKs, use the http option.